all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludovic.courtes@inria.fr>
To: 51088@debbugs.gnu.org
Cc: emmanuel.agullo@inria.fr
Subject: bug#51088: clang-toolchain > 6 refers to /lib on foreign distros
Date: Sat, 09 Oct 2021 10:51:25 +0200	[thread overview]
Message-ID: <87h7dq37jm.fsf@gnu.org> (raw)
In-Reply-To: <87wnmoadov.fsf@inria.fr> ("Ludovic Courtès"'s message of "Thu, 07 Oct 2021 20:32:16 +0200")

Hi,

Ludovic Courtès <ludovic.courtes@inria.fr> skribis:

> clang-toolchain > 6 picks crt*.o from /lib or /lib64 on foreign
> distros.  Here are runs on a CentOS machine:
>
> $ guix environment --pure --ad-hoc clang-toolchain@6 -- c++  hello.cpp
> $ echo $?
> 0
> $ guix environment --pure --ad-hoc clang-toolchain@7 -- c++  hello.cpp
> ld: /gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/../../../libstdc++.so: undefined reference to `__cxa_thread_atexit_impl@GLIBC_2.18'
> clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

This is fixed by these commits:

  b37fe44b7d gnu: clang@11, clang@12: Do not refer to /lib on foreign distros.
  f1b4f46f0a gnu: clang@10: Do not refer to /lib on foreign distros.
  46141bd372 gnu: clang@9: Do not refer to /lib on foreign distros.
  66caab54b9 gnu: clang@7, clang@8: Do not refer to /lib on foreign distros.

The only remaining FHS thing that shows up in ‘strace c++ hello.cpp’ is:

  stat("/lib/x86_64-linux-gnu", 0x7ffc3a4fc6d0) = -1 ENOENT (No such file or directory)

It’s harmless, coming from the somewhat comical ‘getMultiarchTriple’
function¹; excerpt:

  case llvm::Triple::x86_64:
    if (IsAndroid)
      return "x86_64-linux-android";
    // We don't want this for x32, otherwise it will match x86_64 libs
    if (TargetEnvironment != llvm::Triple::GNUX32 &&
        D.getVFS().exists(SysRoot + "/lib/x86_64-linux-gnu"))
      return "x86_64-linux-gnu";
    break;

:-)

Thanks,
Ludo’.

¹ https://github.com/llvm/llvm-project/blob/release/12.x/clang/lib/Driver/ToolChains/Linux.cpp#L40




      reply	other threads:[~2021-10-09  8:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 18:32 bug#51088: clang-toolchain > 6 refers to /lib on foreign distros Ludovic Courtès
2021-10-09  8:51 ` Ludovic Courtès [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=87h7dq37jm.fsf@gnu.org \
    --to=ludovic.courtes@inria.fr \
    --cc=51088@debbugs.gnu.org \
    --cc=emmanuel.agullo@inria.fr \
    /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 external index

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

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.