Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Feb 2000 00:19:34 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        "Jordan K. Hubbard" <jkh@zippy.cdrom.com>
Cc:        Martin Cracauer <cracauer@cons.org>, jdp@FreeBSD.ORG, peter@FreeBSD.ORG, current@FreeBSD.ORG
Subject:   Re: "Interesting" failure mode for static linking with shared libs.
Message-ID:  <Pine.BSF.4.21.0002222357190.2368-100000@alphplex.bde.org>
In-Reply-To: <33901.951212465@zippy.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 22 Feb 2000, Jordan K. Hubbard wrote:

> > As a workaround for a static binary, you should be able to use
> >   -Xlinker -Bstatic
> > instead of
> >   -static
> 
> Actually, it appears that just -Xlinker is necessary; it works
> fine in conjunction with -static.  Thanks for this most helpful
> tip!  I can see a *lot* of scenarios where I'll be using
> -Xlinker in the future.  I didn't even know about that flag. :)

This is because `-Xlinker -static' is equivalent to `-Xlinker -Bstatic'
in the elf case.  Passing -static to the linker used to be a common
error.  The aout linker doesn't understand -static; it has sloppy args
checking and misinterprets -static as -s (strip).

-Xlinker alone is bogus.  -Xlinker is not an option; it modifies the
next option by causing it to be passed to the linker instead of
interpreted by the compiler.

I didn't know about -Xlinker either :-).  It is normally spelled `-Wl,'.

Bruce



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0002222357190.2368-100000>