On Sun, 13 Nov 2022 09:10:37 +0100 Matthias Klose <d...@debian.org> wrote:
Package: src:python-crc32c
Version: 2.3-1
Severity: serious
Tags: sid bookworm ftbfs
User: debian-pyt...@lists.debian.org
Usertag: python3.11

[...]
In file included from crc32c_arm64.c:22:
/usr/lib/gcc/aarch64-linux-gnu/12/include/arm_acle.h: In function ‘_crc32c_hw_arm64’: /usr/lib/gcc/aarch64-linux-gnu/12/include/arm_acle.h:197:1: error: inlining failed in call to ‘always_inline’ ‘__crc32cd’: target specific option mismatch
   197 | __crc32cd (uint32_t __a, uint64_t __b)
       | ^~~~~~~~~
crc32c_arm64.c:91:12: note: called from here
    91 |     crc ^= __crc32cd(0, t0);
       |            ^~~~~~~~~~~~~~~~



The upstream build system adds -march=armv8-a+crc+crypto to the compiler flags
if it's built on arm.
It detects this by checking if sysconfig.get_platform() contains one of
'aarch64_be', 'aarch64', 'armv8b', 'armv8l', 'universal2'.

However pybuild passes $DEB_HOST_ARCH (the Debian architecture name) in 
_PYTHON_HOST_PLATFORM:
https://salsa.debian.org/python-team/tools/dh-python/-/blob/42fc6aba/pybuild#L84

Because of this sysconfig.get_platform() returns linux-arm64 instead of the 
expected
linux-aarch64 on arm64 and -march isn't passed to the compiler.

This seems like questionable behavior of pybuild. No software would expect to 
find
the Debian architecture name in get_platform() instead of the kernel 
architecture name.
There is already special casing for amd64 -> x86_64 but it really needs to do 
this
for all architectures where both don't match.

Felix

Reply via email to