Build error when compiling to x86_32 with Clang -m32: undefined symbol: __atomic_store_8
- PipeWire version: 0.3.40 (no change on master)
- Distribution and distribution version: Gentoo Linux 2.8
- Desktop Environment: KDE Plasma 5.23.3
- Kernel version: 5.15.5
Description of Problem:
When compiling a multilib build for x86_64 using clang -m32
for the x86_32 build, the build fails linking with:
ld.lld: error: undefined symbol: __atomic_store_8
>>> referenced by pipewire-jack.c:5427 (../pipewire-0.3.40/pipewire-jack/src/pipewire-jack.c:5427)
>>> pipewire-jack/src/libjack.so.0.340.0.p/pipewire-jack.c.o:(jack_set_sync_timeout)
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
This is despite meson believing that linking with -latomic
is not necessary (as shown in meson-log.txt):
Checking if "8-byte __atomic_fetch_add without libatomic" : links: YES
Perhaps this is because Clang is generating 4-byte alignments with -m32?
../pipewire-9999/pipewire-jack/src/pipewire-jack.c:5540:2: warning: misaligned atomic operation may incur significant performance penalty; the expected alignment (8 bytes) exceeds the actual alignment (4 bytes) [-Watomic-alignment]
ATOMIC_STORE(a->sync_timeout, timeout);
^
../pipewire-9999/src/pipewire/private.h:625:28: note: expanded from macro 'ATOMIC_STORE'
#define ATOMIC_STORE(s,v) __atomic_store_n(&(s), (v), __ATOMIC_SEQ_CST)
I've attached meson-log.txt as well as the build log.
How Reproducible:
Always.