GNU bug report logs - #13550
problem with linking libpthread

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: libtool; Reported by: Petr Hracek <phracek@HIDDEN>; dated Fri, 25 Jan 2013 16:59:01 UTC; Maintainer for libtool is bug-libtool@HIDDEN.

Message received at 13550 <at> debbugs.gnu.org:


Received: (at 13550) by debbugs.gnu.org; 28 Nov 2013 14:18:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 28 09:18:13 2013
Received: from localhost ([127.0.0.1]:48485 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Vm2Q1-0001KR-AC
	for submit <at> debbugs.gnu.org; Thu, 28 Nov 2013 09:18:13 -0500
Received: from mx1.redhat.com ([209.132.183.28]:65419)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <praiskup@HIDDEN>) id 1Vm2Py-0001KI-LF
 for 13550 <at> debbugs.gnu.org; Thu, 28 Nov 2013 09:18:12 -0500
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
 (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
 by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rASEI8fZ003235
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Thu, 28 Nov 2013 09:18:09 -0500
Received: from praiskup.usersys.redhat.com (unused-4-200.brq.redhat.com
 [10.34.4.200])
 by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id
 rASEI5Er012248; Thu, 28 Nov 2013 09:18:07 -0500
Received: by praiskup.usersys.redhat.com (Postfix, from userid 1000)
 id 789053082D8E; Thu, 28 Nov 2013 15:18:05 +0100 (CET)
From: Pavel Raiskup <praiskup@HIDDEN>
To: libtool-patches@HIDDEN
Subject: [PATCH] libtool: handle the -pthread{,s} options for g++
Date: Thu, 28 Nov 2013 15:18:05 +0100
Message-Id: <1385648285-31765-1-git-send-email-praiskup@HIDDEN>
In-Reply-To: <5102FCDA.204@HIDDEN>
References: <5102FCDA.204@HIDDEN>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 13550
Cc: 13550 <at> debbugs.gnu.org, bugtrack@HIDDEN, phracek@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

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





Information forwarded to bug-libtool@HIDDEN:
bug#13550; Package libtool. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Jan 2013 08:42:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jan 28 03:42:25 2013
Received: from localhost ([127.0.0.1]:52011 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TzkIL-0007yR-Ab
	for submit <at> debbugs.gnu.org; Mon, 28 Jan 2013 03:42:25 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57307)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <phracek@HIDDEN>) id 1TzkIF-0007yH-Pu
	for submit <at> debbugs.gnu.org; Mon, 28 Jan 2013 03:42:23 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1TzkHl-0006Xb-8y
	for submit <at> debbugs.gnu.org; Mon, 28 Jan 2013 03:41:55 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
	RP_MATCHES_RCVD autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:46224)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1TzkAp-0004Xn-VY
	for submit <at> debbugs.gnu.org; Mon, 28 Jan 2013 03:34:39 -0500
Received: from eggs.gnu.org ([208.118.235.92]:38647)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1Tzk9R-0005ty-Gw
	for bug-libtool@HIDDEN; Mon, 28 Jan 2013 03:34:39 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1Tzk9I-0004Bt-JY
	for bug-libtool@HIDDEN; Mon, 28 Jan 2013 03:33:12 -0500
Received: from mx1.redhat.com ([209.132.183.28]:13979)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1Tzk9I-00048s-Cx
	for bug-libtool@HIDDEN; Mon, 28 Jan 2013 03:33:04 -0500
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0S8X1ER024883
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <bug-libtool@HIDDEN>; Mon, 28 Jan 2013 03:33:01 -0500
Received: from unused-4-190.brq.redhat.com (unused-4-190.brq.redhat.com
	[10.34.4.190])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id r0S8X0Vm019694
	for <bug-libtool@HIDDEN>; Mon, 28 Jan 2013 03:33:01 -0500
