Subject: Re: bug#11064: CRITICAL: libtool makes static linking impossible

From: Rich Felker <[email-masked]>
Date: Sat, 24 Mar 2012 17:00:24 -0400

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...).