mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-03 01:17:45 +03:00
meson: add libatomic dependency
Building with GCC 12.2 and binutils 2.39 fails on riscv64 Ubuntu Kinetic with: FAILED: systemd-oomd /usr/bin/ld: systemd-oomd.p/src_oom_oomd-util.c.o: in function `oomd_cgroup_context_acquire': build/../src/oom/oomd-util.c:415: undefined reference to `__atomic_exchange_1' We have to link with -latomic. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> (cherry picked from commit132c73b57a
) (cherry picked from commit738eca5e05
)
This commit is contained in:
parent
01ea6ba5f1
commit
87d6e6a14f
12
meson.build
12
meson.build
@ -981,6 +981,16 @@ endif
|
||||
|
||||
#####################################################################
|
||||
|
||||
libatomic = []
|
||||
if not cc.links('''#include <stdint.h>
|
||||
int main() {
|
||||
char i;
|
||||
__atomic_exchange_1(&i, 1, 0);
|
||||
return 1;
|
||||
}''',
|
||||
name : 'Atomic builtin requires -latomic')
|
||||
libatomic = cc.find_library('atomic')
|
||||
endif
|
||||
threads = dependency('threads')
|
||||
librt = cc.find_library('rt')
|
||||
libm = cc.find_library('m')
|
||||
@ -2968,7 +2978,7 @@ if conf.get('ENABLE_OOMD') == 1
|
||||
systemd_oomd_sources,
|
||||
include_directories : includes,
|
||||
link_with : [libshared],
|
||||
dependencies : [],
|
||||
dependencies : [libatomic],
|
||||
install_rpath : rootlibexecdir,
|
||||
install : true,
|
||||
install_dir : rootlibexecdir)
|
||||
|
@ -280,13 +280,13 @@ tests += [
|
||||
[['src/network/test-networkd-address.c'],
|
||||
[libnetworkd_core,
|
||||
libsystemd_network],
|
||||
[],
|
||||
[libatomic],
|
||||
network_includes],
|
||||
|
||||
[['src/network/test-networkd-conf.c'],
|
||||
[libnetworkd_core,
|
||||
libsystemd_network],
|
||||
[],
|
||||
[libatomic],
|
||||
network_includes],
|
||||
|
||||
[['src/network/test-networkd-util.c'],
|
||||
|
@ -28,5 +28,7 @@ endif
|
||||
tests += [
|
||||
[['src/oom/test-oomd-util.c',
|
||||
'src/oom/oomd-util.c',
|
||||
'src/oom/oomd-util.h']],
|
||||
'src/oom/oomd-util.h'],
|
||||
[],
|
||||
[libatomic]],
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user