ebiggers / libdeflate

Heavily optimized library for DEFLATE/zlib/gzip compression and decompression

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aarch64 build failure

ffontaine opened this issue · comments

The following build failure is raised on aarch64 by buildroot autobuilders since version 1.15 and
84c76f6:

In file included from /home/autobuild/autobuild/instance-22/output-1/build/libdeflate-1.15/lib/arm/crc32_impl.h:256,
                 from /home/autobuild/autobuild/instance-22/output-1/build/libdeflate-1.15/lib/crc32.c:227:
/home/autobuild/autobuild/instance-22/output-1/build/libdeflate-1.15/lib/arm/crc32_impl.h: In function 'clmul_u32':
/home/autobuild/autobuild/instance-22/output-1/host/lib/gcc/aarch64-buildroot-linux-gnu/10.4.0/include/arm_neon.h:26723:1: error: inlining failed in call to 'always_inline' 'vmull_p64': target specific option mismatch
26723 | vmull_p64 (poly64_t __a, poly64_t __b)
      | ^~~~~~~~~
In file included from /home/autobuild/autobuild/instance-22/output-1/build/libdeflate-1.15/lib/crc32.c:227:
/home/autobuild/autobuild/instance-22/output-1/build/libdeflate-1.15/lib/arm/crc32_impl.h:262:19: note: called from here
  262 |  uint64x2_t res = vreinterpretq_u64_p128(
      |                   ^~~~~~~~~~~~~~~~~~~~~~~
  263 |     compat_vmull_p64((poly64_t)a, (poly64_t)b));
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Full build log: http://autobuild.buildroot.org/results/9ae/9aee8dafea614db77209818b913a571534466506/build-end.log

I don't know how to fix this build failure so I'm seeking advise here.

This does not reproduce for me using the same version of aarch64-linux-gnu-gcc (10.4.0) and the same optimization flag (-Og).

I do not see any issue in the code either.

Is there a specific procedure that I can follow to reproduce this?

I also tried:

  1. git clone https://git.buildroot.net/buildroot (resulting in commit 037226b33b42)
  2. make menuconfig and select Target options -> Target Architecture (AArch64 (little endian)), Toolchain -> GCC compiler Version (gcc 10.x), and Target packages -> Libraries -> Compression and decompression -> libdeflate
  3. make -j32

The build completed successfully with the libdeflate binaries in the output directory.

Please provide reproduction steps.

I was able to reproduce it locally on my PC by downloading the defconfig used by the autobuilder:

cd buildroot
curl http://autobuild.buildroot.org/results/9ae/9aee8dafea614db77209818b913a571534466506/defconfig -o configs/error_defconfig
make error_defconfig
make clean
make libdeflate

Annoyingly, it's yet another gcc bug. It will be fixed in gcc 13.

#281 will work around it.

Note that this has actually been an issue since libdeflate v1.12, not commit 84c76f6 as you said. In the future, please don't blame issues on a specific commit before you've confirmed it.

Thanks a lot for fixing this issue and sorry for mistakenly blaming a wrong commit. As you said, this build failure was already raised in version 1.12 with vmull_p64 function:
http://autobuild.buildroot.org/results/951/951d5a1a2959a0cc65ca7e52967ec07bc1cc00f1/build-end.log