Message-ID: <510637BC.4080309@HIDDEN>
Date: Mon, 28 Jan 2013 09:33:00 +0100
From: Petr Hracek <phracek@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:17.0) Gecko/20130110 Thunderbird/17.0.2
MIME-Version: 1.0
To: bug-libtool@HIDDEN
Subject: Re: bug#13550: problem with linking libpthread
References: <5102B98F.3030302@HIDDEN> <5102FCDA.204@HIDDEN>
In-Reply-To: <5102FCDA.204@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

Hello,

libtool --config | grep _path returns
sys_lib_search_path_spec="/usr/lib/gcc/i686-redhat-linux/4.7.2 /usr/lib 
/lib "
sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib "
compiler_lib_search_path=""

after correcting -rpath
to libtool --mode=link -rpath /usr/lib -lpthread testcase.lo -o 
libtestcase.la
all works fine.
$~> libtool --mode=link g++ -rpath /usr/lib -lpthread testcase.lo -o 
libtestcase.la
libtool: link: rm -fr  .libs/libtestcase.a .libs/libtestcase.la 
.libs/libtestcase.lai .libs/libtestcase.so .libs/libtestcase.so.0 
.libs/libtestcase.so.0.0.0
libtool: link: g++  -fPIC -DPIC -shared -nostdlib 
/usr/lib/gcc/i686-redhat-linux/4.7.2/../../../crti.o 
/usr/lib/gcc/i686-redhat-linux/4.7.2/crtbeginS.o  .libs/testcase.o 
-lpthread -L/usr/lib/gcc/i686-redhat-linux/4.7.2 
-L/usr/lib/gcc/i686-redhat-linux/4.7.2/../../.. -lstdc++ -lm -lc -lgcc_s 
/usr/lib/gcc/i686-redhat-linux/4.7.2/crtendS.o 
/usr/lib/gcc/i686-redhat-linux/4.7.2/../../../crtn.o    -Wl,-soname 
-Wl,libtestcase.so.0 -o .libs/libtestcase.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libtestcase.so.0" && ln -s 
"libtestcase.so.0.0.0" "libtestcase.so.0")
libtool: link: (cd ".libs" && rm -f "libtestcase.so" && ln -s 
"libtestcase.so.0.0.0" "libtestcase.so")
libtool: link: ar cru .libs/libtestcase.a  testcase.o
libtool: link: ranlib .libs/libtestcase.a
libtool: link: ( cd ".libs" && rm -f "libtestcase.la" && ln -s 
"../libtestcase.la" "libtestcase.la" )
$~> ldd -r .libs/libtestcase.so
     linux-gate.so.1 =>  (0xb7730000)
     libpthread.so.0 => /lib/libpthread.so.0 (0xb76f7000)
     libstdc++.so.6 => /lib/libstdc++.so.6 (0xb760b000)
     libm.so.6 => /lib/libm.so.6 (0xb75e0000)
     libc.so.6 => /lib/libc.so.6 (0xb742e000)
     libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7410000)
     /lib/ld-linux.so.2 (0x4abcd000)
$~>

Thank you

best regards
Petr


On 01/25/2013 10:44 PM, Roumen Petrov wrote:
> Petr Hracek wrote:
>> Hi Folks,
>>
>> I have received bug which seems to be relevant to libtool
>> https://bugzilla.redhat.com/show_bug.cgi?id=661333
>> []
>>
>> How can it be solved? 
> Dunno.
>
>> It seems to be a bug in libtool, right?
> No. All is fine in my environment where most of packages are without 
> vendor patches and linux distribution is different.
>
>> Can it be a problem with ordering of lib flags in libtool?
> May be you cannot use -rpath /lib in you build environment (1% 
> probability).
>
> Check libtool configuration for search path
> $ libtool --config | grep _path
>
> Note if you change compiler you must rebuild libtool.
> Some projects force root library directory to be before user path in 
> 'library search path' and usual result is link failure.
>
> Roumen
>
>
>
>
> _______________________________________________
> Bug-libtool mailing list
> Bug-libtool@HIDDEN
> https://lists.gnu.org/mailman/listinfo/bug-libtool





Information forwarded to bug-libtool@HIDDEN:
bug#13550; Package libtool. Full text available.

