[Buildroot] [PATCH v2 1/2] xlib_libpthread-stubs: needs -pthread when linking statically

Arnout Vandecappelle (Essensium/Mind) arnout at mind.be
Sat Nov 9 00:21:20 UTC 2013


Fixes e.g. http://autobuild.buildroot.net/results/1eaa694263b74313b0c90c510abcb11d490a3773/

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
---
My gcc manual only documents the -pthread option for some architectures,
but it seems to work for x86, sh and arm as well.

v2: resend
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
---
 package/x11r7/xlib_libpthread-stubs/xlib_libpthread-stubs.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/x11r7/xlib_libpthread-stubs/xlib_libpthread-stubs.mk b/package/x11r7/xlib_libpthread-stubs/xlib_libpthread-stubs.mk
index 5ea02e9..6343691 100644
--- a/package/x11r7/xlib_libpthread-stubs/xlib_libpthread-stubs.mk
+++ b/package/x11r7/xlib_libpthread-stubs/xlib_libpthread-stubs.mk
@@ -12,5 +12,9 @@ XLIB_LIBPTHREAD_STUBS_LICENSE_FILES = COPYING
 
 XLIB_LIBPTHREAD_STUBS_INSTALL_STAGING = YES
 
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+XLIB_LIBPTHREAD_STUBS_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -pthread"
+endif
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
-- 
1.8.4.2



More information about the buildroot mailing list