Describe the bug
Clang's wrapper does not set ${libcxxabi.dev}/c++/v1 as an include path. Compiling files with <cxxabi.h> fails since <cxxabi.h> requires <__cxxabi_config.h> which is present in the aforementioned path
Minimal Reproduction
#if __has_include(<cxxabi.h>)
# include <cxxabi.h>
#endif
int main() {
return 0;
}
Current ouput
clang++ alo.cc
In file included from alo.cc:2:
/nix/store/wk6mn10acxsi3q3hxzhsypwxlf5nmkxa-libcxxabi-16.0.6-dev/include/cxxabi.h:20:10: fatal error: '__cxxabi_config.h' file not found
#include <__cxxabi_config.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
Verbose
clang++ --verbose alo.cc
clang version 16.0.6
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/09ccpv2ny36nfjigv260b2m8rpxccy2j-clang-16.0.6/bin
Found candidate GCC installation: /nix/store/n8dryz4xf7ln028j37zapgzg4j47p743-gcc-12.3.0/lib/gcc/x86_64-unknown-linux-gnu/12.3.0
Found candidate GCC installation: /nix/store/n8dryz4xf7ln028j37zapgzg4j47p743-gcc-12.3.0/lib64/gcc/x86_64-unknown-linux-gnu/12.3.0
Selected GCC installation: /nix/store/n8dryz4xf7ln028j37zapgzg4j47p743-gcc-12.3.0/lib64/gcc/x86_64-unknown-linux-gnu/12.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
"/nix/store/09ccpv2ny36nfjigv260b2m8rpxccy2j-clang-16.0.6/bin/clang-16" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name alo.cc -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/natto -nostdsysteminc -resource-dir /nix/store/yfw10j91pd0c4aycascgfirq58nwik03-clang-wrapper-16.0.6/resource-root -idirafter /nix/store/4lap45ifj50lp980id60fnbvs81yj9lr-glibc-2.37-8-dev/include -isystem /nix/store/2m1m4lwcr89xwyli8ir6bzkp23ymz738-libcxx-16.0.6-dev/include -isystem /nix/store/wk6mn10acxsi3q3hxzhsypwxlf5nmkxa-libcxxabi-16.0.6-dev/include -isystem /nix/store/fqvx4m5d12jpickwd1jm3lmqf55xq4ln-compiler-rt-libc-16.0.6-dev/include -isystem /nix/store/2m1m4lwcr89xwyli8ir6bzkp23ymz738-libcxx-16.0.6-dev/include -isystem /nix/store/wk6mn10acxsi3q3hxzhsypwxlf5nmkxa-libcxxabi-16.0.6-dev/include -isystem /nix/store/fqvx4m5d12jpickwd1jm3lmqf55xq4ln-compiler-rt-libc-16.0.6-dev/include -isystem /nix/store/2m1m4lwcr89xwyli8ir6bzkp23ymz738-libcxx-16.0.6-dev/include/c++/v1 -U _FORTIFY_SOURCE -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -internal-isystem /nix/store/yfw10j91pd0c4aycascgfirq58nwik03-clang-wrapper-16.0.6/resource-root/include -source-date-epoch 315532800 -O2 -Wformat -Wformat-security -Werror=format-security -fdeprecated-macro -fdebug-compilation-dir=/home/natto -ferror-limit 19 -fwrapv -stack-protector 2 -stack-protector-buffer-size 4 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/nix-shell.kawEoa/nix-shell.3Bf8zw/alo-4bb3ab.o -x c++ alo.cc
clang -cc1 version 16.0.6 based upon LLVM 16.0.6 default target x86_64-unknown-linux-gnu
ignoring duplicate directory "/nix/store/2m1m4lwcr89xwyli8ir6bzkp23ymz738-libcxx-16.0.6-dev/include"
ignoring duplicate directory "/nix/store/wk6mn10acxsi3q3hxzhsypwxlf5nmkxa-libcxxabi-16.0.6-dev/include"
ignoring duplicate directory "/nix/store/fqvx4m5d12jpickwd1jm3lmqf55xq4ln-compiler-rt-libc-16.0.6-dev/include"
#include "..." search starts here:
#include <...> search starts here:
/nix/store/2m1m4lwcr89xwyli8ir6bzkp23ymz738-libcxx-16.0.6-dev/include
/nix/store/wk6mn10acxsi3q3hxzhsypwxlf5nmkxa-libcxxabi-16.0.6-dev/include
/nix/store/fqvx4m5d12jpickwd1jm3lmqf55xq4ln-compiler-rt-libc-16.0.6-dev/include
/nix/store/2m1m4lwcr89xwyli8ir6bzkp23ymz738-libcxx-16.0.6-dev/include/c++/v1
/nix/store/yfw10j91pd0c4aycascgfirq58nwik03-clang-wrapper-16.0.6/resource-root/include
/nix/store/4lap45ifj50lp980id60fnbvs81yj9lr-glibc-2.37-8-dev/include
End of search list.
In file included from alo.cc:2:
/nix/store/wk6mn10acxsi3q3hxzhsypwxlf5nmkxa-libcxxabi-16.0.6-dev/include/cxxabi.h:20:10: fatal error: '__cxxabi_config.h' file not found
#include <__cxxabi_config.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
Notes
I created the environment using this minimal mkShell expression
mkShell.override { stdenv = llvmPackages_16.libcxxStdenv; } { }
Proposed fix
Adding -isystem ${lib.getDev libcxx.cxxabi}/include/c++/v1 to libcxx-cxxflags
Describe the bug
Clang's wrapper does not set
${libcxxabi.dev}/c++/v1as an include path. Compiling files with <cxxabi.h> fails since <cxxabi.h> requires <__cxxabi_config.h> which is present in the aforementioned pathMinimal Reproduction
Current ouput
clang++ alo.ccVerbose
clang++ --verbose alo.ccNotes
I created the environment using this minimal mkShell expression
Proposed fix
Adding
-isystem ${lib.getDev libcxx.cxxabi}/include/c++/v1tolibcxx-cxxflags