Message received at 13550 <at> debbugs.gnu.org:


Received: (at 13550) by debbugs.gnu.org; 25 Jan 2013 21:45:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 25 16:45:16 2013
Received: from localhost ([127.0.0.1]:49636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Tyr5H-0003i1-Bf
	for submit <at> debbugs.gnu.org; Fri, 25 Jan 2013 16:45:16 -0500
Received: from rila.superhosting.bg ([91.196.124.212]:37213)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <bugtrack@HIDDEN>) id 1Tyr5C-0003hq-SR
	for 13550 <at> debbugs.gnu.org; Fri, 25 Jan 2013 16:45:12 -0500
Received: from [78.128.48.21] (port=52291 helo=[192.168.0.10])
	by rila.superhosting.bg with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
	(Exim 4.80) (envelope-from <bugtrack@HIDDEN>)
	id 1Tyr50-000nG3-V2
	for 13550 <at> debbugs.gnu.org; Fri, 25 Jan 2013 23:44:59 +0200
Message-ID: <5102FCDA.204@HIDDEN>
Date: Fri, 25 Jan 2013 23:44:58 +0200
From: Roumen Petrov <bugtrack@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15.1
MIME-Version: 1.0
To: 13550 <at> debbugs.gnu.org
Subject: Re: bug#13550: problem with linking libpthread
References: <5102B98F.3030302@HIDDEN>
In-Reply-To: <5102B98F.3030302@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-AntiAbuse: This header was added to track abuse,
	please include it with any abuse report
X-AntiAbuse: Primary Hostname - rila.superhosting.bg
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - roumenpetrov.info
X-Get-Message-Sender-Via: rila.superhosting.bg: authenticated_id:
	master78@HIDDEN
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Spam-Score: 0.8 (/)
X-Debbugs-Envelope-To: 13550
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: 0.8 (/)

Petr Hracek wrote:
> Hi Folks,
>
> I have received bug which seems to be relevant to libtool
> https://bugzilla.redhat.com/show_bug.cgi?id=661333
> []
>
> How can it be solved? 
Dunno.

> It seems to be a bug in libtool, right?
No. All is fine in my environment where most of packages are without 
vendor patches and linux distribution is different.

> Can it be a problem with ordering of lib flags in libtool?
May be you cannot use -rpath /lib in you build environment (1% 
probability).

Check libtool configuration for search path
$ libtool --config | grep _path

Note if you change compiler you must rebuild libtool.
Some projects force root library directory to be before user path in 
'library search path' and usual result is link failure.

Roumen





Information forwarded to bug-libtool@HIDDEN:
bug#13550; Package libtool. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Jan 2013 16:58:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 25 11:58:37 2013
Received: from localhost ([127.0.0.1]:49453 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Tymbs-0004X4-BD
	for submit <at> debbugs.gnu.org; Fri, 25 Jan 2013 11:58:37 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57582)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <phracek@HIDDEN>) id 1Tymbn-0004Wv-Cv
	for submit <at> debbugs.gnu.org; Fri, 25 Jan 2013 11:58:34 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1TymbV-0006Tc-7T
	for submit <at> debbugs.gnu.org; Fri, 25 Jan 2013 11:58:22 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
	RP_MATCHES_RCVD autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:53010)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1TymbV-0006TY-5I
	for submit <at> debbugs.gnu.org; Fri, 25 Jan 2013 11:58:13 -0500
Received: from eggs.gnu.org ([208.118.235.92]:40675)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1TymbM-0003Ty-NN
	for bug-libtool@HIDDEN; Fri, 25 Jan 2013 11:58:12 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1TymbD-0006PF-3n
	for bug-libtool@HIDDEN; Fri, 25 Jan 2013 11:58:04 -0500
