mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-15 08:56:38 -05:00
fix linking with -latomic
Linking with -latomic has been added to pipewire-jack since
b8c58c74d8
However, this is not the right place to add this dependency, atomic_dep
should be added to pipewire_dep to avoid the following build failure:
/home/giuliobenetti/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/9.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/pipewire/libpipewire-0.3.so.0.326.0.p/filter.c.o: in function `impl_node_process':
filter.c:(.text+0xf28): undefined reference to `__atomic_fetch_add_4'
Indeed, atomic operation such as __atomic_fetch_add is used in libcamera
as well as in ./spa/plugins/libcamera/libcamera_wrapper.cpp,
./spa/include/spa/utils/ringbuffer.h and ./spa/include/spa/graph/graph.h
Fixes:
- http://autobuild.buildroot.org/results/b5305e8e7dd1a5e8bfaba72b06251056ba7d1af1
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
parent
22d874cdeb
commit
fa64d93e64
3 changed files with 9 additions and 10 deletions
11
meson.build
11
meson.build
|
|
@ -157,7 +157,7 @@ test_8_byte_atomic = '''
|
|||
int main(void)
|
||||
{
|
||||
int64_t eight;
|
||||
__atomic_store_n(&eight, 123, __ATOMIC_SEQ_CST);
|
||||
__atomic_fetch_add(&eight, 123, __ATOMIC_SEQ_CST);
|
||||
return 0;
|
||||
}
|
||||
'''
|
||||
|
|
@ -166,16 +166,15 @@ int main(void)
|
|||
# operations on any reasonable architecture.
|
||||
if cc.links(
|
||||
test_8_byte_atomic,
|
||||
name : '8-byte __atomic_store_n without libatomic')
|
||||
name : '8-byte __atomic_fetch_add without libatomic')
|
||||
atomic_dep = dependency('', required: false)
|
||||
elif cc.links(
|
||||
test_8_byte_atomic,
|
||||
dependencies : libatomic,
|
||||
name : '8-byte __atomic_store_n with libatomic')
|
||||
name : '8-byte __atomic_fetch_add with libatomic')
|
||||
atomic_dep = libatomic
|
||||
elif get_option('pipewire-jack').enabled()
|
||||
# Currently only required for the JACK backend
|
||||
error('8-byte atomic operations are required for pipewire-jack')
|
||||
else
|
||||
error('8-byte atomic operations are required')
|
||||
endif
|
||||
|
||||
cdata = configuration_data()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue