All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [autobuild.buildroot.net] Your build results for 2017-04-09
Date: Fri, 14 Apr 2017 19:04:51 +0200	[thread overview]
Message-ID: <9f5cf5ff-934a-c0bd-6ac2-39b8f1f7062b@mind.be> (raw)
In-Reply-To: <20170414094440.70fd14a9@free-electrons.com>



On 14-04-17 09:44, Thomas Petazzoni wrote:
> Hello,
> 
> On Fri, 14 Apr 2017 00:14:08 +0200, Arnout Vandecappelle wrote:
> 
>>  I don't think the rpath is wrong. For the target, it *is* indeed /usr/lib.
>> AFAIU the RPATH is *not* used as an extra -L equivalent at link time, except
>> when -rpath-link is given.
> 
> Not really clear to me what happens here. The ld documentation says:

 I was also pondering over that section and couldn't get to a conclusion :-)

[snip]
> I've did a few experiments, building a dummy shared library and a
> program that links to it:
> 
> thomas at skate:/tmp/toto$ ls
> libtoto.so  libtoto.so.1  main.c  toto.c  toto.o
> 
> # -L allows the link to proceed
> 
> thomas at skate:/tmp/toto$ gcc -L/tmp/toto -o main main.c -ltoto
> thomas at skate:/tmp/toto$ 
> 
> # Neither -rpath nor -rpath-link allows ld to find libtoto

 Great.

> 
> thomas at skate:/tmp/toto$ gcc -Wl,-rpath,/tmp/toto -o main main.c -ltoto
> /usr/bin/ld: cannot find -ltoto
> collect2: error: ld returned 1 exit status
> 
> thomas at skate:/tmp/toto$ gcc -Wl,-rpath-link,/tmp/toto -o main main.c -ltoto
> /usr/bin/ld: cannot find -ltoto
> collect2: error: ld returned 1 exit status
> 
> # -L + -rpath, and you get the rpath encoded in the program

 Of course.

> 
> thomas at skate:/tmp/toto$ gcc -L/tmp/toto -Wl,-rpath,/tmp/toto -o main main.c -ltoto
> 
> thomas at skate:/tmp/toto$ readelf -d main| grep rpath
>  0x000000000000000f (RPATH)              Library rpath: [/tmp/toto]
> 
> # -L + -rpath-link, and you don't get the rpath encoded in the program

 Doesn't matter, we don't use rpath-link :-)

> 
> thomas at skate:/tmp/toto$ gcc -L/tmp/toto -Wl,-rpath-link,/tmp/toto -o main main.c -ltoto
> thomas at skate:/tmp/toto$ readelf -d main| grep rpath
> thomas at skate:/tmp/toto$ 

 You're missing one important case here: when toto.so is linked with -rpath to
some /tmp/other directory which contains a library you link against, or that is
NEEDED by toto.

 And then there is also the question of the effect of --sysroot.

 Not to forget the evil that can be done by libtool.

 Sigh.
[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

      reply	other threads:[~2017-04-14 17:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170410062848.062C02803A@b01ledav001.gho.pok.ibm.com>
     [not found] ` <20170411010019.GA2638@tungsten.ozlabs.ibm.com>
2017-04-11 12:43   ` [Buildroot] [autobuild.buildroot.net] Your build results for 2017-04-09 Thomas Petazzoni
2017-04-12  9:51     ` Arnout Vandecappelle
     [not found]     ` <20170412095212.1A18EB2050@b01ledav03.gho.pok.ibm.com>
2017-04-13  5:34       ` Sam Bobroff
2017-04-13 22:14         ` Arnout Vandecappelle
2017-04-14  7:44           ` Thomas Petazzoni
2017-04-14 17:04             ` Arnout Vandecappelle [this message]

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=9f5cf5ff-934a-c0bd-6ac2-39b8f1f7062b@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.