Skip to content

Commit

Permalink
Revert "Merge NixOS#94582: clang, cc-wrapper: Move --gcc-toolchain
Browse files Browse the repository at this point in the history
…logic..."

This reverts commit 0f25eb3, reversing
changes made to df91ae1.

These toolchain changes are too problematic, so reverting for now; see
NixOS#107086 (comment)
  • Loading branch information
vcunat committed Dec 21, 2020
1 parent 363175c commit ac03cfa
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 15 deletions.
17 changes: 2 additions & 15 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -278,25 +278,12 @@ stdenv.mkDerivation {
##
## GCC libs for non-GCC support
##
+ optionalString useGccForLibs (''
+ optionalString useGccForLibs ''
''
# In theory we shouldn't need this, because we 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.)
#
# But, for now, we haven't doneo these things, so we use
# `targetPlatform.isLinux` as a proxy.
+ optionalString targetPlatform.isLinux ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'' + ''
echo "-B${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-cflags
echo "-L${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-ldflags
echo "-L${gccForLibs.lib}/${targetPlatform.config}/lib" >> $out/nix-support/cc-ldflags
'')
''

##
## General libc support
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/llvm/10/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ let
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {

Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/llvm/11/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ let
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {

Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/llvm/5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ let
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {

Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/llvm/6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ let
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {

Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/llvm/7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ let
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {

Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/llvm/8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ let
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {

Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/compilers/llvm/9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ let
ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
in {

Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8987,6 +8987,8 @@ in
mkdir -p "$rsrc/lib"
ln -s "${cc}/lib" "$rsrc/include"
echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
'' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
'';
};

Expand Down

0 comments on commit ac03cfa

Please sign in to comment.