libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Three problems with libtools


From: Marc Espie
Subject: Re: Three problems with libtools
Date: Tue, 3 Oct 2000 09:12:28 +0200

On Tue, Oct 03, 2000 at 04:33:55AM -0200, Alexandre Oliva wrote:
> On Oct  2, 2000, Marc Espie <address@hidden> wrote:
> 
> > * when invoking gcc to produce shared libraries, always pass pic_flag
> > around.
> 
> This can't be done on all platforms.  IIRC, on SunOS4, -fPIC or -fpic
> (I don't recall which one) change the ABI, so libgcc and libstdc++
> (and all other GCC libraries, for that matter) are multilibbed, and
> different libraries are picked when the flag is present.  Needless to
> say, linking object files or libraries using different ABIs breaks at
> run-time.  Programs created like that usually die horribly.
> 
> I guess the way to go is to add $pic_flag to archive_cmds on platforms
> that need it.

??? I'm advocating adding $pic_flag to the gcc that gets used to link.
Considering that the SAME $pic_flag gets used to build the object files
in the first place, I have trouble understanding how this breaks multi-libbed
ABI. If you compile object files with -fPIC on sparc, you definitely want
to pick the multi-libbed version that's been compiled with -fPIC, don't you ?
> 
> > * on OpenBSD, it is quite possible to compile shared libraries, and test
> > for their presence. However, libtool does insist that libgcc ought to be
> > a shared library as well... Is there a way to disable that ?
> > I can always use pass_all instead, but... it would be cleaner.
> 
> If pass_all is correct, that's the way to disable that.  Using other
> dependency checks means you can't link a static library into a shared
> library in general.

pass_all is not 100% correct. pass_all assumes that all libraries you're 
going to meet are suitable for linking with a shared library. Unfortunately,
most .a libraries won't necessarily be, as they might not be pic code, and
lead to unpure shared libraries. libgcc *is* an exception, precisely because
it will be pic/PIC. Whatever.

-- 
        Marc Espie              
|anime, sf, juggling, unicycle, acrobatics, comics...
|AmigaOS, OpenBSD, C++, perl, Icon, PostScript...
| `real programmers don't die, they just get out of beta'



reply via email to

[Prev in Thread] Current Thread [Next in Thread]