#1085165 libgrokj2k: FTBFS on armhf: ‘vreinterpret_f16_u16’ was not declared in this scope

#1085165#5
Date:
2024-10-15 16:48:04 UTC
From:
To:
This package failed to build against Perl 5.40 on armhf.
It built fine in March, and the error looks unrelated to Perl.

https://buildd.debian.org/status/logs.php?pkg=libgrokj2k&arch=armhf

The reproducible builds test history suggests it regressed in July
or August. Probably a GCC 14 related change?

https://tests.reproducible-builds.org/debian/history/armhf/libgrokj2k.html

Copying the arm porter list for help.

   [  5%] Building CXX object src/lib/core/highway/CMakeFiles/hwy.dir/hwy/targets.cc.o
   cd /<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/lib/core/highway && /usr/bin/c++ -DHWY_STATIC_DEFINE -DSPDLOG_COMPILED_LIB -I/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/lib/core -I/<<PKGBUILDDIR>>/src/lib/codec/common -I/<<PKGBUILDDIR>>/src/lib/codec -I/<<PKGBUILDDIR>>/src/include -I/<<PKGBUILDDIR>>/src/lib/core -I/<<PKGBUILDDIR>>/src/lib/core/plugin -I/<<PKGBUILDDIR>>/src/lib/core/wavelet -I/<<PKGBUILDDIR>>/src/lib/core/t1 -I/<<PKGBUILDDIR>>/src/lib/core/t1/part1 -I/<<PKGBUILDDIR>>/src/lib/core/t1/part1/impl -I/<<PKGBUILDDIR>>/src/lib/core/t1/OpenHTJ2K -I/<<PKGBUILDDIR>>/src/lib/core/t1/OpenHTJ2K/coding -I/<<PKGBUILDDIR>>/src/lib/core/t1/OpenHTJ2K/common -I/<<PKGBUILDDIR>>/src/lib/core/t1/OJPH/common -I/<<PKGBUILDDIR>>/src/lib/core/util -I/<<PKGBUILDDIR>>/src/lib/core/codestream -I/<<PKGBUILDDIR>>/src/lib/core/codestream/markers -I/<<PKGBUILDDIR>>/src/lib/core/point_transform -I/<<PKGBUILDDIR>>/src/lib/core/t2 -I/<<PKGBUILDDIR>>/src/lib/core/tile -I/<<PKGBUILDDIR>>/src/lib/core/scheduling -I/<<PKGBUILDDIR>>/src/lib/core/filters -I/<<PKGBUILDDIR>>/src/lib/core/highway -I/<<PKGBUILDDIR>>/src/lib/core/cache -I/<<PKGBUILDDIR>>/thirdparty/liblcms2/include -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fvisibility=hidden -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -fvisibility=hidden -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wno-builtin-macro-redefined -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -fmerge-all-constants -Wall -Wextra -Wconversion -Wsign-conversion -Wvla -Wnon-virtual-dtor -fmath-errno -fno-exceptions -MD -MT src/lib/core/highway/CMakeFiles/hwy.dir/hwy/targets.cc.o -MF CMakeFiles/hwy.dir/hwy/targets.cc.o.d -o CMakeFiles/hwy.dir/hwy/targets.cc.o -c /<<PKGBUILDDIR>>/src/lib/core/highway/hwy/targets.cc
   In file included from /<<PKGBUILDDIR>>/src/lib/core/highway/hwy/highway.h:358,
                    from /<<PKGBUILDDIR>>/src/lib/core/highway/hwy/per_target.cc:21,
                    from /<<PKGBUILDDIR>>/src/lib/core/highway/hwy/foreach_target.h:81,
                    from /<<PKGBUILDDIR>>/src/lib/core/highway/hwy/per_target.cc:20:
   /<<PKGBUILDDIR>>/src/lib/core/highway/hwy/ops/arm_neon-inl.h: In function ‘hwy::N_NEON::Vec128<float, 4> hwy::N_NEON::PromoteTo(Full128<float>, Vec128<hwy::float16_t, 4>)’:
   /<<PKGBUILDDIR>>/src/lib/core/highway/hwy/ops/arm_neon-inl.h:3081:40: error: ‘vreinterpret_f16_u16’ was not declared in this scope; did you mean ‘vreinterpret_s16_u16’?
    3081 |   const float32x4_t f32 = vcvt_f32_f16(vreinterpret_f16_u16(v.raw));
         |                                        ^~~~~~~~~~~~~~~~~~~~
         |                                        vreinterpret_s16_u16
   /<<PKGBUILDDIR>>/src/lib/core/highway/hwy/ops/arm_neon-inl.h:3081:27: error: ‘vcvt_f32_f16’ was not declared in this scope; did you mean ‘vcvt_f32_bf16’?
    3081 |   const float32x4_t f32 = vcvt_f32_f16(vreinterpret_f16_u16(v.raw));
         |                           ^~~~~~~~~~~~
         |                           vcvt_f32_bf16

