GNU bug report logs - #13550
problem with linking libpthread

Previous Next

Package: libtool;

Reported by: Petr Hracek <phracek <at> redhat.com>

Date: Fri, 25 Jan 2013 16:59:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Pavel Raiskup <praiskup <at> redhat.com>
To: libtool-patches <at> gnu.org
Cc: 13550 <at> debbugs.gnu.org, bugtrack <at> roumenpetrov.info, phracek <at> redhat.com
Subject: bug#13550: [PATCH] libtool: handle the -pthread{,s} options for g++
Date: Thu, 28 Nov 2013 15:18:05 +0100
As we are forced to pass -nostdlib to g++ for linking, this option
expectedly disables the effectiveness of passed -pthread flag - so
add the -lpthread explicitly to $deplibs to link correctly.

References:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
https://bugzilla.redhat.com/show_bug.cgi?id=661333
http://lists.gnu.org/archive/html/bug-libtool/2013-01/msg00018.htm

* build-aux/ltmain.in (func_mode_link): Explicitly add -lpthread
flag into $deplibs when -pthread is passed (for g++ only).
---
 build-aux/ltmain.in | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index fba05c1..f202b80 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -5113,6 +5113,16 @@ func_mode_link ()
 	    *" $arg "*) ;;
 	    * ) func_append new_inherited_linker_flags " $arg" ;;
 	esac
+
+	# As we are forced to pass -nostdlib to g++ during linking, the option
+	# -pthread{,s} is not in effect;  add the -lpthread to $deplist
+	# explicitly to link correctly.
+	if test "$tagname" = CXX -a x"$with_gcc" = xyes; then
+	  case "$arg" in
+	    -pthread*) func_append deplibs " -lpthread" ;;
+	  esac
+	fi
+
 	continue
 	;;
 
-- 
1.8.4.2





This bug report was last modified 6 years and 72 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.