GNU bug report logs - #11064
CRITICAL: libtool makes static linking impossible

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: bugdal@HIDDEN; dated Thu, 22 Mar 2012 06:45:02 UTC; Maintainer for libtool is bug-libtool@HIDDEN.

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


Received: (at 11064) by debbugs.gnu.org; 2 Apr 2012 20:55:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 02 16:55:09 2012
Received: from localhost ([127.0.0.1]:36981 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SEoHN-0002VF-7r
	for submit <at> debbugs.gnu.org; Mon, 02 Apr 2012 16:55:09 -0400
Received: from rila.superhosting.bg ([91.196.124.212]:60094)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <bugtrack@HIDDEN>) id 1SEoHI-0002V6-Vk
	for 11064 <at> debbugs.gnu.org; Mon, 02 Apr 2012 16:55:06 -0400
Received: from [78.128.48.21] (helo=[192.168.0.10])
	by rila.superhosting.bg with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69) (envelope-from <bugtrack@HIDDEN>)
	id 1SEoGy-004HYa-PC; Mon, 02 Apr 2012 23:54:44 +0300
Message-ID: <4F7A1212.1010809@HIDDEN>
Date: Mon, 02 Apr 2012 23:54:42 +0300
From: Roumen Petrov <bugtrack@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:11.0) Gecko/20120314 Firefox/11.0 SeaMonkey/2.8
MIME-Version: 1.0
To: Libtool Bugs List <bug-libtool@HIDDEN>
Subject: Re: bug#11064: CRITICAL: libtool makes static linking impossible
References: <20120322044930.GA28934@HIDDEN>
	<4F6B4902.3060000@HIDDEN>
	<20120322160647.GJ31153@HIDDEN>
	<4F6B973C.2020105@HIDDEN>
In-Reply-To: <4F6B973C.2020105@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; 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-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 11064
Cc: Rich Felker <dalias@HIDDEN>, Peter O'Gorman <peter@HIDDEN>,
	11064 <at> debbugs.gnu.org
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: -1.9 (-)

Peter O'Gorman wrote:
> [SNIP]
> Ok, yes, that's annoying. This workaround just worked for me:
>
> ./configure CFLAGS='-static' LDFLAGS='-Xcompiler -static'
> make
The case is not useful. It may work for some projects but is not generic.

I will show by example OpenSSH  build . Note that OpenSSH does not use 
libtool

So lets try to build OpenSSH with :
1) .../configure CFLAGS='-static' LDFLAGS='-static'

Result is:
...
xxxx.c:(.text+0xNNNN): warning: Using '<NAME>' in statically linked 
applications requires at runtime the shared libraries from the glibc 
version used for linking
dso_dlfcn.c:(.text+0x5d4): warning: Using 'dlopen' in statically linked 
applications requires at runtime the shared libraries from the glibc 
version used for linking
...
... error ....cannot found -lgcc_s ....
....
, i.e. build fail


So next step:

