[Buildroot] [PATCH] package/ctorrent: fix static builds with threads

Olaf Rempel razzor at kopf-tisch.de
Sun Oct 16 11:14:07 UTC 2016


Fix static linking with enabled threads for some toolchains

./arm-buildroot-uclinux-uclibcgnueabi/lib/libstdc++.a(guard.o): In function `(anonymous namespace)::get_static_cond()':
guard.cc:(.text._ZN12_GLOBAL__N_115get_static_condEv+0x6): undefined reference to `pthread_once'

Fixes: http://autobuild.buildroot.net/results/138/138569071d0514a0301aa5568bc86706e692d5e9/

Signed-off-by: Olaf Rempel <razzor at kopf-tisch.de>
---
 package/ctorrent/ctorrent.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/ctorrent/ctorrent.mk b/package/ctorrent/ctorrent.mk
index 55fc95e..a3564c5 100644
--- a/package/ctorrent/ctorrent.mk
+++ b/package/ctorrent/ctorrent.mk
@@ -16,4 +16,8 @@ else
 CTORRENT_CONF_OPTS += --with-ssl=no
 endif
 
+ifeq ($(BR2_STATIC_LIBS)$(BR2_TOOLCHAIN_HAS_THREADS),yy)
+CTORRENT_CONF_OPTS += LIBS=-pthread
+endif
+
 $(eval $(autotools-package))
-- 
2.7.4



More information about the buildroot mailing list