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

    <tr>
        <th>Summary</th>
        <td>
            '__config_site' file not found
        </td>
    </tr>

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

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

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

<pre>
    Using a self-build clang 14.0.6, setup for cross compiling for arm-linux-gnueabihf, leads to the compilation error:
**/usr/local/bin/../include/c++/v1/__config:13:10: fatal error: '__config_site' file not found**

I build clang 14.0.6 by:
cmake -G Ninja -S llvm -B build -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" -DLLVM_RUNTIME_TARGETS="arm-linux-gnueabihf" \
-DLLVM_TARGETS_TO_BUILD="ARM"

When I use **-I/usr/local/include/arm-linux-gnueabihf/c++/v1** the compilation works, however I would expect that clang could find that target non-agnostic file without explicitly setting the include directory, by using the value of the -target option.

CXXFLAGS is set to "--target=arm-linux-gnueabihf -march=armv8-a -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -stdlib=libc++".

Here the full verbose compilation output, which fails:

/usr/local/bin/clang++   --target=arm-linux-gnueabihf -march=armv8-a -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -stdlib=libc++ -v -fcolor-diagnostics -Wall -Wpedantic -Werror -Wconversion -std=gnu++20 -MD -MT homenet/test/helloworld/CMakeFiles/helloworld.dir/main.cpp.o -MF homenet/test/helloworld/CMakeFiles/helloworld.dir/main.cpp.o.d -o homenet/test/helloworld/CMakeFiles/helloworld.dir/main.cpp.o -c /home/airion/projects/homenet/myhomenet/homenet/test/helloworld/main.cpp
clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
Target: arm-unknown-linux-gnueabihf
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc-cross/arm-linux-gnueabihf/8
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/8
Selected GCC installation: /usr/lib/gcc-cross/arm-linux-gnueabihf/8
Candidate multilib: .;@m32
Selected multilib: .;@m32
 (in-process)
 "/usr/local/bin/clang-14" -cc1 -triple armv8-unknown-linux-gnueabihf -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model static -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu cortex-a72 -target-feature +crc -target-feature -dotprod -target-feature +dsp -target-feature -mve -target-feature -mve.fp -target-feature -ras -target-feature -bf16 -target-feature -sb -target-feature -i8mm -target-feature -lob -target-feature -cdecp0 -target-feature -cdecp1 -target-feature -cdecp2 -target-feature -cdecp3 -target-feature -cdecp4 -target-feature -cdecp5 -target-feature -cdecp6 -target-feature -cdecp7 -target-feature -pacbti -target-feature +hwdiv-arm -target-feature +hwdiv -target-feature +vfp2 -target-feature +vfp2sp -target-feature +vfp3 -target-feature +vfp3d16 -target-feature +vfp3d16sp -target-feature +vfp3sp -target-feature +fp16 -target-feature +vfp4 -target-feature +vfp4d16 -target-feature +vfp4d16sp -target-feature +vfp4sp -target-feature +fp-armv8 -target-feature +fp-armv8d16 -target-feature +fp-armv8d16sp -target-feature +fp-armv8sp -target-feature -fullfp16 -target-feature +fp64 -target-feature +d32 -target-feature +neon -target-feature -fp16fml -target-feature -crypto -target-feature -sha2 -target-feature -aes -target-abi aapcs-linux -mfloat-abi hard -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/airion/projects/homenet/products/rpi4 -resource-dir /usr/local/lib/clang/14.0.6 -dependency-file homenet/test/helloworld/CMakeFiles/helloworld.dir/main.cpp.o.d -MT homenet/test/helloworld/CMakeFiles/helloworld.dir/main.cpp.o -sys-header-deps -internal-isystem /usr/local/bin/../include/c++/v1 -internal-isystem /usr/local/lib/clang/14.0.6/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/include -internal-externc-isystem /usr/include/arm-linux-gnueabihf -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wall -Wpedantic -Werror -Wconversion -std=gnu++20 -fdeprecated-macro -fdebug-compilation-dir=/home/airion/projects/homenet/products/rpi4 -ferror-limit 19 -fno-signed-char -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o homenet/test/helloworld/CMakeFiles/helloworld.dir/main.cpp.o -x c++ /home/airion/projects/homenet/myhomenet/homenet/test/helloworld/main.cpp
clang -cc1 version 14.0.6 based upon LLVM 14.0.6 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/bin/../include/c++/v1
 /usr/local/lib/clang/14.0.6/include
 /usr/local/include
 /usr/lib/gcc-cross/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/include
 /usr/include/arm-linux-gnueabihf
 /usr/include
End of search list.
In file included from /home/airion/projects/homenet/myhomenet/homenet/test/helloworld/main.cpp:1:
In file included from /usr/local/bin/../include/c++/v1/cstdio:98:
/usr/local/bin/../include/c++/v1/__config:13:10: fatal error: '__config_site' file not found
#include <__config_site>


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFWFlz4zgO_jXOC4sqHT4f_OD46Mlu0jOVpCezTy6KIi12U6KKpBLn3y-oI3EiyZPeyexUJZIFggAIAh9Axip5Xn4zIj8gggyTHMelkAmikgApGHu-Nx2FaxiyZYG40ohqZQyiKiuEdNMcjegMw0d5xIe8ZCQWKXeTJCOJQVYhm7JmBrFC5Y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