<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/125182>125182</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang] [bug]  [linux] Debian. x64sysroot directory bug
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Blaukovitch
      </td>
    </tr>
</table>

<pre>
    Try compile with clang.
Output:
**CMakeError.log**

**/home/user/x64sysroot** - directory is not present!!!!!!!!!!!!!!!!!!!!! Wrong way!

```
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.
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzcWE1v4zjS_jXMpUBBovyVgw-2Fc8bID0v0N07A-zFoMiSxA5FCiTlji_z2xcU7YnTH9s9yWJ3sYBgi1SxVF986qG496o1iGsy35J5dcPH0Fm33mo-PtqjCqK7qa08rT-6EwjbD0ojfFahA6G5aTOSb_5_DMMYSLkh-YaweO3e8Ue8c866TNs2zcWHl-eE7TvbI2H70aMjbP-0mPmTd9aGJAAUpHIognUnUB6MDTA49GgCYcVbLvjdWdPCZ36K42TTIj9f-abCgCIo08Lu4q2DzfYelGksNFxplBDsy0iEDqGxWtvPcaG9Cseu46ZFqJQj5QYI2_coFX_2mzHC9toOf_5u_3b_UBG23z1sfv0lBeaglRmfCNu_R43cx6hN8d0rjf4y-CAcD6IjbP_RnXbJOPr3Y3-6u09Ovh8NbEelJexs33MjCVt5wm6jndGcaE2tDGF7o8wnDqL_uDssl_mKA2ELwhZA5tsimkzmVdKUomTrTygCvDDpeXEmlbvYuDvb5Tbb-0xkdgp3rbhJpQRHdF5ZA8VtVmRLIGxF2JawLcvZPC-KWZGXbJoTcpmvcnaLec1o8Qc-DcUfV0JlOcuWq-hbvvnIXYsxGfC0WhwWMzqaR2M_GzoFlbZmjEKdQy6htxJ1FB2sV08k39wbH7jWKJ_zlwKlVR1_9bGnxe05cHl8vlKGDs4K9D69H8iU4u8vY_vJecIYUCEKoMGpQeN3zQWKvQrU1p-ASuV5rZE2D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