GNU bug report logs - #12880
Incorrect handling -Wl,--no-as-needed with libtool 2.4.2

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: Quanah Gibson-Mount <quanah@HIDDEN>; dated Tue, 13 Nov 2012 21:01:01 UTC; Maintainer for libtool is bug-libtool@HIDDEN.

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


Received: (at submit) by debbugs.gnu.org; 13 Nov 2012 21:00:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 13 16:00:53 2012
Received: from localhost ([127.0.0.1]:39429 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1TYNbJ-00024D-3P
	for submit <at> debbugs.gnu.org; Tue, 13 Nov 2012 16:00:53 -0500
Received: from eggs.gnu.org ([208.118.235.92]:55123)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <quanah@HIDDEN>) id 1TYNOv-0001lM-JH
	for submit <at> debbugs.gnu.org; Tue, 13 Nov 2012 15:48:06 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <quanah@HIDDEN>) id 1TYNON-0005eK-5k
	for submit <at> debbugs.gnu.org; Tue, 13 Nov 2012 15:47:34 -0500
Received: from lists.gnu.org ([208.118.235.17]:34928)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <quanah@HIDDEN>) id 1TYNON-0005eG-2i
	for submit <at> debbugs.gnu.org; Tue, 13 Nov 2012 15:47:31 -0500
Received: from eggs.gnu.org ([208.118.235.92]:40808)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <quanah@HIDDEN>) id 1TYNOK-0000Rr-0D
	for bug-libtool@HIDDEN; Tue, 13 Nov 2012 15:47:31 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <quanah@HIDDEN>) id 1TYNOG-0005dU-UD
	for bug-libtool@HIDDEN; Tue, 13 Nov 2012 15:47:27 -0500
Received: from edge02-zcs.vmware.com ([208.91.2.23]:40177)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <quanah@HIDDEN>) id 1TYNOG-0005dA-N7
	for bug-libtool@HIDDEN; Tue, 13 Nov 2012 15:47:24 -0500
Received: from localhost (localhost [127.0.0.1])
	by edge02-zcs.vmware.com (Postfix) with ESMTP id DD2C023F9
	for <bug-libtool@HIDDEN>; Tue, 13 Nov 2012 12:47:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at edge02-zcs.vmware.com
Received: from edge02-zcs.vmware.com ([127.0.0.1])
	by localhost (edge02-zcs.vmware.com [127.0.0.1]) (amavisd-new,
	port 10026) with ESMTP id Go8QGqg0rkZ9 for <bug-libtool@HIDDEN>;
	Tue, 13 Nov 2012 12:47:06 -0800 (PST)
Received: from [192.168.1.43] (unknown [74.196.25.250])
	by edge02-zcs.vmware.com (Postfix) with ESMTPSA id 7E24821D5
	for <bug-libtool@HIDDEN>; Tue, 13 Nov 2012 12:47:06 -0800 (PST)
Date: Tue, 13 Nov 2012 12:47:10 -0800
From: Quanah Gibson-Mount <quanah@HIDDEN>
To: bug-libtool@HIDDEN
Subject: Incorrect handling -Wl,--no-as-needed with libtool 2.4.2
Message-ID: <E0E9647139CA32806B4D08A5@[192.168.1.43]>
X-Mailer: Mulberry/4.0.8 (Win32)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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: -4.2 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 13 Nov 2012 16:00:51 -0500
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: -4.2 (----)

I've noticed that libtool re-orders -Wl,-no-as-needed incorrectly.

For example:

 /bin/bash ./libtool --tag=CC   --mode=link gcc  -Wall -Wno-format -pipe 
-O3 -DNDEBUG -Wl,--no-as-needed -lm -avoid-version -shrext .so -L. -o 
libmod_convert.la -rpath /usr/local/lib libmod_convert_la-mod_convert.lo 
libconverter.a -ldl


The purpose of this is to force linking of -lm into the resulting object. 
However, when libtool re-orders this linking command and passes it to gcc, 
the result is:

libtool: link: gcc -shared  -fPIC -DPIC 
.libs/libmod_convert_la-mod_convert.o   -lm -L. libconverter.a -ldl  -O3 
-Wl,--no-as-needed   -Wl,-soname -Wl,libmod_convert.so -o 
.libs/libmod_convert.so

As you can see, the -Wl,--no-as-needed flag is moved *after* the call to 
link in libm.

I could not find any way in which to get libtool to correctly pass the 
linking flags to gcc.  A search via google seems to indicate this is a long 
standing known issue with libtool, as there is an extensive log in the 
debian bug reporter about it.

Since there is no bug reporter for libtool that I could find, I have no 
idea if it was ever reported upstream, although I would have thought so by 
now.

build@zre-ubuntu12-64:~/builds/UBUNTU12_64/main/20121113050101_NETWORK/ZimbraConvertd/src/c$ 
./libtool --version
libtool (GNU libtool) 2.4.2


I finally restored to completely disabling gcc as-needed in my gcc spec 
file so that the library would be built properly.

Thanks,
Quanah

--

Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.
--------------------
Zimbra ::  the leader in open source messaging and collaboration




Acknowledgement sent to Quanah Gibson-Mount <quanah@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-libtool@HIDDEN. Full text available.
Report forwarded to bug-libtool@HIDDEN:
bug#12880; 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: Mon, 25 Nov 2019 12:00:02 UTC

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