All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] binutils: replace hard-links with soft-links to fix rpath
Date: Mon, 23 Apr 2018 15:04:12 +0200	[thread overview]
Message-ID: <20180423150412.145444ff@windsurf> (raw)
In-Reply-To: <20180423092228.GO12688@scaer>

Hello,

On Mon, 23 Apr 2018 11:22:28 +0200, Yann E. MORIN wrote:

> So I wanted to test this, and it does what's on the can.
> 
> However, I wanted to reproduce the build failures, and here, with
> current master, so I built a toolchain with buildroot [0], but none
> of binutils programs is linked with libfl:
> 
>     $ for i in host/arc-buildroot-linux-uclibc/bin/*; do
>         readelf -d "${i}" |grep NEEDED
>     done |sort -u
>      0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
>      0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
> 
> I checked, and I don't have libfl on my system, neither static not
> shared, so it cant even have picked the static one from my system.
> 
> And indeed, libnl can build:
> 
>     checking the archiver (/home/ymorin/dev/buildroot/O/host/bin/arc-buildroot-linux-uclibc-ar)interface... ar
> 
> So, I don't see the point...
> 
> [0] with this defconfig:
> BR2_arcle=y
> BR2_archs38=y
> BR2_TOOLCHAIN_BUILDROOT_CXX=y

Here:

$ cat defconfig 
BR2_arcle=y
$ make host-binutils
$ readelf -d output/host/arc-buildroot-linux-uclibc/bin/ar 

Dynamic section at offset 0xb8de0 contains 28 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libfl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000f (RPATH)              Library rpath: [/home/thomas/projets/buildroot/output/host/lib]

And indeed in the build process, I have:

/bin/sh ./libtool --tag=CC   --mode=link /usr/bin/gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wstack-usage=262144 -I./../zlib -O2 -I/home/thomas/projets/buildroot/output/host/include  -L/home/thomas/projets/buildroot/output/host/lib -Wl,-rpath,/home/thomas/projets/buildroot/output/host/lib -o ar arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o ../bfd/libbfd.la ../libiberty/libiberty.a -lfl  -ldl

To be honest, this is a bit weird, because for the other binutils,
which we build from a tarball, host-flex is not needed, and we don't
link against libfl.

See binutils/Makefile.am:

ar_LDADD = $(BFDLIB) $(LIBIBERTY) $(LEXLIB) $(LIBINTL)

and binutils/configure does check for the availability of a lex library. 

That being said, regardless of libfl specifically, I believe this
problem of hard links between binaries in different directories really
affects binutils anyway, and therefore, it makes sense to fix those to
use symlinks instead.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-04-23 13:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-22 12:23 [Buildroot] [PATCH] binutils: replace hard-links with soft-links to fix rpath Thomas Petazzoni
2018-04-23  9:22 ` Yann E. MORIN
2018-04-23 13:04   ` Thomas Petazzoni [this message]
2018-04-23 13:42     ` Yann E. MORIN
2018-05-06 20:18 ` Peter Korsgaard
2018-05-06 20:26   ` Thomas Petazzoni
2018-05-06 21:29     ` Yann E. MORIN
2018-05-24 21:05 ` Peter Korsgaard
2018-05-28 20:07   ` Yann E. MORIN

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=20180423150412.145444ff@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --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.