2) .../configure CFLAGS='-static' LDFLAGS='-static  -shared-libgcc'
Result executable are build fine but regression tests crash with:
ssh-keygen: ../sysdeps/unix/sysv/linux/getpagesize.c:32: __getpagesize: 
Assertion `_rtld_global_ro._dl_pagesize != 0' failed.

3) .../configure CFLAGS='-static' LDFLAGS='-static  -static-libgcc'
same as 2)


[SNIP]
> But my gcc does not error for the unrecognized option during 
> configure, it's possible that newer gccs will. That binutils runs 
> configure in subdirs during the build makes it even more annoying to 
> work around. If your gcc errors out with the -Xcompiler flag, you'll 
> have to make a wrapper script for the compiler (one that takes a flag 
> that libtool doesn't remove from the link line). Ick.
[SNIP]

May be bug in my version of glibc prevent a ssh executable to run.

I'm not sure that this report is a bug neither feature request .

The current libtool behavior is fine with me.


Roumen





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

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


Received: (at submit) by debbugs.gnu.org; 2 Apr 2012 20:55:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 02 16:55:13 2012
Received: from localhost ([127.0.0.1]:36984 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SEoHQ-0002VT-MU
	for submit <at> debbugs.gnu.org; Mon, 02 Apr 2012 16:55:12 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59089)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <bugtrack@HIDDEN>) id 1SEoHP-0002VN-8f
	for submit <at> debbugs.gnu.org; Mon, 02 Apr 2012 16:55:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bugtrack@HIDDEN>) id 1SEoH6-0007LF-5w
	for submit <at> debbugs.gnu.org; Mon, 02 Apr 2012 16:54:53 -0400
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
	autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:47724)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bugtrack@HIDDEN>) id 1SEoH6-0007Kr-2D
	for submit <at> debbugs.gnu.org; Mon, 02 Apr 2012 16:54:52 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58862)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bugtrack@HIDDEN>) id 1SEoH4-0003ED-5Q
	for bug-libtool@HIDDEN; Mon, 02 Apr 2012 16:54:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bugtrack@HIDDEN>) id 1SEoH2-0007GC-3C
	for bug-libtool@HIDDEN; Mon, 02 Apr 2012 16:54:49 -0400
Received: from rila.superhosting.bg ([91.196.124.212]:50374)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bugtrack@HIDDEN>) id 1SEoH1-0007Eh-OP
	for bug-libtool@HIDDEN; Mon, 02 Apr 2012 16:54:48 -0400
Received: from [78.128.48.21] (helo=[192.168.0.10])
	by rila.superhosting.bg with esmtpsa (TLSv1:AES256-SHA:256)
	(Exim 4.69) (envelope-from <bugtrack@HIDDEN>)
	id 1SEoGy-004HYa-PC; Mon, 02 Apr 2012 23:54:44 +0300
Message-ID: <4F7A1212.1010809@HIDDEN>
Date: Mon, 02 Apr 2012 23:54:42 +0300
From: Roumen Petrov <bugtrack@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:11.0) Gecko/20120314 Firefox/11.0 SeaMonkey/2.8
MIME-Version: 1.0
To: Libtool Bugs List <bug-libtool@HIDDEN>
Subject: Re: bug#11064: CRITICAL: libtool makes static linking impossible
References: <20120322044930.GA28934@HIDDEN>
	<4F6B4902.3060000@HIDDEN>
	<20120322160647.GJ31153@HIDDEN>
	<4F6B973C.2020105@HIDDEN>
In-Reply-To: <4F6B973C.2020105@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; 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 - gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - roumenpetrov.info
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: submit
Cc: Rich Felker <dalias@HIDDEN>, Peter O'Gorman <peter@HIDDEN>,
	11064 <at> debbugs.gnu.org
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 (------)

Peter O'Gorman wrote:
> [SNIP]
> Ok, yes, that's annoying. This workaround just worked for me:
>
> ./configure CFLAGS='-static' LDFLAGS='-Xcompiler -static'
> make
The case is not useful. It may work for some projects but is not generic.

I will show by example OpenSSH  build . Note that OpenSSH does not use 
libtool

So lets try to build OpenSSH with :
1) .../configure CFLAGS='-static' LDFLAGS='-static'

Result is:
...
xxxx.c:(.text+0xNNNN): warning: Using '<NAME>' in statically linked 
applications requires at runtime the shared libraries from the glibc 
version used for linking
dso_dlfcn.c:(.text+0x5d4): warning: Using 'dlopen' in statically linked 
applications requires at runtime the shared libraries from the glibc 
version used for linking
...
... error ....cannot found -lgcc_s ....
....
, i.e. build fail


So next step:

2) .../configure CFLAGS='-static' LDFLAGS='-static  -shared-libgcc'
Result executable are build fine but regression tests crash with:
ssh-keygen: ../sysdeps/unix/sysv/linux/getpagesize.c:32: __getpagesize: 
Assertion `_rtld_global_ro._dl_pagesize != 0' failed.

3) .../configure CFLAGS='-static' LDFLAGS='-static  -static-libgcc'
same as 2)


