[Buildroot] [PATCH 1/1] package/ogre: link with libatomic when needed

Fabrice Fontaine fontaine.fabrice at gmail.com
Mon Feb 10 17:41:27 UTC 2020


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/test/autobuild/run/instance-1/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/8.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: ../../lib/libOgreMain.so.1.12.0: undefined reference to `__atomic_fetch_add_8'

This is often for example the case on sparc v8 32 bits.

Fixes:
 - http://autobuild.buildroot.org/results/3a09e2d1d26b19243244eb7f9235c85488a788d2

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
---
 package/ogre/ogre.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/ogre/ogre.mk b/package/ogre/ogre.mk
index f7711e41f1..253e022a73 100644
--- a/package/ogre/ogre.mk
+++ b/package/ogre/ogre.mk
@@ -39,4 +39,9 @@ else
 OGRE_CONF_OPTS += -DOGRE_BUILD_COMPONENT_PYTHON=OFF
 endif
 
+# Uses __atomic_fetch_add_8
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+OGRE_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic"
+endif
+
 $(eval $(cmake-package))
-- 
2.24.1



More information about the buildroot mailing list