Skip to content

'__config_site' file not found #57104

@alexirion

Description

@alexirion

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    build-problemclang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions