Debian 12. cmake/clang not see a root / directory.
Instead, the nonexistent folder is substituted:
/home/user/x64sysroot/
x64sysroot - not present!
CMakeOutput.log:
Detecting C compiler ABI info failed to compile with the following output:
Change Dir: /media/user/22/lop/lop/BUILD/CLANG/x64_linux/Release/CMakeFiles/CMakeScratch/TryCompile-ZvmyEI
Run Build Command(s):/usr/bin/ninja cmTC_7708a && [1/2] Building C object CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o
Debian clang version 19.1.7 (++20250114103228+cd708029e0b2-1~exp1~20250114103334.78)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
(in-process)
"/usr/lib/llvm-19/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/user/22/lop/lop/BUILD/CLANG/x64_linux/Release/CMakeFiles/CMakeScratch/TryCompile-ZvmyEI -v -fcoverage-compilation-dir=/home/user/22/lop/lop/BUILD/CLANG/x64_linux/Release/CMakeFiles/CMakeScratch/TryCompile-ZvmyEI -resource-dir /usr/lib/llvm-19/lib/clang/19 -dependency-file CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o.d -MT CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /home/user/x64sysroot -internal-isystem /usr/lib/llvm-19/lib/clang/19/include -internal-isystem /home/user/x64sysroot/usr/local/include -internal-externc-isystem /home/user/x64sysroot/include -internal-externc-isystem /home/user/x64sysroot/usr/include -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o -x c /usr/share/cmake-3.25/Modules/CMakeCCompilerABI.c
clang -cc1 version 19.1.7 based upon LLVM 19.1.7 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/home/user/x64sysroot/usr/local/include"
ignoring nonexistent directory "/home/user/x64sysroot/include"
ignoring nonexistent directory "/home/user/x64sysroot/usr/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/llvm-19/lib/clang/19/include
End of search list.
[2/2] Linking C executable cmTC_7708a
FAILED: cmTC_7708a
: && /usr/bin/clang --target=x86_64-linux-gnu --sysroot=/home/user/x64sysroot -fuse-ld=lld -fuse-ld=lld -v CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o -o cmTC_7708a && :
Debian clang version 19.1.7 (++20250114103228+cd708029e0b2-1~exp1~20250114103334.78)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
"/usr/lib/llvm-19/bin/ld.lld" --sysroot=/home/user/x64sysroot --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -pie -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_7708a Scrt1.o crti.o crtbeginS.o -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L. CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed crtendS.o crtn.o
ld.lld: error: cannot open Scrt1.o: No such file or directory
ld.lld: error: cannot open crti.o: No such file or directory
ld.lld: error: cannot open crtbeginS.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: cannot open crtendS.o: No such file or directory
ld.lld: error: cannot open crtn.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
try symbolic link, but no effect
Debian 12. cmake/clang not see a root / directory.
Instead, the nonexistent folder is substituted:
/home/user/x64sysroot/
x64sysroot - not present!
CMakeOutput.log:
Detecting C compiler ABI info failed to compile with the following output:
Change Dir: /media/user/22/lop/lop/BUILD/CLANG/x64_linux/Release/CMakeFiles/CMakeScratch/TryCompile-ZvmyEI
Run Build Command(s):/usr/bin/ninja cmTC_7708a && [1/2] Building C object CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o
Debian clang version 19.1.7 (++20250114103228+cd708029e0b2-1~exp1~20250114103334.78)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
(in-process)
"/usr/lib/llvm-19/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/home/user/22/lop/lop/BUILD/CLANG/x64_linux/Release/CMakeFiles/CMakeScratch/TryCompile-ZvmyEI -v -fcoverage-compilation-dir=/home/user/22/lop/lop/BUILD/CLANG/x64_linux/Release/CMakeFiles/CMakeScratch/TryCompile-ZvmyEI -resource-dir /usr/lib/llvm-19/lib/clang/19 -dependency-file CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o.d -MT CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /home/user/x64sysroot -internal-isystem /usr/lib/llvm-19/lib/clang/19/include -internal-isystem /home/user/x64sysroot/usr/local/include -internal-externc-isystem /home/user/x64sysroot/include -internal-externc-isystem /home/user/x64sysroot/usr/include -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o -x c /usr/share/cmake-3.25/Modules/CMakeCCompilerABI.c
clang -cc1 version 19.1.7 based upon LLVM 19.1.7 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/home/user/x64sysroot/usr/local/include"
ignoring nonexistent directory "/home/user/x64sysroot/include"
ignoring nonexistent directory "/home/user/x64sysroot/usr/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/llvm-19/lib/clang/19/include
End of search list.
[2/2] Linking C executable cmTC_7708a
FAILED: cmTC_7708a
: && /usr/bin/clang --target=x86_64-linux-gnu --sysroot=/home/user/x64sysroot -fuse-ld=lld -fuse-ld=lld -v CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o -o cmTC_7708a && :
Debian clang version 19.1.7 (++20250114103228+cd708029e0b2-1~exp1~20250114103334.78)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin
"/usr/lib/llvm-19/bin/ld.lld" --sysroot=/home/user/x64sysroot --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -pie -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_7708a Scrt1.o crti.o crtbeginS.o -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L. CMakeFiles/cmTC_7708a.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed crtendS.o crtn.o
ld.lld: error: cannot open Scrt1.o: No such file or directory
ld.lld: error: cannot open crti.o: No such file or directory
ld.lld: error: cannot open crtbeginS.o: No such file or directory
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: unable to find library -lgcc
ld.lld: error: unable to find library -lgcc_s
ld.lld: error: cannot open crtendS.o: No such file or directory
ld.lld: error: cannot open crtn.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
try symbolic link, but no effect
Share Improve this question asked Jan 31 at 8:42 80PA SDD80PA SDD 111 bronze badge 1 |1 Answer
Reset to default 0You are missing the full toolchain. If it is a fresh debian install, you are probably missing the default gcc toolchain. Something like this should help
sudo apt install gcc g++ libstdc++6
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745274202a4619934.html
/home/user/x64sysroot
as a sysroot. Why do you blame clang for that? If you think that CMake incorrectly interprets your sysroot settings, then show your code or whatever which set the sysroot. – Tsyvarev Commented Jan 31 at 9:14