public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: petr.ellner@seznam.cz
To: binutils@sourceware.org
Subject: linking with local project libraries
Date: Thu, 20 Dec 2007 23:20:00 -0000	[thread overview]
Message-ID: <6.6-5177-1320839227-1198192847@seznam.cz> (raw)

Hi,

I'am dealing with following problem:
I've got program P which depends on library A which depends on library B (A uses function from B, program uses function *only* from A). Each of these three items has own directory and own makefile. P is built only with -LdirA -lA and A is built only with -LdirB -lB. when I'am building P I get /bin/ld: warning: libB.so, , needed by Adir/libA.so ... not found (try using -rpath or -rpath-link). I know that problem is that when linking P, static linker finds dependency in A and then it cannot solve it because dirB is not in standard runtime library search path. My question is, if there is some standard solution for it, when writing build system ? I'am not sure if -rpath-link can provide such solution. Let's say I am writing makefile for P. I just know that I need A and I do not want to care about what A depends on and add -rpath-link for each dependency (consider that A transitively depends on whole tree of other 'project' libraries) I just want to care about stuff that is relevant from P's perspective.

One solution which crossed my mind is whether there is some way how to force ld to solve only direct dependencies of particular object so behavior would be similar to behavior of linking on Windows or AIX. This would mean that linker would just solve dependencies of P and wouldn't go deeper. With combination with --no-undefined it could maybe work ? :)

Thanks,
Petru

             reply	other threads:[~2007-12-20 23:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-20 23:20 petr.ellner [this message]
2007-12-24 16:56 ` Nick Clifton

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=6.6-5177-1320839227-1198192847@seznam.cz \
    --to=petr.ellner@seznam.cz \
    --cc=binutils@sourceware.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).