All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valentin Korenblit <valentin.korenblit@smile.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/llvm: remove $ORIGIN/../lib from RPATH
Date: Wed, 11 Apr 2018 18:12:31 +0200	[thread overview]
Message-ID: <a9be8bfb-ac35-9d42-7c93-3d9431555b89@smile.fr> (raw)
In-Reply-To: <20180411174933.490f56ad@windsurf>

Hello Thomas,

On 11/04/2018 17:49, Thomas Petazzoni wrote:
> Hello Valentin,
>
> On Wed, 11 Apr 2018 17:30:22 +0200, Valentin Korenblit wrote:
>> AddLLVM.cmake adds $ORIGIN/../lib to the RPATH of llvm binaries.
>> This causes a problem when llvm-config from host installed in
>> STAGING_DIR is executed under the following conditions:
>>
>> *Target architecture same as host architecture (normally x86_64)
>> *Target's libc different from host's libc (normally glibc)
>>
>> llvm-config will try to link with the target's libc, resulting in:
>>
>> ./llvm-config: error while loading shared libraries: libc.so.0:
>> cannot open shared object file: No such file or directory.
>>
>> Link to autobuild error:
>> http://autobuild.buildroot.net/results/b81c12d529c66a028e2297ea5ce1d6930324fa69/
>>
>> To avoid this, remove the code from llvm_setup_rpath in AddLLVM.cmake
>>
>> Link to discussion:
>> http://lists.busybox.net/pipermail/buildroot/2018-April/218627.html
>>
>> Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
> Thanks for this work. However, while this is going to work for the
> Buildroot build (thanks to the hardcoded absolute RPATH encoded into
> the binaries), I believe it will fail once "make sdk" is executed,
> because "make sdk" will change the RPATH of binaries in STAGING_DIR to
> be relative RPATHs.
>
> Could you try after applying your patch:
>
> $ make [.... do the normal build ...]
> $ ./output/staging/usr/bin/llvm-config --the-flags-that-are-important
> $ readelf -d output/staging/usr/bin/llvm-config
> $ make sdk
> $ ./output/staging/usr/bin/llvm-config --the-flags-that-are-important
> $ readelf -d output/staging/usr/bin/llvm-config
>
> Is there any difference before/after the "make sdk" ?

Before running make sdk:

(RPATH) Library rpath: [/home/vakor/buildroot/test/x86/host/lib]

After running make sdk:

(RUNPATH) Library runpath: []

llvm-config works correctly in both cases. I tarballed host, moved
it to a different location, extracted it and run relocate-sdk.sh.

>
> Best regards,
>
> Thomas

Best regards,

Valentin

  reply	other threads:[~2018-04-11 16:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11 15:30 [Buildroot] [PATCH] package/llvm: remove $ORIGIN/../lib from RPATH Valentin Korenblit
2018-04-11 15:49 ` Thomas Petazzoni
2018-04-11 16:12   ` Valentin Korenblit [this message]
2018-04-11 16:48 ` Romain Naour

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=a9be8bfb-ac35-9d42-7c93-3d9431555b89@smile.fr \
    --to=valentin.korenblit@smile.fr \
    --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.