[SNIP]
> But my gcc does not error for the unrecognized option during 
> configure, it's possible that newer gccs will. That binutils runs 
> configure in subdirs during the build makes it even more annoying to 
> work around. If your gcc errors out with the -Xcompiler flag, you'll 
> have to make a wrapper script for the compiler (one that takes a flag 
> that libtool doesn't remove from the link line). Ick.
[SNIP]

May be bug in my version of glibc prevent a ssh executable to run.

I'm not sure that this report is a bug neither feature request .

The current libtool behavior is fine with me.


Roumen





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

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


Received: (at 11064) by debbugs.gnu.org; 24 Mar 2012 21:31:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 24 17:31:04 2012
Received: from localhost ([127.0.0.1]:37260 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SBYYC-00029W-0P
	for submit <at> debbugs.gnu.org; Sat, 24 Mar 2012 17:31:04 -0400
Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:58646
	helo=brightrain.aerifal.cx) by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <dalias@HIDDEN>) id 1SBYXd-00028c-Nz
	for 11064 <at> debbugs.gnu.org; Sat, 24 Mar 2012 17:31:02 -0400
Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2)
	id 1SBY4W-0000wA-00; Sat, 24 Mar 2012 21:00:24 +0000
Date: Sat, 24 Mar 2012 17:00:24 -0400
To: Peter O'Gorman <peter@HIDDEN>
Subject: Re: bug#11064: CRITICAL: libtool makes static linking impossible
Message-ID: <20120324210024.GK31153@HIDDEN>
References: <20120322044930.GA28934@HIDDEN>
	<4F6B4902.3060000@HIDDEN>
	<20120322160647.GJ31153@HIDDEN>
	<4F6B973C.2020105@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4F6B973C.2020105@HIDDEN>
User-Agent: Mutt/1.5.21 (2010-09-15)
From: Rich Felker <dalias@HIDDEN>
X-Spam-Score: -0.9 (/)
X-Debbugs-Envelope-To: 11064
Cc: 11064 <at> debbugs.gnu.org
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.9 (/)

On Thu, Mar 22, 2012 at 04:18:52PM -0500, Peter O'Gorman wrote:
> >The fundamental problem is that libtool has commandeered a command
> >line option that's meant for user LDFLAGS (to request a static binary)
> >and redefined it to mean "I only want project-internal libraries to be
> >linked statically, but I still want my binary dynamic-linked to system
> >libraries." And in the process, it's made it completely impossible to
> >build static binaries.
> 
> I agree this is a problem, will go looking for the history of the
> -static libtool flag and see what we can do.

It looks to me like somebody found an obscure legacy proprietary unix
(or perhaps even just a particular broken installation of one) where
real static linking fails, and all they really cared about was
static-linking the in-project libraries, not the system ones, so they
changed -static to accommodate this one broken system and broke static
linking on all sane, working systems in the process.

If this is the case, I believe the correct fix is to restore -static
to its correct meaning and add a separate option for linking only
project-internal libraries static. And of course -all-static should be
left in place too so as not to break anything if somebody is somehow
successfully using it (even though it seems doubtful that it can be
used successfully...).




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

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


Received: (at 11064) by debbugs.gnu.org; 22 Mar 2012 21:49:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 22 17:49:47 2012
Received: from localhost ([127.0.0.1]:33587 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SAptC-0002cb-48
	for submit <at> debbugs.gnu.org; Thu, 22 Mar 2012 17:49:47 -0400
Received: from pogma.xen.prgmr.com ([68.68.97.8]:55885)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <peter@HIDDEN>) id 1SAptA-0002cT-5S
	for 11064 <at> debbugs.gnu.org; Thu, 22 Mar 2012 17:49:45 -0400
Message-ID: <4F6B973C.2020105@HIDDEN>
X-DKIM: Sendmail DKIM Filter v2.8.3 pogma.xen.prgmr.com 74DF9BF60C
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pogma.com; s=pogmail;
	t=1332451133; bh=NWnFYf8+VtvQhHiOu3ieDN9JOd5K0tCyZFbdaeeweOU=;
	h=Date:From:MIME-Version:To:Subject:References:In-Reply-To:
	Content-Type:Content-Transfer-Encoding;
	b=NHuX4Dl2vpDlEVSpH3CZH842OfXGDnmfqlJ7n+rWtakVkm+bBEP+D26I4iqB41A6k
	zFhL6pzOXfoUQNfCGTQV7uuBJ5N8aP8uCpnBn8wWQTj9DWpTzauCjUIfBXxKQrq2s2
	D0Q0v4OwzX5gze4Xdpeobgx3VPCcy5pLMq0wsJdg=
