Skip to contentSkip to conversation

package/ctorrent: fix static builds with threads

PATCH New Olaf Rempel 2 participants 2 messages Oct 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/ctorrent: fix static builds with threads

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'

---
 package/ctorrent/ctorrent.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/ctorrent/ctorrent.mk +4 -0
index 55fc95e..a3564c5 100644
@@ -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))
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 package/ctorrent: fix static builds with threads

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Olaf" == Olaf Rempel <[email protected]> writes:

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'

Thanks, but this is really a toolchain error with uClibc as ctorrent doesn't use pthread. With the recently released uClibc-ng 1.0.18 this is now fixed, so this is now fixed and I've marked this patch as rejected.

Signature · 1 line
Bye, Peter Korsgaard