diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-01-20 18:45:52 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-01-24 15:49:32 -0500 |
commit | 071030840252273acf05c9902458d4db5bdd71ab (patch) | |
tree | 6de26d921db33419ae2b783fdc56d79e80a2867a /pkgs/build-support | |
parent | a7a61998e9a5da33c7540486cc0616271f5e5f73 (diff) |
clang, cc-wrapper: Move `--gcc-toolchain` logic into CC wrapper
Take 2, after #94582 had to be reverted. This reverts commit ac03cfa3c57027e82073ea7db71248d4ab78af66.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/cc-wrapper/default.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index e0153ffc17fa2..212fd6b570a44 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -290,6 +290,17 @@ stdenv.mkDerivation { echo "-L${gccForLibs.lib}/${targetPlatform.config}/lib" >> $out/nix-support/cc-ldflags '' + # TODO We would like to connect this to `useGccForLibs`, but we cannot yet + # because `libcxxStdenv` on linux still needs this. Maybe someday we'll + # always set `useLLVM` on Darwin, and maybe also break down `useLLVM` into + # fine-grained use flags (libgcc vs compiler-rt, ld.lld vs legacy, libc++ + # vs libstdc++, etc.) since Darwin isn't `useLLVM` on all counts. (See + # https://clang.llvm.org/docs/Toolchain.html for all the axes one might + # break `useLLVM` into.) + + optionalString (isClang && gccForLibs != null && targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags + '' + ## ## General libc support ## |