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

Previous Next

Package: libtool;

Reported by: bugdal <at> aerifal.cx

Date: Thu, 22 Mar 2012 06:45:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Roumen Petrov <bugtrack <at> roumenpetrov.info>
To: 11064 <at> debbugs.gnu.org
Cc: dalias <at> aerifal.cx, peter <at> pogma.com
Subject: bug#11064: CRITICAL: libtool makes static linking impossible
Date: Mon, 02 Apr 2012 23:54:42 +0300
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





This bug report was last modified 13 years and 139 days ago.

Previous Next


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