From f5fc1ff34499756914b0b4d6b444d3640153adcd Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 26 Dec 2017 14:07:56 -0500 Subject: top level: Stop hacking around #28223 Clang stdenvs with either libc++ should work now. --- pkgs/top-level/all-packages.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cea7a7478add..15be2dcacbf7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1556,7 +1556,6 @@ with pkgs; m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { }; mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc rec { - clangStdenv = libcxxStdenv; # workaround for https://github.com/NixOS/nixpkgs/issues/28223 python = python2; inherit (python2Packages) gyp; protobuf = pkgs.protobuf.overrideDerivation (oldAttrs: { stdenv = clangStdenv; }); @@ -2043,7 +2042,6 @@ with pkgs; m17n = callPackage ../tools/inputmethods/fcitx-engines/fcitx-m17n { }; mozc = callPackage ../tools/inputmethods/fcitx-engines/fcitx-mozc rec { - clangStdenv = libcxxStdenv; # workaround for https://github.com/NixOS/nixpkgs/issues/28223 python = python2; inherit (python2Packages) gyp; protobuf = pkgs.protobuf.overrideDerivation (oldAttrs: { stdenv = clangStdenv; }); -- cgit 1.4.1 From 831c71eea34de2d947037d67e94b312de17b2bfc Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 26 Dec 2017 14:12:09 -0500 Subject: 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`. --- pkgs/top-level/all-packages.nix | 16 +++++++--------- 1 file 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; -- cgit 1.4.1 From 558c96fe13a692b5023d959933c89df4e0c49a34 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 26 Dec 2017 15:23:01 -0500 Subject: treewide: Cleanup usage of multi-arch tools - Don't needlessly force GCC - Prefer using multi-arch stdenvs to using multi-arch tools directly. --- pkgs/applications/audio/airwave/default.nix | 8 +++----- pkgs/os-specific/linux/statifier/default.nix | 10 ++++------ pkgs/tools/misc/loadlibrary/default.nix | 4 ++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/audio/airwave/default.nix b/pkgs/applications/audio/airwave/default.nix index 4f010213b653..c37963c77f3e 100644 --- a/pkgs/applications/audio/airwave/default.nix +++ b/pkgs/applications/audio/airwave/default.nix @@ -1,4 +1,4 @@ -{ stdenv, cmake, fetchFromGitHub, file, gcc_multi, libX11, makeWrapper +{ stdenv, multiStdenv, cmake, fetchFromGitHub, file, libX11, makeWrapper , overrideCC, qt5, requireFile, unzip, wine }: @@ -13,8 +13,6 @@ let sha256 = "1ban59skw422mak3cp57lj27hgq5d3a4f6y79ysjnamf8rpz9x4s"; }; - stdenv_multi = overrideCC stdenv gcc_multi; - vst-sdk = stdenv.mkDerivation rec { name = "vstsdk368_08_11_2017_build_121"; src = requireFile { @@ -38,7 +36,7 @@ let in -stdenv_multi.mkDerivation { +multiStdenv.mkDerivation { name = "airwave-${version}"; src = airwave-src; @@ -54,7 +52,7 @@ stdenv_multi.mkDerivation { # For airwave-host-32.exe.so, point wineg++ to 32-bit versions of # these libraries, as $NIX_LDFLAGS contains only 64-bit ones. substituteInPlace src/host/CMakeLists.txt --replace '-m32' \ - '-m32 -L${wine-xembed}/lib -L${wine-xembed}/lib/wine -L${stdenv_multi.cc.libc.out}/lib/32' + '-m32 -L${wine-xembed}/lib -L${wine-xembed}/lib/wine -L${multiStdenv.cc.libc.out}/lib/32' ''; # libstdc++.so link gets lost in 64-bit executables during diff --git a/pkgs/os-specific/linux/statifier/default.nix b/pkgs/os-specific/linux/statifier/default.nix index 3cb9179f535c..67df9dd2f11f 100644 --- a/pkgs/os-specific/linux/statifier/default.nix +++ b/pkgs/os-specific/linux/statifier/default.nix @@ -1,7 +1,7 @@ -{ stdenv, fetchurl, gcc_multi, glibc_multi }: +{ multiStdenv, fetchurl }: let version = "1.7.4"; in -stdenv.mkDerivation { +multiStdenv.mkDerivation { name = "statifier-${version}"; src = fetchurl { @@ -9,16 +9,14 @@ stdenv.mkDerivation { sha256 = "03lzkla6knjhh186b43cac410x2fmhi28pkmzb3d211n3zp5i9y8"; }; - buildInputs = [ gcc_multi glibc_multi ]; - phaseNames = [ "patchPhase" "installPhase" ]; postPatch = '' sed -e s@/usr/@"$out/"@g -i */Makefile src/statifier - sed -e s@/bin/bash@"${stdenv.shell}"@g -i src/*.sh + sed -e s@/bin/bash@"${multiStdenv.shell}"@g -i src/*.sh ''; - meta = with stdenv.lib; { + meta = with multiStdenv.lib; { description = "Tool for creating static Linux binaries"; platforms = platforms.linux; }; diff --git a/pkgs/tools/misc/loadlibrary/default.nix b/pkgs/tools/misc/loadlibrary/default.nix index 8540a3f785a7..bc52598ff800 100644 --- a/pkgs/tools/misc/loadlibrary/default.nix +++ b/pkgs/tools/misc/loadlibrary/default.nix @@ -1,4 +1,4 @@ -{ cabextract, glibc_multi, fetchFromGitHub, readline, stdenv_32bit }: +{ cabextract, fetchFromGitHub, readline, stdenv_32bit }: # stdenv_32bit is needed because the program depends upon 32-bit libraries and does not have # support for 64-bit yet: it requires libc6-dev:i386, libreadline-dev:i386. @@ -14,7 +14,7 @@ stdenv_32bit.mkDerivation rec { sha256 = "01hb7wzfh1s5b8cvmrmr1gqknpq5zpzj9prq3wrpsgg129jpsjkb"; }; - buildInputs = [ glibc_multi cabextract readline stdenv_32bit.cc.libc ]; + buildInputs = [ cabextract readline ]; installPhase = '' mkdir -p $out/bin/ -- cgit 1.4.1