-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the llmvPkgs_15.stdenv
toolchain
#213144
Comments
Note that mkShell uses the default stdenv, which comes with a gcc toolchain. Use llvmPackages_15.stdenv.mkDerivation instead. About lld, I think you may have a look at pkgsLLVM (but maybe this has to do with libc++ vs libstdc++, I'm not sure). |
@symphorien Overriding the stdenv only seems to affect { pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/d231d18e4aa5e1d00f86b4f484f9e4344538e3ea.tar.gz") {} }:
#pkgs.mkShell.override {
# stdenv = pkgs.llvmPackages_15.stdenv;
#}
pkgs.llvmPackages_15.stdenv.mkDerivation {
name = "env";
buildInputs = [
pkgs.llvmPackages_15.bintools
pkgs.llvmPackages_15.clang
pkgs.llvmPackages_15.compiler-rt
pkgs.llvmPackages_15.libcxx
pkgs.llvmPackages_15.libcxxabi
pkgs.llvmPackages_15.libunwind
pkgs.llvmPackages_15.lld
pkgs.which
];
shellHook = ''
echo '#include <iostream>
auto main() -> int {
std::cout << "Hello" << std::endl;
}' > main.cpp
echo
echo FIRST_INVOCATION
echo
clang++ -v -Wl,--verbose -fuse-ld=lld main.cpp
echo
echo SECOND_INVOCATION
echo
clang++ \
-v \
-Wl,--verbose \
-rtlib=compiler-rt \
-unwindlib=libunwind \
-nostdinc++ \
-nostdlib++ \
-fuse-ld=lld \
-isystem /nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include/c++/v1 \
-l:libc++.a \
-lc++abi \
main.cpp
'';
} In the above file, when run with Note that the additional libcxx include path is needed since only Also note that FIRST_INVOCATION
clang version 15.0.7
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/x4b3ywygnx0cla63wp50cpyhrs92n7lh-clang-15.0.7/bin
Found candidate GCC installation: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-gnu/11.3.0
Found candidate GCC installation: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0
Selected GCC installation: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/nix/store/x4b3ywygnx0cla63wp50cpyhrs92n7lh-clang-15.0.7/bin/clang-15" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free -clear-ast-before-
backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-
errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger
-tuning=gdb -v -fcoverage-compilation-dir=/home/aaron/aaronmondal/rules_ll -nostdsysteminc -resource-dir /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/reso
urce-root -idirafter /nix/store/49zl26cmymymzzh1xqahd6cp1g10l141-glibc-2.35-224-dev/include -isystem /nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/i
nclude -isystem /nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include -isystem /nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include -isyst
em /nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include -isystem /nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include -isystem /nix/s
tore/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include -isystem /nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include -isystem /nix/store/4z58wqnr
7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include -isystem /nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include -isystem /nix/store/5awygvmavjjasnxp1
q04q106q9x316ax-libcxx-15.0.7-dev/include -isystem /nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include -isystem /nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2r
yz-lld-15.0.7-dev/include -isystem /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/include/c++/11.3.0 -isystem /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/i
nclude/c++/11.3.0/x86_64-unknown-linux-gnu -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -internal-isystem /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-u
nknown-linux-gnu/11.3.0/../../../../include/c++/11.3.0 -internal-isystem /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0/../.
./../../include/c++/11.3.0/x86_64-unknown-linux-gnu -internal-isystem /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.
./../include/c++/11.3.0/backward -internal-isystem /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/include -O2 -Wformat -Wformat-security -Werr
or=format-security -fdeprecated-macro -fdebug-compilation-dir=/home/aaron/aaronmondal/rules_ll -ferror-limit 19 -fwrapv -stack-protector 2 -stack-protector-buffer-size 4 -fgn
uc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /run/user/1000/main-df3b94.o -x c++ main.c
pp
clang -cc1 version 15.0.7 based upon LLVM 15.0.7 default target x86_64-unknown-linux-gnu
ignoring duplicate directory "/nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/include/c++/11.3.0"
ignoring duplicate directory "/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/include/c++/11.3.0/x86_64-unknown-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include
/nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include
/nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include
/nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include
/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/include/c++/11.3.0
/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/include/c++/11.3.0/x86_64-unknown-linux-gnu
/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../../include/c++/11.3.0/backward
/nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/include
/nix/store/49zl26cmymymzzh1xqahd6cp1g10l141-glibc-2.35-224-dev/include
End of search list.
"/nix/store/1clkc48ilspa1snkmpwj3c5k7kfbdga5-llvm-binutils-wrapper-15.0.7/bin/ld.lld" -pie --eh-frame-hdr -m elf_x86_64 -o a.out /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-
glibc-2.35-224/lib/Scrt1.o /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/crti.o /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown
-linux-gnu/11.3.0/crtbeginS.o -L/nix/store/yvrj6nxc7iyngicpd5d13pzfd6m1vari-libcxx-15.0.7/lib -L/nix/store/rr6bk84i67k8pk7nap0pzfc4pwgsk66w-libcxxabi-15.0.7/lib -L/nix/store/
60258c51xdkhcxlkr2f66armdfsdnb8c-libunwind-15.0.7/lib -L/nix/store/56gi28wli438iyhq39g8kjpbsz04s7s1-lld-15.0.7-lib/lib -L/nix/store/yvrj6nxc7iyngicpd5d13pzfd6m1vari-libcxx-15
.0.7/lib -L/nix/store/rr6bk84i67k8pk7nap0pzfc4pwgsk66w-libcxxabi-15.0.7/lib -L/nix/store/60258c51xdkhcxlkr2f66armdfsdnb8c-libunwind-15.0.7/lib -L/nix/store/56gi28wli438iyhq39
g8kjpbsz04s7s1-lld-15.0.7-lib/lib -L/nix/store/yvrj6nxc7iyngicpd5d13pzfd6m1vari-libcxx-15.0.7/lib -L/nix/store/yvrj6nxc7iyngicpd5d13pzfd6m1vari-libcxx-15.0.7/lib -L/nix/store
/rr6bk84i67k8pk7nap0pzfc4pwgsk66w-libcxxabi-15.0.7/lib -L/nix/store/rr6bk84i67k8pk7nap0pzfc4pwgsk66w-libcxxabi-15.0.7/lib -L/nix/store/60258c51xdkhcxlkr2f66armdfsdnb8c-libunw
ind-15.0.7/lib -L/nix/store/60258c51xdkhcxlkr2f66armdfsdnb8c-libunwind-15.0.7/lib -L/nix/store/56gi28wli438iyhq39g8kjpbsz04s7s1-lld-15.0.7-lib/lib -L/nix/store/56gi28wli438iy
hq39g8kjpbsz04s7s1-lld-15.0.7-lib/lib -L/nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib -L/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64
-unknown-linux-gnu/11.3.0 -L/nix/store/sq78g74zs4sj7n1j5709g9c2pmffx1y8-gcc-11.3.0-lib/x86_64-unknown-linux-gnu/lib -L/nix/store/5dr46cz3z9ggvqbxyqfa0zl7lyzj4739-clang-15.0.7
-lib/lib -L/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0 -L/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc
/x86_64-unknown-linux-gnu/11.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/lib -L/usr/lib -dynamic-linker=/nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.3
5-224/lib/ld-linux-x86-64.so.2 --verbose /run/user/1000/main-df3b94.o -rpath /nix/store/5fnassgf4rm2amqv6z23289v2qmd1xg6-env/lib64 -rpath /nix/store/5fnassgf4rm2amqv6z23289v2
qmd1xg6-env/lib -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/crtendS.o /nix/sto
re/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/crtn.o
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/Scrt1.o
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/crti.o
ld.lld: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/crtbeginS.o
ld.lld: /run/user/1000/main-df3b94.o
ld.lld: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../../lib64/libstdc++.a
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libm.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libm.so.6
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libmvec.so.1
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libgcc_s.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libgcc_s.so.1
ld.lld: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/libgcc.a
ld.lld: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/libgcc.a
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libc.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libc.so.6
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libc_nonshared.a
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/ld-linux-x86-64.so.2
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libgcc_s.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libgcc_s.so.1
ld.lld: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/libgcc.a
ld.lld: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/libgcc.a
ld.lld: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/crtendS.o
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/crtn.o
SECOND_INVOCATION
clang version 15.0.7
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/x4b3ywygnx0cla63wp50cpyhrs92n7lh-clang-15.0.7/bin
Found candidate GCC installation: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/gcc/x86_64-unknown-linux-gnu/11.3.0
Found candidate GCC installation: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0
Selected GCC installation: /nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/nix/store/x4b3ywygnx0cla63wp50cpyhrs92n7lh-clang-15.0.7/bin/clang-15" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj --mrelax-relocations -disable-free -clear-ast-before-
backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -fmath-
errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger
-tuning=gdb -v -fcoverage-compilation-dir=/home/aaron/aaronmondal/rules_ll -nostdsysteminc -nostdinc++ -resource-dir /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper
-15.0.7/resource-root -isystem /nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include/c++/v1 -idirafter /nix/store/49zl26cmymymzzh1xqahd6cp1g10l141-glibc-2.35-
224-dev/include -isystem /nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include -isystem /nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-de
v/include -isystem /nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include -isystem /nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include -isyst
em /nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include -isystem /nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include -isystem /ni
x/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include -isystem /nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include -isystem /nix/store/5q1pkviy
c3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include -isystem /nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include -isystem /nix/store/1zg48f5wh619b3
ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include -isystem /nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -internal-
isystem /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/include -O2 -Wformat -Wformat-security -Werror=format-security -fdeprecated-macro -fdeb
ug-compilation-dir=/home/aaron/aaronmondal/rules_ll -ferror-limit 19 -fwrapv -stack-protector 2 -stack-protector-buffer-size 4 -fgnuc-version=4.2.1 -fcxx-exceptions -fexcepti
ons -fcolor-diagnostics -vectorize-loops -vectorize-slp -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /run/user/1000/main-de9788.o -x c++ main.cpp
clang -cc1 version 15.0.7 based upon LLVM 15.0.7 default target x86_64-unknown-linux-gnu
ignoring duplicate directory "/nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include"
ignoring duplicate directory "/nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include"
#include "..." search starts here:
#include <...> search starts here:
/nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include/c++/v1
/nix/store/5q1pkviyc3ppiqqsxq2v2z3ka4qlnba1-compiler-rt-libc-15.0.7-dev/include
/nix/store/5awygvmavjjasnxp1q04q106q9x316ax-libcxx-15.0.7-dev/include
/nix/store/1zg48f5wh619b3ya1nz8id7bwcylmlx5-libcxxabi-15.0.7-dev/include
/nix/store/4z58wqnr7mwp6ssfypad5cl6lrgf2ryz-lld-15.0.7-dev/include
/nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/include
/nix/store/49zl26cmymymzzh1xqahd6cp1g10l141-glibc-2.35-224-dev/include
End of search list.
"/nix/store/1clkc48ilspa1snkmpwj3c5k7kfbdga5-llvm-binutils-wrapper-15.0.7/bin/ld.lld" -pie --eh-frame-hdr -m elf_x86_64 -o a.out /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-
glibc-2.35-224/lib/Scrt1.o /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/crti.o /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-roo
t/lib/linux/clang_rt.crtbegin-x86_64.o -L/nix/store/yvrj6nxc7iyngicpd5d13pzfd6m1vari-libcxx-15.0.7/lib -L/nix/store/rr6bk84i67k8pk7nap0pzfc4pwgsk66w-libcxxabi-15.0.7/lib -L/n
ix/store/60258c51xdkhcxlkr2f66armdfsdnb8c-libunwind-15.0.7/lib -L/nix/store/56gi28wli438iyhq39g8kjpbsz04s7s1-lld-15.0.7-lib/lib -L/nix/store/yvrj6nxc7iyngicpd5d13pzfd6m1vari-
libcxx-15.0.7/lib -L/nix/store/rr6bk84i67k8pk7nap0pzfc4pwgsk66w-libcxxabi-15.0.7/lib -L/nix/store/60258c51xdkhcxlkr2f66armdfsdnb8c-libunwind-15.0.7/lib -L/nix/store/56gi28wli
438iyhq39g8kjpbsz04s7s1-lld-15.0.7-lib/lib -L/nix/store/yvrj6nxc7iyngicpd5d13pzfd6m1vari-libcxx-15.0.7/lib -L/nix/store/yvrj6nxc7iyngicpd5d13pzfd6m1vari-libcxx-15.0.7/lib -L/
nix/store/rr6bk84i67k8pk7nap0pzfc4pwgsk66w-libcxxabi-15.0.7/lib -L/nix/store/rr6bk84i67k8pk7nap0pzfc4pwgsk66w-libcxxabi-15.0.7/lib -L/nix/store/60258c51xdkhcxlkr2f66armdfsdnb
8c-libunwind-15.0.7/lib -L/nix/store/60258c51xdkhcxlkr2f66armdfsdnb8c-libunwind-15.0.7/lib -L/nix/store/56gi28wli438iyhq39g8kjpbsz04s7s1-lld-15.0.7-lib/lib -L/nix/store/56gi2
8wli438iyhq39g8kjpbsz04s7s1-lld-15.0.7-lib/lib -L/nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib -L/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib/g
cc/x86_64-unknown-linux-gnu/11.3.0 -L/nix/store/sq78g74zs4sj7n1j5709g9c2pmffx1y8-gcc-11.3.0-lib/x86_64-unknown-linux-gnu/lib -L/nix/store/5dr46cz3z9ggvqbxyqfa0zl7lyzj4739-cla
ng-15.0.7-lib/lib -L/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0 -L/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/
lib64/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/lib -L/usr/lib -dynamic-linker=/nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-
glibc-2.35-224/lib/ld-linux-x86-64.so.2 --verbose -l:libc++.a -lc++abi /run/user/1000/main-de9788.o -rpath /nix/store/5fnassgf4rm2amqv6z23289v2qmd1xg6-env/lib64 -rpath /nix/s
tore/5fnassgf4rm2amqv6z23289v2qmd1xg6-env/lib -lm /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/lib/linux/libclang_rt.builtins-x86_64.a --as-
needed -lunwind --no-as-needed -lc /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/lib/linux/libclang_rt.builtins-x86_64.a --as-needed -lunwind
--no-as-needed /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/lib/linux/clang_rt.crtend-x86_64.o /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-
glibc-2.35-224/lib/crtn.o
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/Scrt1.o
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/crti.o
ld.lld: /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/lib/linux/clang_rt.crtbegin-x86_64.o
ld.lld: /nix/store/yvrj6nxc7iyngicpd5d13pzfd6m1vari-libcxx-15.0.7/lib/libc++.a
ld.lld: /nix/store/rr6bk84i67k8pk7nap0pzfc4pwgsk66w-libcxxabi-15.0.7/lib/libc++abi.so
ld.lld: /run/user/1000/main-de9788.o
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libm.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libm.so.6
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libmvec.so.1
ld.lld: /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/lib/linux/libclang_rt.builtins-x86_64.a
ld.lld: /nix/store/60258c51xdkhcxlkr2f66armdfsdnb8c-libunwind-15.0.7/lib/libunwind.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libc.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libc.so.6
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libc_nonshared.a
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/ld-linux-x86-64.so.2
ld.lld: /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/lib/linux/libclang_rt.builtins-x86_64.a
ld.lld: /nix/store/60258c51xdkhcxlkr2f66armdfsdnb8c-libunwind-15.0.7/lib/libunwind.so
ld.lld: /nix/store/al3wr59nslk87rh72pwvvhyijnljz7m7-clang-wrapper-15.0.7/resource-root/lib/linux/clang_rt.crtend-x86_64.o
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/crtn.o
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libpthread.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libpthread.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libpthread.so
ld.lld: /nix/store/yzjgl0h6a3qh1mby405428f16xww37h0-glibc-2.35-224/lib/libpthread.so |
Yes, clangStdenv still uses libstdc++ on linux as otherwise things built with clangStdenv (eg chromium) could not link to libraries built with stdenv (nearly everything). pkgsLLVM is a package set containing packages built with libc++ from stdenv up, and possibly with lld, but I'm not sure. Maybe try |
Also don't add unwrapped toolchain parts in buildInputs this can only break stuff. The nix way is to provide a modified stdenv, but adding stuff on top of stdenv does not work. |
Ok I think now I understand a bit better. I guess what I am asking for is something similar to Since I feel like I really need this in my life, I'll try to get something like this working, but I have like 2 days of nix experience, so it may take a while until I come up with something usable 😅 |
Ah sorry I meant |
Hi @rrbutani. I'm trying to set up the
llvmPackages_15
toolchain in a development environment for rules_ll to get a reproducible host compiler.With a
shell.nix
likeI'm having some trouble getting this toolchain to work as I want to though 😅 Either this comes from misconfiguration on my end or some issues in the nix package. I'm also finding it rather hard to find documentation on this.
and even then I'm still seeing artifacts of
-L/nix/store/z1yw9cw97bcdfmxz5wk7j1bycw42r1mw-gcc-11.3.0/lib64/gcc/x86_64-unknown-linux-gnu/11.3.0
in the linker path. I think invokingclang
instead ofclang++
for c++ is discouraged anyways, butclang++
does not work with these simpler options.clang++
seems to ignore-stdlib=libc++
and the host's/usr/include/c++/v1
leaks intoclang++
invocations:The Clang docs encourage a pattern like this for encapsulation, but I think it should be possible to default to this behavior on the nix side:
The default linker is
ld
. This seems be the case for thellvmPackages_15.stdenv
as well. Would it be possible to change this default tolld
on the nix package side? Otherwise one would have to use-fuse-ld=lld
or$LD=ld.lld
overrides which I find rather unintuitive on a pure Clang/LLVM toolchain.A similar issue seems to be true for the bintools. This is how the Make variables currently look like:
It would be nice if there was an obvious way to make these use their llvm counterparts instead without having to set this manually. I initially thought they were symlinks to the llvm variants already but it turned out that
ar --help
andllvm-ar --help
do in fact point to different tools.I'm kinda new to nix so I may be overlooking a few things here. It may also be relevant that I'm using Gentoo with the experimental clang profile, which is one of the very few (the only?) linux distros using clang/glibc system toolchain.
The text was updated successfully, but these errors were encountered: