unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Ivan Vilata i Balaguer <ivan@selidor.net>
Cc: 38055@debbugs.gnu.org
Subject: bug#38055: patchelf: Assertion failed when setting interpreter
Date: Thu, 07 Nov 2019 21:55:03 +0100	[thread overview]
Message-ID: <87zhh7mmoo.fsf@gnu.org> (raw)
In-Reply-To: <20191106214221.GL17621@sax.terramar.selidor.net> (Ivan Vilata i. Balaguer's message of "Wed, 6 Nov 2019 16:42:21 -0500")

Bona nit!

Ivan Vilata i Balaguer <ivan@selidor.net> skribis:

> Yeah, as I mentioned in the original mail that particular problem does indeed
> seem to be fixed in 0.10.  However when I try to build that source with `guix
> build patchelf --with-source=…`, tests fail.
>
> If I run `guix environment -C --pure patchelf` then unpack and build the
> source, the only test that actually fails is `no-rpath.sh`.  If I run `sh -x
> no-rpath.sh` I get this:
>
> ```
> ++ basename no-rpath.sh .sh
> + SCRATCH=scratch/no-rpath
> + rm -rf scratch/no-rpath
> + mkdir -p scratch/no-rpath
> + cp no-rpath scratch/no-rpath/
> ++ ../src/patchelf --print-rpath scratch/no-rpath/no-rpath
> + oldRPath=/gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib:/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib:/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../..:/gnu/store/dcrwf5irwh39knld1wim1qkny659af9g-profile/lib
> + test -n /gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib:/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib:/gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.4.0/../../..:/gnu/store/dcrwf5irwh39knld1wim1qkny659af9g-profile/lib
> + exit 1
> ```
>
> To succeed, the output of `…/patchelf --print-rpath …/no-rpath`
> (i.e. `oldRPath`) should be empty.  I'm not that familiar with Guix's GNU
> build system, but is that at all possible under Guix?  I mean, maybe the test
> is pointless or must be altered in some Guix-specific way for the `no-rpath`
> binary not to have an rpath.

Guix’ ‘gcc’ automatically adds RUNPATH entries to glibc/lib and
gcc:lib/lib:

--8<---------------cut here---------------start------------->8---
$ gcc -dumpspecs |grep -e -rpath
%{!mandroid|tno-android-ld:-L/gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib %{!static:-rpath=/gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29/lib %{!static-libgcc:-rpath=/gnu/store/347y0zr1a9s2f5pkcncgi3gd0r33qq81-gcc-9.2.0-lib/lib -lgcc_s}} %{pthread:-lpthread} %{shared:-lc}    %{!shared:%{profile:-lc_p}%{!profile:-lc}};:%{shared:-lc}    %{!shared:%{profile:-lc_p}%{!profile:-lc}} %{!static: -ldl}}
--8<---------------cut here---------------end--------------->8---

The code that modifies GCC to do that is in (gnu packages gcc).

Thus, RUNPATH is never empty, and the test above is bound to fail.

Two possibilities: change the test to ensure that ‘--print-rpath’
returns precisely libc/lib:gcc/lib, or, if that turns out to be tricky,
skip the test (in both cases, add a comment linking to this discussion
for future reference.)

How does that sound?

Thank you!

Ludo’.

  reply	other threads:[~2019-11-07 20:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04  4:56 bug#38055: patchelf: Assertion failed when setting interpreter Ivan Vilata i Balaguer
2019-11-05 14:12 ` Ludovic Courtès
2019-11-05 16:18   ` Efraim Flashner
2019-11-06 21:42     ` Ivan Vilata i Balaguer
2019-11-07 20:55       ` Ludovic Courtès [this message]
2019-11-09 18:25 ` bug#38055: (no subject) Efraim Flashner
2019-11-10 14:14   ` bug#38055: none Ludovic Courtès
2019-11-11  9:27     ` Efraim Flashner
2019-11-11 15:10       ` Ivan Vilata i Balaguer
2019-11-11 15:30         ` Ivan Vilata i Balaguer
2019-11-12  5:19         ` Ivan Vilata i Balaguer

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zhh7mmoo.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=38055@debbugs.gnu.org \
    --cc=ivan@selidor.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).