Date: Thu, 22 Mar 2012 16:18:52 -0500
From: Peter O'Gorman <peter@HIDDEN>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.22) Gecko/20110906 Fedora/3.1.14-1.fc14 Thunderbird/3.1.14
MIME-Version: 1.0
To: Rich Felker <dalias@HIDDEN>, 11064 <at> debbugs.gnu.org
Subject: Re: bug#11064: CRITICAL: libtool makes static linking impossible
References: <20120322044930.GA28934@HIDDEN>
	<4F6B4902.3060000@HIDDEN>
	<20120322160647.GJ31153@HIDDEN>
In-Reply-To: <20120322160647.GJ31153@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 11064
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: -1.9 (-)

Hi,

[added back the bug email to track this]

On 03/22/2012 11:06 AM, Rich Felker wrote:
> On Thu, Mar 22, 2012 at 10:45:06AM -0500, Peter O'Gorman wrote:
>>
>> does:
>> ../configure CC='gcc -static' CXX='g++ -static' ...
>>
>> work around this for you?
>>
>> I think the -static, -all-static etc libtool flags were meant for
>> Makefiles, not really for user LDFLAGS.
>
> No, it does not. My situation is trying to compile static-linked GNU
> binutils. I tried putting -static in CC (like you suggested), CFLAGS,
> and LDFLAGS. Each time, it appeared on the libtool command line and
> disappeared on the second command line where libtool invoked gcc.

Ok, yes, that's annoying. This workaround just worked for me:

./configure CFLAGS='-static' LDFLAGS='-Xcompiler -static'
make