Received: from mx1.redhat.com ([209.132.183.28]:4156)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <phracek@HIDDEN>) id 1TymbC-0006Os-SV
	for bug-libtool@HIDDEN; Fri, 25 Jan 2013 11:57:55 -0500
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0PGvqnH005265
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <bug-libtool@HIDDEN>; Fri, 25 Jan 2013 11:57:52 -0500
Received: from unused-4-190.brq.redhat.com (unused-4-190.brq.redhat.com
	[10.34.4.190])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id r0PGvpN9012979
	for <bug-libtool@HIDDEN>; Fri, 25 Jan 2013 11:57:52 -0500
Message-ID: <5102B98F.3030302@HIDDEN>
Date: Fri, 25 Jan 2013 17:57:51 +0100
From: Petr Hracek <phracek@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:17.0) Gecko/20130110 Thunderbird/17.0.2
MIME-Version: 1.0
To: bug-libtool@HIDDEN
Subject: problem with linking libpthread
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 208.118.235.17
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.9 (------)

Hi Folks,

I have received bug which seems to be relevant to libtool
https://bugzilla.redhat.com/show_bug.cgi?id=661333

it refers to:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460

$ ~> cat testcase.cpp
#include <pthread.h>

void f(){ pthread_create(0,0,0,0); }
$ ~> libtool --mode=compile g++ -pthread -c testcase.cpp
libtool: compile:  g++ -pthread -c testcase.cpp  -fPIC -DPIC -o 
.libs/testcase.o
libtool: compile:  g++ -pthread -c testcase.cpp -o testcase.o >/dev/null 
2>&1
$ ~> libtool --mode=link g++ -pthread -rpath /lib/ testcase.lo -o 
libtestcase.la
libtool: link: g++  -fPIC -DPIC -shared -nostdlib 
/usr/lib/gcc/i686-redhat-linux/4.7.2/../../../crti.o 
/usr/lib/gcc/i686-redhat-linux/4.7.2/crtbeginS.o  .libs/testcase.o 
-L/usr/lib/gcc/i686-redhat-linux/4.7.2 
-L/usr/lib/gcc/i686-redhat-linux/4.7.2/../../.. -lstdc++ -lm -lc -lgcc_s 
/usr/lib/gcc/i686-redhat-linux/4.7.2/crtendS.o 
/usr/lib/gcc/i686-redhat-linux/4.7.2/../../../crtn.o  -pthread -pthread 
-Wl,-soname -Wl,libtestcase.so.0 -o .libs/libtestcase.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libtestcase.so.0" && ln -s 
"libtestcase.so.0.0.0" "libtestcase.so.0")
libtool: link: (cd ".libs" && rm -f "libtestcase.so" && ln -s 
"libtestcase.so.0.0.0" "libtestcase.so")
libtool: link: ar cru .libs/libtestcase.a  testcase.o
libtool: link: ranlib .libs/libtestcase.a
libtool: link: ( cd ".libs" && rm -f "libtestcase.la" && ln -s 
"../libtestcase.la" "libtestcase.la" )
$ ~> ldd -r .libs/libtestcase.so
     linux-gate.so.1 =>  (0xb7719000)
     libstdc++.so.6 => /lib/libstdc++.so.6 (0xb760e000)
     libm.so.6 => /lib/libm.so.6 (0xb75e3000)
     libc.so.6 => /lib/libc.so.6 (0xb7431000)
     libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7414000)
     /lib/ld-linux.so.2 (0x4abcd000)
undefined symbol: pthread_create    (.libs/libtestcase.so)
$ ~>

library libpthread is not linking with my object file

versions of libtool and g++ are:
$ ~> libtool --version
libtool (GNU libtool) 2.4.2
Written by Gordon Matzigkeit <gord@HIDDEN>, 1996

Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ ~> g++ --version
g++ (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ~>

How can it be solved? It seems to be a bug in libtool, right?
Can it be a problem with ordering of lib flags in libtool?

-- 
S pozdravem / Best regards

Petr Hracek

Red Hat Czech s.r.o.
BaseOS Core Services Brno

Email:phracek@HIDDEN
Web:www.cz.redhat.com





Acknowledgement sent to Petr Hracek <phracek@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-libtool@HIDDEN. Full text available.
Report forwarded to bug-libtool@HIDDEN:
bug#13550; Package libtool. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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