diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-26 14:12:09 -0500 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2017-12-27 15:15:41 -0500 |
commit | 831c71eea34de2d947037d67e94b312de17b2bfc (patch) | |
tree | e07fdf866732d7c96047aa1994d5bb4cb3bcb22b /pkgs/top-level | |
parent | f5fc1ff34499756914b0b4d6b444d3640153adcd (diff) | |
download | nixlib-831c71eea34de2d947037d67e94b312de17b2bfc.tar nixlib-831c71eea34de2d947037d67e94b312de17b2bfc.tar.gz nixlib-831c71eea34de2d947037d67e94b312de17b2bfc.tar.bz2 nixlib-831c71eea34de2d947037d67e94b312de17b2bfc.tar.lz nixlib-831c71eea34de2d947037d67e94b312de17b2bfc.tar.xz nixlib-831c71eea34de2d947037d67e94b312de17b2bfc.tar.zst nixlib-831c71eea34de2d947037d67e94b312de17b2bfc.zip |
top level: Clean up definitions of alternative stdenvs
- Dispatch off more appropriate conditions---`stdenv.cc.is*` and `hostPlatform.is*` directly---rather than the OS as a proxy. - Don't worry about pulling in binutils from normal `stdenv.cc` for `gccMultiStdenv`. - Defining a `multiStdenv` that uses whatever compiler is default. - Define `stdenv_32bit` in terms of `multiStdenv`.
Diffstat (limited to 'pkgs/top-level')
-rw-r--r-- | pkgs/top-level/all-packages.nix | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 15be2dcacbf7..4bd77ed485db 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34,11 +34,7 @@ with pkgs; # A stdenv capable of building 32-bit binaries. On x86_64-linux, # it uses GCC compiled with multilib support; on i686-linux, it's # just the plain stdenv. - stdenv_32bit = lowPrio ( - if system == "x86_64-linux" then - overrideCC stdenv gcc_multi - else - stdenv); + stdenv_32bit = lowPrio (if hostPlatform.is32bit then stdenv else multiStdenv); stdenvNoCC = stdenv.override { cc = null; }; @@ -5544,7 +5540,7 @@ with pkgs; }; #Use this instead of stdenv to build with clang - clangStdenv = if stdenv.isDarwin then stdenv else lowPrio llvmPackages.stdenv; + clangStdenv = if stdenv.cc.isClang then stdenv else lowPrio llvmPackages.stdenv; clang-sierraHack-stdenv = overrideCC stdenv clang-sierraHack; libcxxStdenv = if stdenv.isDarwin then stdenv else lowPrio llvmPackages.libcxxStdenv; @@ -5601,11 +5597,12 @@ with pkgs; gcc = gcc6; gcc-unwrapped = gcc.cc; - gccStdenv = if (!stdenv.isDarwin) then stdenv else stdenv.override { + gccStdenv = if stdenv.cc.isGNU then stdenv else stdenv.override { allowedRequisites = null; cc = gcc; - # Include unwrapped binaries like AS, etc. and remove libcxx/libcxxabi - extraBuildInputs = [ stdenv.cc.cc ]; + # Remove libcxx/libcxxabi, and add clang for AS if on darwin (it uses + # clang's internal assembler). + extraBuildInputs = lib.optional hostPlatform.isDarwin clang.cc; }; wrapCCMulti = cc: @@ -5645,6 +5642,7 @@ with pkgs; gccMultiStdenv = overrideCC stdenv gcc_multi; clangMultiStdenv = overrideCC stdenv clang_multi; + multiStdenv = if stdenv.cc.isClang then clangMultiStdenv else gccMultiStdenv; gcc_debug = lowPrio (wrapCC (gcc.cc.override { stripped = false; |