But my gcc does not error for the unrecognized option during configure, 
it's possible that newer gccs will. That binutils runs configure in 
subdirs during the build makes it even more annoying to work around. If 
your gcc errors out with the -Xcompiler flag, you'll have to make a 
wrapper script for the compiler (one that takes a flag that libtool 
doesn't remove from the link line). Ick.

>
> I also tried -Wl,-Bstatic and that failed because gcc was unaware of
> the static option and passed -lgcc_s to the linker instead of
> -lgcc_eh.

You could have tried -static-libgcc, but ...

>
> The fundamental problem is that libtool has commandeered a command
> line option that's meant for user LDFLAGS (to request a static binary)
> and redefined it to mean "I only want project-internal libraries to be
> linked statically, but I still want my binary dynamic-linked to system
> libraries." And in the process, it's made it completely impossible to
> build static binaries.

I agree this is a problem, will go looking for the history of the 
-static libtool flag and see what we can do.

Peter





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

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


Received: (at 11064) by debbugs.gnu.org; 22 Mar 2012 16:16:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 22 12:16:00 2012
Received: from localhost ([127.0.0.1]:33375 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SAkgA-0002Fy-Sd
	for submit <at> debbugs.gnu.org; Thu, 22 Mar 2012 12:16:00 -0400
Received: from pogma.xen.prgmr.com ([68.68.97.8]:44128)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <peter@HIDDEN>) id 1SAkg8-0002Fk-9h
	for 11064 <at> debbugs.gnu.org; Thu, 22 Mar 2012 12:15:58 -0400
Message-ID: <4F6B4902.3060000@HIDDEN>
X-DKIM: Sendmail DKIM Filter v2.8.3 pogma.xen.prgmr.com 58060BF423
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pogma.com; s=pogmail;
	t=1332431107; bh=NzDpU4SXi/+VW1W3v+3ZzeK4t1S7ayzyg5z5b1Xkp3U=;
	h=Date:From:MIME-Version:To:CC:Subject:References:In-Reply-To:
	Content-Type:Content-Transfer-Encoding;
	b=Bz2YXQ86dpPF/lAq3icLtSzvwrGEuCijOduFOBntGer2Kk6lBXtaDE0Elww2p2DHm
	hTUT66lLgqbFfOtyUO2AP49SPBbNNokGKU/gReOcJtniMXlhB/IbllZZjlQtZOQ5WI
	3z1PSFQfDUBAeZCsczziLBelunxmRuPPEIq8vJVM=
Date: Thu, 22 Mar 2012 10:45:06 -0500
From: Peter O'Gorman <peter@HIDDEN>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.22) Gecko/20110906 Fedora/3.1.14-1.fc14 Thunderbird/3.1.14
MIME-Version: 1.0
To: bugdal@HIDDEN
Subject: Re: bug#11064: CRITICAL: libtool makes static linking impossible
References: <20120322044930.GA28934@HIDDEN>
In-Reply-To: <20120322044930.GA28934@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 11064
Cc: 11064 <at> debbugs.gnu.org
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: -1.9 (-)

Hello,

On 03/21/2012 11:49 PM, bugdal@HIDDEN wrote:
> Recent versions of libtool (since at least 2.2.6) hijack the -static
> flag to the compiler and use it to link only project-local libraries
> static (i.e. still generating a dynamic-linked binary). Supposedly the
> -all-static option is provided to override this behavior, but it is
> not usable in any real-world programs because adding -all-static to
> CFLAGS or LDFLAGS prevents all configure tests that invoke the
> compiler/linker without libtool from working due to the unrecognized
> option.
>
> As far as I can tell, there is no workaround and abolutely no way to
> static-link libtool-based projects without patching libtool.


does:
./configure CC='gcc -static' CXX='g++ -static' ...

work around this for you?

I think the -static, -all-static etc libtool flags were meant for 
Makefiles, not really for user LDFLAGS.

Peter




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

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


Received: (at submit) by debbugs.gnu.org; 22 Mar 2012 06:44:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 22 02:44:29 2012
Received: from localhost ([127.0.0.1]:60468 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SAbl5-00025z-RK
	for submit <at> debbugs.gnu.org; Thu, 22 Mar 2012 02:44:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41637)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <dalias@HIDDEN>) id 1SAalL-00082f-6l
	for submit <at> debbugs.gnu.org; Thu, 22 Mar 2012 01:40:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dalias@HIDDEN>) id 1SAaHY-0007Ep-22
	for submit <at> debbugs.gnu.org; Thu, 22 Mar 2012 01:09:53 -0400
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
	autolearn=ham version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:43569)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dalias@HIDDEN>) id 1SAaHX-0007Eh-Uj
	for submit <at> debbugs.gnu.org; Thu, 22 Mar 2012 01:09:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43774)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dalias@HIDDEN>) id 1SAaHW-0002II-E5
	for bug-libtool@HIDDEN; Thu, 22 Mar 2012 01:09:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dalias@HIDDEN>) id 1SAaHU-0007Dt-8I
	for bug-libtool@HIDDEN; Thu, 22 Mar 2012 01:09:49 -0400
Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:47462
	helo=brightrain.aerifal.cx) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dalias@HIDDEN>) id 1SAaHT-0007Di-WC
	for bug-libtool@HIDDEN; Thu, 22 Mar 2012 01:09:48 -0400
Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2)
	id 1SAZxq-0007rn-00
	for bug-libtool@HIDDEN; Thu, 22 Mar 2012 04:49:30 +0000
Date: Thu, 22 Mar 2012 00:49:30 -0400
From: bugdal@HIDDEN
To: bug-libtool@HIDDEN
Subject: CRITICAL: libtool makes static linking impossible
Message-ID: <20120322044930.GA28934@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.9 (------)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 22 Mar 2012 02:44:26 -0400
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 (------)

Recent versions of libtool (since at least 2.2.6) hijack the -static
flag to the compiler and use it to link only project-local libraries
static (i.e. still generating a dynamic-linked binary). Supposedly the
-all-static option is provided to override this behavior, but it is
not usable in any real-world programs because adding -all-static to
CFLAGS or LDFLAGS prevents all configure tests that invoke the
compiler/linker without libtool from working due to the unrecognized
option.

As far as I can tell, there is no workaround and abolutely no way to
static-link libtool-based projects without patching libtool.





Acknowledgement sent to bugdal@HIDDEN:
New bug report received and forwarded. Copy sent to bug-libtool@HIDDEN. Full text available.
Report forwarded to bug-libtool@HIDDEN:
bug#11064; 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.