#1085165#16
Date:
2024-10-21 21:25:03 UTC
From:
To:
Hi,

I got a build going through on armhf with the below workaround,
in which I used indications from ArchitectureSpecificsMemo[1]
to reroute the code to safe fallbacks on armhf as well as armel,
without affecting arm64:
-------8<--------------8<--------------8<--------------8<-------
--- libgrokj2k-10.0.5.orig/src/lib/core/highway/hwy/ops/arm_neon-inl.h
+++ libgrokj2k-10.0.5/src/lib/core/highway/hwy/ops/arm_neon-inl.h
@@ -3074,7 +3074,7 @@
   return Vec128<int64_t, N>(vget_low_s64(vmovl_s32(v.raw)));
 }

-#if __ARM_FP & 2
+#if __ARM_FP & 2 && !(__arm__ && __ARM_EABI__ && __ARM_PCS_VFP)

 HWY_API Vec128<float> PromoteTo(Full128<float> /* tag */,
                                 const Vec128<float16_t, 4> v) {
@@ -3203,7 +3203,7 @@
   return Vec128<int8_t, N>(vqmovn_s16(vcombine_s16(v.raw, v.raw)));
 }

-#if __ARM_FP & 2
+#if __ARM_FP & 2 && !(__arm__ && __ARM_EABI__ && __ARM_PCS_VFP)

 HWY_API Vec128<float16_t, 4> DemoteTo(Full64<float16_t> /* tag */,
                                       const Vec128<float> v) {
-------8<--------------8<--------------8<--------------8<-------

Then I learned about #1068872, so I stopped whatever testing I
had planned (interference of the patch on other archs, maybe
installing the package to make sure it has no obvious defects,
that sort of things).  The patch is available in case one wants
to take over from here.

[1]: https://wiki.debian.org/ArchitectureSpecificsMemo

In hope this helps,
-- 
  .''`.  Étienne Mollier <emollier@debian.org>
 : :' :  pgp: 8f91 b227 c7d6 f2b1 948c  8236 793c f67e 8f0d 11da
 `. `'   sent from /dev/pts/3, please excuse my verbosity
   `-    on air: Space Debris - Journey Back To The Moon

#1085165#23
Date:
2024-10-24 10:20:39 UTC
From:
To:
Hello,

Project maintainer here.

I will be releasing a new package for libgrokj2k in the coming week, which should address this armhf bug.

Cheers,
Aaron

#1085165#28
Date:
2024-11-14 12:25:31 UTC
From:
To:
Hello Again,

I have a fix for this bug waiting in debian mentors upload
https://mentors.debian.net/package/libgrokj2k/

Unfortunately my sponsor is not responding to my requests to upload the new version
to unstable.

I just received email that the package is slated for removal from testing.

If anyone on this thread is able, would you mind uploading this package ?

Many Thanks,
Aaron