]> Git Repo - buildroot-mgba.git/commitdiff
package/sysrepo: link with libatomic when needed
authorFabrice Fontaine <[email protected]>
Thu, 31 Oct 2019 13:15:05 +0000 (14:15 +0100)
committerThomas Petazzoni <[email protected]>
Thu, 31 Oct 2019 21:19:34 +0000 (22:19 +0100)
On some architectures, atomic binutils are provided by the libatomic
library from gcc. Linking with libatomic is therefore necessary,
otherwise the build fails with:

/home/buildroot/autobuild/instance-2/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: libsysrepo.so.0.7.8: undefined reference to `__atomic_fetch_add_4'

This is often for example the case on sparcv8 32 bit.

Fixes:
 - http://autobuild.buildroot.org/results/d807f3dc922a61e099a66de3bc340c018a86e150

Signed-off-by: Fabrice Fontaine <[email protected]>
Signed-off-by: Thomas Petazzoni <[email protected]>
package/sysrepo/sysrepo.mk

index 31317d623653beb52631d7314314b422bcbf20ca..72c380768da84b7cce239baaf169a07ee39b975f 100644 (file)
@@ -29,6 +29,10 @@ SYSREPO_CONF_OPTS = \
 # build .. https://github.com/sysrepo/sysrepo/issues/947
 SYSREPO_CONF_OPTS += -DUSE_SR_MEM_MGMT=OFF
 
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+SYSREPO_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
+endif
+
 define SYSREPO_INSTALL_INIT_SYSV
        $(INSTALL) -m 755 -D package/sysrepo/S50sysrepod \
                $(TARGET_DIR)/etc/init.d/S50sysrepod
This page took 0.038814 seconds and 4 git commands to generate.