Fix libjava x86-64 multilib

Michael Matz matz@suse.de
Wed Oct 2 02:24:00 GMT 2002


Hi,

On 2 Oct 2002, Alexandre Oliva wrote:

> > And AFAIK ia64 needs -fPIC also for shared libs, so is the above
> > really correct for these platforms?
>
> I'm not sufficiently familiar with ia64 to tell for sure.  The rule is
> that, if the linker fails to link any form of non-PIC into a shared
> library, then pass_all must not be used.

Right.  But the linker will fail with an hard error if you link a DSO with
non-PIC.  It's not really a difference if libtool or the linker notes
that, except that pass_all is quite a bit faster.  Yes, libtool doesn't
necessarily fail in that case, but instead either adds the static lib to
dependecy_libs, so it can be added to the application directly later, or,
when creating a module, instead creates a static module, for which it's
needed to use -dlopen.  Neither of the latter is really wanted (certainly
not static modules at least), if one has written the Makefile to link the
DSO against some .a file.  This is a change in semantics that libtool is
doing to the link process, in order to support something which isn't
really supported on those platform, which is anyway bound to fail
somewhen.  Additionally libtool has problems noticing the
difference between .a's containing just PIC objects (which are just fine)
and .a's containing some non-PIC members.  In the end we are most often
better off simply using pass_all, and rely on the linker to tell us if
something went wrong, and fix the PIC flags for the causing objects.  (Ok,
I admit, most of the above is written with my KDE hat on ;-) )


Ciao,
Michael.



More information about the Gcc-patches mailing list