-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cc-wrapper: add libcxxabi include flag for LLVM #255488
Conversation
# .../include/cxxabi.h:20:10: fatal error: '__cxxabi_config.h' file not found | ||
# in libcxxStdenv | ||
echo "checking whether cxxabi.h can be included... " >&2 | ||
$CXX -o include-cxxabi ${./include-cxxabi.cc} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pr fixes this test for tests.cc-wrapper.llvmTests.llvmPackages_{15,16}.libcxx
# https://github.com/llvm/llvm-project/issues/55632 | ||
# ("16.0.3 libcxx, libcxxabi: circular build dependencies") | ||
# Looks like the machinery changed in https://reviews.llvm.org/D120727. | ||
"-I${lib.getDev targetLlvmLibraries.libcxx.cxxabi}/include/c++/v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed old workaround
I have to consider whether we should do this or
|
@@ -469,6 +469,7 @@ stdenv.mkDerivation { | |||
'' | |||
+ optionalString (libcxx.isLLVM or false) '' | |||
echo "-isystem ${lib.getDev libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before llvm 15 __cxxabi_config.h
was included in libcxx
so this worked correctly
llvmPackages_13.libcxx.dev 3,133 r /nix/store/5wfncnq3svyf54hfahi44smavyfbhq5b-libcxx-13.0.1-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_7.libcxx.dev 2,278 r /nix/store/2i745a6pvd2qbi0lf9a61ia0svvg9q0b-libcxx-7.1.0-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_14.libcxx.dev 3,142 r /nix/store/jri1wy9fxnnln4wv7dmzdhs9w5ll4jfa-libcxx-14.0.6-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_15.libcxxabi.dev 3,266 r /nix/store/bbvhnvq66lr6yzqxqbzff2341h9xg332-libcxxabi-15.0.7-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_6.libcxx.dev 2,032 r /nix/store/bpyj2sk6mh9vlli539jsr0w45rpig5pc-libcxx-6.0.1-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_5.libcxx.dev 2,032 r /nix/store/fciabccmn17ijmfxxn50diin0dcjz7m6-libcxx-5.0.2-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_8.libcxx.dev 2,278 r /nix/store/8sg9d3j38i3p13sg7pp4bc44szqakj7s-libcxx-8.0.1-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_9.libcxx.dev 2,411 r /nix/store/1b5yn18w09n9r50i9162zvn3zq3jn98k-libcxx-9.0.1-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_16.libcxxabi.dev 3,266 r /nix/store/02wpjmp2zjjxz13z7g599mniwi25zkcy-libcxxabi-16.0.6-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_10.libcxx.dev 2,500 r /nix/store/j41yp16y29b7gw2bd5c1ljfyyykgsh12-libcxx-10.0.1-dev/include/c++/v1/__cxxabi_config.h
llvmPackages_12.libcxx.dev 3,133 r /nix/store/fyr084bq8496099nllfjzapis7mxpj39-libcxx-12.0.1-dev/include/c++/v1/__cxxabi_config.h
and
cxxabi.h was in both libcxx and libcxxabi
llvmPackages_13.libcxx.dev 7,215 r /nix/store/5wfncnq3svyf54hfahi44smavyfbhq5b-libcxx-13.0.1-dev/include/c++/v1/cxxabi.h
llvmPackages_7.libcxx.dev 6,945 r /nix/store/2i745a6pvd2qbi0lf9a61ia0svvg9q0b-libcxx-7.1.0-dev/include/c++/v1/cxxabi.h
llvmPackages_14.libcxx.dev 7,215 r /nix/store/jri1wy9fxnnln4wv7dmzdhs9w5ll4jfa-libcxx-14.0.6-dev/include/c++/v1/cxxabi.h
libcxxrt.out 9,040 r /nix/store/sdw3q6nzxgdh6n6jdnnsgm7jpg5wsp1v-libcxxrt-unstable-2022-08-08/include/cxxabi.h
llvmPackages_12.libcxxabi.dev 7,215 r /nix/store/6lzf327lxdi743i8n8s3igq962jcp5r7-libcxxabi-12.0.1-dev/include/cxxabi.h
llvmPackages_15.libcxxabi.dev 7,237 r /nix/store/bbvhnvq66lr6yzqxqbzff2341h9xg332-libcxxabi-15.0.7-dev/include/c++/v1/cxxabi.h
llvmPackages_15.libcxxabi.dev 7,237 r /nix/store/bbvhnvq66lr6yzqxqbzff2341h9xg332-libcxxabi-15.0.7-dev/include/cxxabi.h
llvmPackages_5.libcxxabi.dev 6,945 r /nix/store/qlzdwhhd0x9fda4mk1a83jmmxza4a64p-libcxxabi-5.0.2-dev/include/cxxabi.h
libcxxabi.dev 7,029 r /nix/store/h84lr9b4q34f37jvqzqkkf4gnrlrgahl-libcxxabi-11.1.0-dev/include/cxxabi.h
llvmPackages_14.libcxxabi.dev 7,215 r /nix/store/zkfgj0hy0za0yhwnrfdndvzr301aj4pq-libcxxabi-14.0.6-dev/include/cxxabi.h
llvmPackages_6.libcxx.dev 6,945 r /nix/store/bpyj2sk6mh9vlli539jsr0w45rpig5pc-libcxx-6.0.1-dev/include/c++/v1/cxxabi.h
llvmPackages_5.libcxx.dev 6,945 r /nix/store/fciabccmn17ijmfxxn50diin0dcjz7m6-libcxx-5.0.2-dev/include/c++/v1/cxxabi.h
llvmPackages_8.libcxx.dev 6,987 r /nix/store/8sg9d3j38i3p13sg7pp4bc44szqakj7s-libcxx-8.0.1-dev/include/c++/v1/cxxabi.h
llvmPackages_9.libcxx.dev 7,023 r /nix/store/1b5yn18w09n9r50i9162zvn3zq3jn98k-libcxx-9.0.1-dev/include/c++/v1/cxxabi.h
llvmPackages_16.libcxxabi.dev 7,237 r /nix/store/02wpjmp2zjjxz13z7g599mniwi25zkcy-libcxxabi-16.0.6-dev/include/c++/v1/cxxabi.h
llvmPackages_16.libcxxabi.dev 7,237 r /nix/store/02wpjmp2zjjxz13z7g599mniwi25zkcy-libcxxabi-16.0.6-dev/include/cxxabi.h
llvmPackages_10.libcxxabi.dev 7,029 r /nix/store/pwx93kc21scj2ikif98d9zzyzaicag8x-libcxxabi-10.0.1-dev/include/cxxabi.h
llvmPackages_7.libcxxabi.dev 6,945 r /nix/store/wx2xdg98ddhrs5iif85w8dgmskgkmjv2-libcxxabi-7.1.0-dev/include/cxxabi.h
llvmPackages_9.libcxxabi.dev 7,023 r /nix/store/lhjbqxfqqckm3x2ci9v7vgblmw6jr2jc-libcxxabi-9.0.1-dev/include/cxxabi.h
llvmPackages_6.libcxxabi.dev 6,945 r /nix/store/lc41k1nfaslcp8gbgl948ksx52n19j20-libcxxabi-6.0.1-dev/include/cxxabi.h
llvmPackages_8.libcxxabi.dev 6,987 r /nix/store/khf9r8s7llkmpsxza19pqavr26j3w6lb-libcxxabi-8.0.1-dev/include/cxxabi.h
llvmPackages_10.libcxx.dev 7,029 r /nix/store/j41yp16y29b7gw2bd5c1ljfyyykgsh12-libcxx-10.0.1-dev/include/c++/v1/cxxabi.h
llvmPackages_12.libcxx.dev 7,215 r /nix/store/fyr084bq8496099nllfjzapis7mxpj39-libcxx-12.0.1-dev/include/c++/v1/cxxabi.h
because we were copying it manually to libcxx.dev/include
basically if we do this then we don't have to special case cxxabi in the wrapper and can benefit from the hook
|
Let's do this TODO remove now should be unnecessary postInstalls from all libcxxabi's |
@natto1784 do you want to re-sign the first commit before merge. CC @pwaller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This restores llvm <15 behaviour
Assuming this is redundant install -m 644 ../../${pname}/include/${if stdenv.isDarwin then "*" else "cxxabi.h"} "$dev/include" I am curious as to why is everything installed from the $src itself for darwin but not other platforms
Oh yeah sure |
Removed workaround from llvm 16. Fixes including cxxabi.h on llvm >=15 libcxxStdenv. ```c int main() {} ``` ``` /nix/store/qwnvng0cbyx0bijm654jpmpl0516hfhx-libcxxabi-15.0.7-dev/include/cxxabi.h:20:10: fatal error: '__cxxabi_config.h' file not found ``` Before llvm 15 this used to work because `libcxx` copied the headers from `cxxabi` to it's own `include`, which was then picked up by the line above this one Alternative fix would be to copy all files from `${cxxabi.dev}/include/c++/v1` to `${cxxabi.dev}/include` so the cc-wrapper setup hook would pick them up, but that would depend on in cxxabi being in buildInputs. Signed-off-by: Amneesh Singh <[email protected]>
`#include <cxxabi.h>` `/nix/store/02wpjmp2zjjxz13z7g599mniwi25zkcy-libcxxabi-16.0.6-dev/include/cxxabi.h:20:10: fatal error: '__cxxabi_config.h' file not found`
7476004
to
42f3292
Compare
I'm going to leave that for later because removing it is not necessary in this PR. |
Description of changes
Should fix #255487
Things done
Added
-isystem ${libcxxabi}/include/c++/v1
tolibcxx-cxxflags
for clangsandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)