[Buildroot] [git commit] package/glibmm: link with -latomic if needed

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Dec 29 17:31:45 UTC 2021


commit: https://git.buildroot.net/buildroot/commit/?id=a60b29937bb753846c21d966eca6737d9a5477ad
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Link with -latomic if needed to avoid the following build failure since
bump to version 2.68.2 in commit
dddb65efbdf2c7952f22a1e51009f17f1676db4a:

/home/peko/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/9.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: glib/glibmm/libglibmm-2.68.so.1.3.0.p/main.cc.o: in function `Glib::Source::reference() const':
main.cc:(.text+0xd40): undefined reference to `__atomic_fetch_add_4'

Fixes:
 - http://autobuild.buildroot.org/results/6a2709956fbb16ac3cbf676acb242c88f83fcdae

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 package/glibmm/glibmm.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/glibmm/glibmm.mk b/package/glibmm/glibmm.mk
index 578267c75e..525da6b618 100644
--- a/package/glibmm/glibmm.mk
+++ b/package/glibmm/glibmm.mk
@@ -15,9 +15,15 @@ GLIBMM_DEPENDENCIES = libglib2 libsigc host-pkgconf
 GLIBMM_CONF_OPTS = -Dbuild-examples=false
 
 GLIBMM_CXXFLAGS = $(TARGET_CXXFLAGS)
+GLIBMM_LDFLAGS = $(TARGET_LDFLAGS)
 
 ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
 GLIBMM_CXXFLAGS += -O0
 endif
 
+# Uses __atomic_fetch_add_4
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+GLIBMM_LDFLAGS += -latomic
+endif
+
 $(eval $(meson-package))



More information about the buildroot mailing list