This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Option -static
- From: Ian Lance Taylor <iant at google dot com>
- To: Takis Psarogiannakopoulos <takis at XFree86 dot Org>
- Cc: binutils at sourceware dot org
- Date: Thu, 07 Jan 2010 07:00:36 -0800
- Subject: Re: Option -static
- References: <20100107012616.W42136@public.xfree86.org>
Takis Psarogiannakopoulos <takis@XFree86.Org> writes:
> Suppose someone pass -static flag on gold asking it basically to look
> for and preferred static libraries over shared ones.
> Now assume that some system libraries are no available in static form only
> as shared ones. At the moment gold will just stop with a fatal error
> during the linking. That as the default behaviour.
>
> I think what the gold linker should do instead is look and link a static
> library, if available and can be found, otherwise still pick the dynamic
> object and preferably print a warning!
> Correct me if I am wrong but this was the GNU linker's default behaviour
> and I think in any case that gold should behave similarly.
As far as I can tell that is not how GNU ld works. When -static is in
effect, GNU ld will only find libNAME.a, not libNAME.so. Can you show
me an example which shows the behaviour you describe?
Ian