public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "John Calcote" <jcalcote@novell.com>
To: "Daniel Jacobowitz" <drow@false.org>
Cc: <binutils@sourceware.org>
Subject: Re: linker error with new linker
Date: Wed, 12 Jul 2006 16:28:00 -0000	[thread overview]
Message-ID: <44B4CEAE.37FF.0081.0@novell.com> (raw)

Daniel,
 
Thanks for the info - yes, I just had a brain-fart when I typed that
LDFLAGS comment - it took me half a compile to realize that it had to be
in CFLAGS, not LDFLAGS. 
 
However, the real question was: Does anyone know if there's a
"standard" way of dealing with the "linking shared libraries from static
libraries in autotools" issue? I know this is not the automake forum,
but this is a linker issue, so I thought you guys might have a clue. :)
 
John

>>> Daniel Jacobowitz <drow@false.org> 7/12/2006 8:08 AM >>>
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

             reply	other threads:[~2006-07-12 16:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12 16:28 John Calcote [this message]
2006-07-12 16:46 ` Diego 'Flameeyes' Pettenò
2006-07-12 17:04   ` John Calcote
  -- strict thread matches above, loose matches on Subject: below --
2006-07-12  5:08 John Calcote
2006-07-12 14:08 ` Daniel Jacobowitz
2006-07-12 15:32 ` Andreas Jaeger
2006-07-12 16:17   ` İsmail Dönmez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44B4CEAE.37FF.0081.0@novell.com \
    --to=jcalcote@novell.com \
    --cc=binutils@sourceware.org \
    --cc=drow@false.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).