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: Thu, 07 Oct 2021 20:32:16 +0200	[thread overview]
Message-ID: <87wnmoadov.fsf@inria.fr> (raw)

clang-toolchain > 6 picks crt*.o from /lib or /lib64 on foreign
distros.  Here are runs on a CentOS machine:

--8<---------------cut here---------------start------------->8---
$ 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)
$ echo $?
1
$ guix environment --pure --ad-hoc clang-toolchain@12 -- 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-12: error: linker command failed with exit code 1 (use -v to see invocation)
$ guix environment --pure --ad-hoc clang-toolchain@12 -- c++ -v hello.cpp
clang version 12.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /gnu/store/vgsb018grjlhhb2gjkb3gyfm5w7mx9mx-profile/bin
Found candidate GCC installation: /gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0
Selected GCC installation: /gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
Found CUDA installation: /usr/local/cuda, version 10.0
 "/gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/bin/clang-12" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -fno-split-dwarf-inlining -debugger-tuning=gdb -v -resource-dir /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/lib/clang/12.0.0 -c-isystem /gnu/store/vgsb018grjlhhb2gjkb3gyfm5w7mx9mx-profile/include -cxx-isystem /gnu/store/vgsb018grjlhhb2gjkb3gyfm5w7mx9mx-profile/include -internal-isystem /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++ -internal-isystem /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/x86_64-unknown-linux-gnu -internal-isystem /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/backward -internal-isystem /usr/local/include -internal-isystem /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/lib/clang/12.0.0/include -internal-externc-isystem /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include -fdeprecated-macro -fdebug-compilation-dir /home/courtes -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -o /tmp/hello-7b344d.o -x c++ hello.cpp
clang -cc1 version 12.0.0 based upon LLVM 12.0.0 default target x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /gnu/store/vgsb018grjlhhb2gjkb3gyfm5w7mx9mx-profile/include
 /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++
 /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/x86_64-unknown-linux-gnu
 /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-7.5.0/include/c++/backward
 /usr/local/include
 /gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/lib/clang/12.0.0/include
 /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/include
End of search list.
 "/gnu/store/vgsb018grjlhhb2gjkb3gyfm5w7mx9mx-profile/bin/ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker //gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/ld-linux-x86-64.so.2 -o a.out /lib/../lib64/crt1.o /lib/../lib64/crti.o /gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/crtbegin.o -L/gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0 -L/lib/../lib64 -L/gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/../../.. -L/gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/bin/../lib -L/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib -L/gnu/store/vgsb018grjlhhb2gjkb3gyfm5w7mx9mx-profile/lib /tmp/hello-7b344d.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/crtend.o /lib/../lib64/crtn.o
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-12: error: linker command failed with exit code 1 (use -v to see invocation)
--8<---------------cut here---------------end--------------->8---

Notice ‘/lib/../lib64/crt1.o’ etc. above.

This suggests that ‘clang-11.0-libc-search-path.patch’ & co. aren’t
sufficient any longer.

‘strace’ shows that ‘c++’ goes through sequences like this one:

--8<---------------cut here---------------start------------->8---
access("/gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/lib/clang/12.0.0/crt1.o", F_OK) = -1 ENOENT (No such f
ile or directory)
access("/gnu/store/nzfhh1rm85lx2p5plbx45qqj82pcv5hp-clang-runtime-12.0.0/lib/linux/crt1.o", F_OK) = -1 ENOENT (No such 
file or directory)
access("/gnu/store/vn69pklab842xyig8d0c6xq6s9iyqhl0-clang-12.0.0/bin/../crt1.o", F_OK) = -1 ENOENT (No such file or dir
ectory)
access("/gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/7.5.0/crt1.o", F_OK)
 = -1 ENOENT (No such file or directory)
access("/lib/../lib64/crt1.o", F_OK)    = 0
--8<---------------cut here---------------end--------------->8---

To be continued…

Ludo’.




             reply	other threads:[~2021-10-07 18:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 18:32 Ludovic Courtès [this message]
2021-10-09  8:51 ` bug#51088: clang-toolchain > 6 refers to /lib on foreign distros Ludovic Courtès

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=87wnmoadov.fsf@inria.fr \
    --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.