#1028415 libfixmath: powerpc is in the UBSAN_ARCH list despite being unsupported

#1028415#5
Date:
2023-01-10 19:30:28 UTC
From:
To:
Hello!

I just noticed that debian/rules adds the powerpc architecture to the UBSAN_ARCH
arch list despite powerpc not supporting `__sync_val_compare_and_swap_8 [1]. This
results in libfixmath trying to build the testsuite and consequently FTBFS [2]:

[ 94%] Linking C executable tests_rn08
/usr/bin/cmake -E cmake_link_script CMakeFiles/tests_rn08.dir/link.txt --verbose=1
/usr/bin/cc -Wall -pedantic -Wextra -Werror=return-type -Wl,-z,relro -fsanitize=undefined CMakeFiles/tests_rn08.dir/tests/tests.c.o CMakeFiles/tests_rn08.dir/tests/tests_basic.c.o CMakeFiles/tests_rn08.dir/tests/tests_lerp.c.o CMakeFiles/tests_rn08.dir/tests/tests_macros.c.o CMakeFiles/tests_rn08.dir/tests/tests_sqrt.c.o CMakeFiles/tests_rn08.dir/tests/tests_str.c.o -o tests_rn08  liblibfixmath_rn08.a -lm -latomic
/usr/bin/ld: /usr/lib/gcc/powerpc-linux-gnu/12/libubsan.so: undefined reference to `__sync_val_compare_and_swap_8'
collect2: error: ld returned 1 exit status

Could you please remove "powerpc" from the UBSAN_ARCH list?

Thanks,
Adrian

#1028415#10
Date:
2023-01-10 19:41:38 UTC
From:
To:
Hi,

Am 10.01.23 um 20:30 schrieb John Paul Adrian Glaubitz:

But libubsan.so exists, which was what was intended with this variable...

Removing it there would effectively disabling building and running the
tests...


Regards,


Rene

#1028415#15
Date:
2023-01-10 19:52:20 UTC
From:
To:
Hello!

Yes, ubsan.so exists. But in some cases (i.e. some sanitizer checks) it requires
__sync_val_compare_and_swap_8 which is not available on 32-bit PowerPC.

However, __sync_val_compare_and_swap_8 is deprecated anyway and has been replaced
with __atomic_compare_exchange(), so I assume that the ubsan version in gcc-12 is
outdated.

I think in LLVM, we actually replaced __sync_val_compare_and_swap with __atomic_
compare_exchange() at some point for this particular reasons.

Adrian