treewide: Get rid of cc.gcc

Instead, we have a new `gccForLibs`, which has the appropriate
definition for e.g. avoiding `x86_32` linking problems.
This commit is contained in:
John Ericson
2020-06-17 20:33:56 +00:00
parent 3541e8b4fb
commit 92f96f47b0
17 changed files with 78 additions and 86 deletions

View File

@@ -1,9 +1,7 @@
{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, ... }:
{ emscriptenVersion, stdenv, fetchFromGitHub, cmake, python, gtest, gccForLibs, ... }:
let
rev = emscriptenVersion;
haveGcc = stdenv.cc.isGNU || stdenv.cc.cc ? gcc;
gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc;
in
stdenv.mkDerivation rec {
name = "emscripten-fastcomp-${rev}";
@@ -35,16 +33,14 @@ stdenv.mkDerivation rec {
#"-DLLVM_CONFIG=${llvm}/bin/llvm-config"
"-DLLVM_BUILD_TESTS=ON"
"-DCLANG_INCLUDE_TESTS=ON"
] ++ (stdenv.lib.optional (stdenv.isLinux && haveGcc)
] ++ (stdenv.lib.optional stdenv.isLinux
# necessary for clang to find crtend.o
"-DGCC_INSTALL_PREFIX=${gcc}"
"-DGCC_INSTALL_PREFIX=${gccForLibs}"
);
enableParallelBuilding = true;
passthru = {
isClang = true;
} // stdenv.lib.optionalAttrs haveGcc {
inherit gcc;
};
meta = with stdenv.lib; {