From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] Bug in RPATH fixing logic
Date: Mon, 13 Nov 2017 21:33:43 +0100 [thread overview]
Message-ID: <20171113203343.GC2861@scaer> (raw)
In-Reply-To: <d632b876-9cbe-bbec-5195-d383b6ebd440@grandegger.com>
On 2017-11-13 19:04 +0100, Wolfgang Grandegger spake thusly:
> Hello,
>
> Am 13.11.2017 um 18:36 schrieb Yann E. MORIN:
> > Peter, All,
> >
> > On 2017-11-13 14:50 +0100, Peter Korsgaard spake thusly:
> >>>>>>> "Wolfgang" == Wolfgang Grandegger <wg@grandegger.com> writes:
> >> > This means: A symbolic link would work.
> >> Ok, great - Makes sense. I wonder how much effort it wil be to get
> >> binutils to generate symbolic links instead of hard links.
> >
> > No way.
>
> Well, the attached patch fixes the issue with the binary utilities (ld,
> ar, objdump, as, ...). I think only the fixes in "binutils/Makefile.in" and
> "gas/Makefile.in" are need, IIRC. And in the fixes did not break the
> build, at least. Will do more checks...
Well, what I meant is that there are no --disable-hardlinks on the
ocnfigure command line.
And don;t forget that we do have 4 versions of binutils to patch.
And as Peter said: if we patch, we should try to get that upstreamable.
Maybe upstream will be receptive to that. Or maybe not. Who knows...
I think providing a post-install hook is better than patching.
> > We'll have to provide post-install hooks to do the de-hardlinking step
> > ourselves.
>
> > Also, as Wolfgang noticed, gcc is also affected by the hardlink issue.
>
> No, with the patch above I get:
>
> ./bin/x86_64-buildroot-linux-gnu-gcc-6.4.0.br_real: Device: 811h/2065d Inode: 64370910 Links: 3
> ./bin/x86_64-buildroot-linux-gnu-g++.br_real: Device: 811h/2065d Inode: 64370887 Links: 2
> ./bin/x86_64-buildroot-linux-gnu-gcc.br_real: Device: 811h/2065d Inode: 64370910 Links: 3
> ./bin/x86_64-buildroot-linux-gnu-c++.br_real: Device: 811h/2065d Inode: 64370887 Links: 2
> ./bin/x86_64-buildroot-linux-gnu-cc.br_real: Device: 811h/2065d Inode: 64370910 Links: 3
> ./x86_64-buildroot-linux-gnu/sysroot/usr/libexec/getconf/XBS5_LP64_OFF64: Device: 811h/2065d Inode: 72747785 Links: 4
> ./x86_64-buildroot-linux-gnu/sysroot/usr/libexec/getconf/POSIX_V6_LP64_OFF64: Device: 811h/2065d Inode: 72747785 Links: 4
> ./x86_64-buildroot-linux-gnu/sysroot/usr/libexec/getconf/POSIX_V7_LP64_OFF64: Device: 811h/2065d Inode: 72747785 Links: 4
> ./x86_64-buildroot-linux-gnu/sysroot/usr/bin/getconf: Device: 811h/2065d Inode: 72747785 Links: 4
> ./x86_64-buildroot-linux-gnu/sysroot/usr/lib/dri/i965_dri.so: Device: 811h/2065d Inode: 72748076 Links: 2
> ./x86_64-buildroot-linux-gnu/sysroot/usr/lib/dri/i915_dri.so: Device: 811h/2065d Inode: 72748076 Links: 2
>
> The gcc hard links are all in the same directory.
Right, that's OK.
> Just "getconf" remains,
> but the RPATH is already empty.
And those are binaries for the target, not the host.
Regards,
Yann E. MORIN.
> Wolfgang.
> Index: host-binutils-2.28.1/ld/Makefile.am
> ===================================================================
> --- host-binutils-2.28.1.orig/ld/Makefile.am
> +++ host-binutils-2.28.1/ld/Makefile.am
> @@ -2226,17 +2226,17 @@ install-exec-local: ld-new$(EXEEXT) inst
> n=`echo $(installed_linker) | sed '$(transform)'`; \
> if test "$(bindir)" != "$(tooldir)/bin"; then \
> rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
> fi; \
> if test "x$(install_as_default)" = "xyes"; then \
> ld=`echo ld | sed '$(transform)'`; \
> rm -f $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \
> if test "$(bindir)" != "$(tooldir)/bin"; then \
> rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
> fi; \
> fi
> Index: host-binutils-2.28.1/ld/Makefile.in
> ===================================================================
> --- host-binutils-2.28.1.orig/ld/Makefile.in
> +++ host-binutils-2.28.1/ld/Makefile.in
> @@ -3738,17 +3738,17 @@ install-exec-local: ld-new$(EXEEXT) inst
> n=`echo $(installed_linker) | sed '$(transform)'`; \
> if test "$(bindir)" != "$(tooldir)/bin"; then \
> rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
> fi; \
> if test "x$(install_as_default)" = "xyes"; then \
> ld=`echo ld | sed '$(transform)'`; \
> rm -f $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$$ld$(EXEEXT); \
> if test "$(bindir)" != "$(tooldir)/bin"; then \
> rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
> fi; \
> fi
> Index: host-binutils-2.28.1/binutils/Makefile.in
> ===================================================================
> --- host-binutils-2.28.1.orig/binutils/Makefile.in
> +++ host-binutils-2.28.1/binutils/Makefile.in
> @@ -1512,7 +1512,7 @@ install-exec-local: install-binPROGRAMS
> k=`echo $$j | sed '$(transform)'`; \
> if [ "$(bindir)/$$k" != "$(tooldir)/bin/$$j" ]; then \
> rm -f $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$k$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$k$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \
> fi; \
> else true; \
> Index: host-binutils-2.28.1/gas/Makefile.in
> ===================================================================
> --- host-binutils-2.28.1.orig/gas/Makefile.in
> +++ host-binutils-2.28.1/gas/Makefile.in
> @@ -2698,7 +2698,7 @@ install-exec-tooldir: install-exec-bindi
> n=`echo as | sed '$(transform)'`; \
> if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
> rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
> else \
> true ; \
> Index: host-binutils-2.28.1/gas/Makefile.am
> ===================================================================
> --- host-binutils-2.28.1.orig/gas/Makefile.am
> +++ host-binutils-2.28.1/gas/Makefile.am
> @@ -617,7 +617,7 @@ install-exec-tooldir: install-exec-bindi
> n=`echo as | sed '$(transform)'`; \
> if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \
> rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \
> else \
> true ; \
> Index: host-binutils-2.28.1/binutils/Makefile.am
> ===================================================================
> --- host-binutils-2.28.1.orig/binutils/Makefile.am
> +++ host-binutils-2.28.1/binutils/Makefile.am
> @@ -547,7 +547,7 @@ install-exec-local: install-binPROGRAMS
> k=`echo $$j | sed '$(transform)'`; \
> if [ "$(bindir)/$$k" != "$(tooldir)/bin/$$j" ]; then \
> rm -f $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \
> - ln $(DESTDIR)$(bindir)/$$k$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \
> + ln -s $(DESTDIR)$(bindir)/$$k$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \
> || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \
> fi; \
> else true; \
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2017-11-13 20:33 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-12 16:40 [Buildroot] Bug in RPATH fixing logic Thomas Petazzoni
2017-11-12 16:49 ` Thomas Petazzoni
2017-11-12 17:15 ` Peter Korsgaard
2017-11-12 17:24 ` Thomas Petazzoni
2017-11-12 17:42 ` Yann E. MORIN
2017-11-13 7:17 ` Wolfgang Grandegger
2017-11-13 13:50 ` Peter Korsgaard
2017-11-13 15:19 ` Wolfgang Grandegger
2017-11-13 17:36 ` Yann E. MORIN
2017-11-13 18:04 ` Wolfgang Grandegger
2017-11-13 20:23 ` Peter Korsgaard
2017-11-13 20:33 ` Yann E. MORIN [this message]
2017-11-14 8:00 ` Wolfgang Grandegger
2017-11-14 9:05 ` Wolfgang Grandegger
2017-11-14 10:39 ` Peter Korsgaard
2017-11-12 18:03 ` Peter Korsgaard
2017-11-12 19:04 ` Wolfgang Grandegger
2017-11-12 19:35 ` Wolfgang Grandegger
2017-11-12 20:37 ` Thomas Petazzoni
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=20171113203343.GC2861@scaer \
--to=yann.morin.1998@free.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.