This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: linker error with new linker
- From: Daniel Jacobowitz <drow at false dot org>
- To: John Calcote <jcalcote at novell dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 12 Jul 2006 10:08:20 -0400
- Subject: Re: linker error with new linker
- References: <44B42F5C.37FF.0081.0@novell.com>
On Tue, Jul 11, 2006 at 11:08:12PM -0600, John Calcote wrote:
> If this assumption is correct, then I believe it's really a good thing
> - we SHOULD use all -fPIC flagged code in shared libraries. But I'm not
> sure why it's become important in this later version of the linker.
It has never worked fine, esp. on x86_64. It's just the linker wasn't
as rigorous about telling you about the problem previously.
> SuSE Enterprise Linux 10 Beta 8 - ld is newer (whatever SuSE's
> packaging along with gcc 4.1.0-5): generates the above error.
> Here's my problem. Convenience libraries are good. They allow us to
> break large sets of files up into smaller sets of objects (static
> libraries) that we can deal with from one build directory to another. I
> can reference a static library later in my build easily from another
> directory. This is fairly common practice, I believe. With the advent of
> this new linker error, what can I do to maintain this model? I don't
> ship the static convenience libraries as part of my package. They just
> make the build system a bit more modular. Is there a recommended
> approach to fixing this issue without reorganizing my entire automake
> system?
>
> For now, I going to try to override the static library flags LDFLAGS
> for the convenience libraries and force the -fPIC flag on, which should
> work fine since I don't expect consumers to use these convenience
> libraries. But if there's a better way, please let me know.
LDFLAGS has nothing to do with it - you don't link archives. Compile
all code that is destined to end up in a shared library with -fPIC (in
CFLAGS).
--
Daniel Jacobowitz
CodeSourcery