git.iko.soy/typeable/nixpkgs
on master help sign in
Merge branch 'staging'
commit4a2340ff6bd0474d9a3e933f28b8568c59019b82 authorVladimír Čunát <vcunat@gmail.com> dateTue 19 Dec 2017, 10:27 (9 years ago) parentb45519269345ec
68 files changed+1039−369
doc/stdenv.xml+43−12 pkgs/applications/video/mpv/default.nix+9−2 pkgs/build-support/bintools-wrapper/add-flags.sh+40 pkgs/build-support/bintools-wrapper/add-hardening.sh+53 pkgs/build-support/bintools-wrapper/default.nix+292 pkgs/build-support/cc-wrapper/ld-solaris-wrapper.sh → pkgs/build-support/bintools-wrapper/ld-solaris-wrapper.sh pkgs/build-support/cc-wrapper/ld-wrapper.sh → pkgs/build-support/bintools-wrapper/ld-wrapper.sh+3−3 pkgs/build-support/cc-wrapper/macos-sierra-reexport-hack.bash → pkgs/build-support/bintools-wrapper/macos-sierra-reexport-hack.bash+3−1 pkgs/build-support/bintools-wrapper/setup-hook.sh+67 pkgs/build-support/cc-wrapper/add-flags.sh+8−27 pkgs/build-support/cc-wrapper/add-hardening.sh−10 pkgs/build-support/cc-wrapper/cc-wrapper.sh+10−3 pkgs/build-support/cc-wrapper/default.nix+41−116 pkgs/build-support/cc-wrapper/gnat-wrapper.sh+2−6 pkgs/build-support/cc-wrapper/setup-hook.sh+1−26 pkgs/build-support/cc-wrapper/utils.sh+32 pkgs/build-support/setup-hooks/ld-is-cc-hook.sh+5 pkgs/build-support/setup-hooks/separate-debug-info.sh+3−3 pkgs/build-support/setup-hooks/strip.sh+1−1 pkgs/build-support/setup-hooks/win-dll-link.sh+1−1 pkgs/build-support/trivial-builders.nix+2−2 pkgs/development/compilers/emscripten-fastcomp/default.nix+3−1 pkgs/development/compilers/gcc/4.5/default.nix+1 pkgs/development/compilers/gcc/4.8/default.nix+1 pkgs/development/compilers/gcc/4.9/default.nix+1 pkgs/development/compilers/gcc/5/default.nix+1 pkgs/development/compilers/gcc/6/default.nix+1 pkgs/development/compilers/gcc/7/default.nix+1 pkgs/development/compilers/gcc/builder.sh+35−20 pkgs/development/compilers/gcc/snapshot/default.nix+1 pkgs/development/compilers/llvm/3.7/default.nix+2−2 pkgs/development/compilers/llvm/3.8/default.nix+2−2 pkgs/development/compilers/llvm/3.9/default.nix+2−2 pkgs/development/compilers/llvm/4/default.nix+2−2 pkgs/development/compilers/llvm/5/default.nix+2−2 pkgs/development/compilers/llvm/multi.nix+48 pkgs/development/interpreters/python/build-python-package.nix+2−2 pkgs/development/interpreters/python/mk-python-derivation.nix+14−8 pkgs/development/libraries/boost/1.65.nix+2 pkgs/development/libraries/boost/generic.nix+2−2 pkgs/development/libraries/fribidi/default.nix+11−7 pkgs/development/libraries/gstreamer/vaapi/default.nix+2−2 pkgs/development/libraries/libbfd/default.nix+2−2 pkgs/development/libraries/libjpeg-turbo/default.nix+2−2 pkgs/development/libraries/libopcodes/default.nix+2−2 pkgs/development/libraries/libstdc++5/default.nix+1−1 pkgs/development/libraries/libuv/default.nix+2−2 pkgs/development/libraries/libva-utils/default.nix+29 pkgs/development/libraries/libva/default.nix+22−15 pkgs/development/libraries/mesa/default.nix+2−2 pkgs/development/libraries/vaapi-intel/default.nix+10−6 pkgs/development/perl-modules/generic/builder.sh+1−4 pkgs/development/tools/bloaty/default.nix+1−1 pkgs/development/tools/build-managers/meson/default.nix+2−2 pkgs/development/tools/misc/binutils/default.nix+1−1 pkgs/development/web/nodejs/v9.nix+2−2 pkgs/os-specific/darwin/binutils/default.nix+10−3 pkgs/stdenv/darwin/default.nix+39−23 pkgs/stdenv/linux/default.nix+33−9 pkgs/stdenv/linux/make-bootstrap-tools-cross.nix+1−1 pkgs/stdenv/linux/make-bootstrap-tools.nix+1−1 pkgs/test/cc-wrapper/multilib.nix+37 pkgs/tools/typesetting/biber/default.nix−4 pkgs/top-level/all-packages.nix+67−9 pkgs/top-level/darwin-packages.nix+8−2 pkgs/top-level/perl-packages.nix+3 pkgs/top-level/python-packages.nix+7−10 pkgs/top-level/release.nix+2
doc/stdenv.xml+43−12
@@ -1358,36 +1358,67 @@ someVar=$(stripHash $name)
13581358<variablelist>
13591359
13601360 <varlistentry>
1361− <term>CC Wrapper</term>
1361+ <term>Bintools Wrapper</term>
13621362 <listitem>
13631363 <para>
1364− CC Wrapper wraps a C toolchain for a bunch of miscellaneous purposes.
1365− Specifically, a C compiler (GCC or Clang), Binutils (or the CCTools + binutils mashup when targetting Darwin), and a C standard library (glibc or Darwin's libSystem) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by CC Wrapper.
1366− Packages typically depend on only CC Wrapper, instead of those 3 inputs directly.
1364+ Bintools Wrapper wraps the binary utilities for a bunch of miscellaneous purposes.
1365+ These are GNU Binutils when targetting Linux, and a mix of cctools and GNU binutils for Darwin.
1366+ [The "Bintools" name is supposed to be a compromise between "Binutils" and "cctools" not denoting any specific implementation.]
1367+ Specifically, the underlying bintools package, and a C standard library (glibc or Darwin's libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by Bintools Wrapper.
1368+ Packages typically depend on CC Wrapper, which in turn (at run time) depends on Bintools Wrapper.
13671369 </para>
13681370 <para>
1369− Dependency finding is undoubtedly the main task of CC wrapper.
1371+ Bintools Wrapper was only just recently split off from CC Wrapper, so the division of labor is still being worked out.
1372+ For example, it shouldn't care about about the C standard library, but just take a derivation with the dynamic loader (which happens to be the glibc on linux).
1373+ Dependency finding however is a task both wrappers will continue to need to share, and probably the most important to understand.
13701374 It is currently accomplished by collecting directories of host-platform dependencies (i.e. <varname>buildInputs</varname> and <varname>nativeBuildInputs</varname>) in environment variables.
1371− CC wrapper's setup hook causes any <filename>include</filename> subdirectory of such a dependency to be added to <envar>NIX_CFLAGS_COMPILE</envar>, and any <filename>lib</filename> and <filename>lib64</filename> subdirectories to <envar>NIX_LDFLAGS</envar>.
1372− The setup hook itself contains some lengthy comments describing the exact convoluted mechanism by which this is accomplished.
1375+ Bintools Wrapper's setup hook causes any <filename>lib</filename> and <filename>lib64</filename> subdirectories to be added to <envar>NIX_LDFLAGS</envar>.
1376+ Since CC Wrapper and Bintools Wrapper use the same strategy, most of the Bintools Wrapper code is sparsely commented and refers to CC Wrapper.
1377+ But CC Wrapper's code, by contrast, has quite lengthy comments.
1378+ Bintools Wrapper merely cites those, rather than repeating them, to avoid falling out of sync.
13731379 </para>
13741380 <para>
13751381 A final task of the setup hook is defining a number of standard environment variables to tell build systems which executables full-fill which purpose.
1376− They are defined to just be the base name of the tools, under the assumption that CC Wrapper's binaries will be on the path.
1382+ They are defined to just be the base name of the tools, under the assumption that Bintools Wrapper's binaries will be on the path.
13771383 Firstly, this helps poorly-written packages, e.g. ones that look for just <command>gcc</command> when <envar>CC</envar> isn't defined yet <command>clang</command> is to be used.
1378− Secondly, this helps packages not get confused when cross-compiling, in which case multiple CC wrappers may be simultaneous in use (targeting different platforms).
1379− <envar>BUILD_</envar>- and <envar>TARGET_</envar>-prefixed versions of the normal environment variable are defined for the additional CC Wrappers, properly disambiguating them.
1384+ Secondly, this helps packages not get confused when cross-compiling, in which case multiple Bintools Wrappers may simultaneously be in use.
1385+ <footnote><para>
1386+ Each wrapper targets a single platform, so if binaries for multiple platforms are needed, the underlying binaries must be wrapped multiple times.
1387+ As this is a property of the wrapper itself, the multiple wrappings are needed whether or not the same underlying binaries can target multiple platforms.
1388+ </para></footnote>
1389+ <envar>BUILD_</envar>- and <envar>TARGET_</envar>-prefixed versions of the normal environment variable are defined for the additional Bintools Wrappers, properly disambiguating them.
13801390 </para>
13811391 <para>
1382− A problem with this final task is that CC Wrapper is honest and defines <envar>LD</envar> as <command>ld</command>.
1392+ A problem with this final task is that Bintools Wrapper is honest and defines <envar>LD</envar> as <command>ld</command>.
13831393 Most packages, however, firstly use the C compiler for linking, secondly use <envar>LD</envar> anyways, defining it as the C compiler, and thirdly, only so define <envar>LD</envar> when it is undefined as a fallback.
1384− This triple-threat means CC Wrapper will break those packages, as LD is already defined as the actually linker which the package won't override yet doesn't want to use.
1394+ This triple-threat means Bintools Wrapper will break those packages, as LD is already defined as the actual linker which the package won't override yet doesn't want to use.
13851395 The workaround is to define, just for the problematic package, <envar>LD</envar> as the C compiler.
13861396 A good way to do this would be <command>preConfigure = "LD=$CC"</command>.
13871397 </para>
13881398 </listitem>
13891399 </varlistentry>
13901400
1401+ <varlistentry>
1402+ <term>CC Wrapper</term>
1403+ <listitem>
1404+ <para>
1405+ CC Wrapper wraps a C toolchain for a bunch of miscellaneous purposes.
1406+ Specifically, a C compiler (GCC or Clang), wrapped binary tools, and a C standard library (glibc or Darwin's libSystem, just for the dynamic loader) are all fed in, and dependency finding, hardening (see below), and purity checks for each are handled by CC Wrapper.
1407+ Packages typically depend on CC Wrapper, which in turn (at run time) depends on Bintools Wrapper.
1408+ </para>
1409+ <para>
1410+ Dependency finding is undoubtedly the main task of CC Wrapper.
1411+ This works just like Bintools Wrapper, except that any <filename>include</filename> subdirectory of any relevant dependency is added to <envar>NIX_CFLAGS_COMPILE</envar>.
1412+ The setup hook itself contains some lengthy comments describing the exact convoluted mechanism by which this is accomplished.
1413+ </para>
1414+ <para>
1415+ CC Wrapper also like Bintools Wrapper defines standard environment variables with the names of the tools it wraps, for the same reasons described above.
1416+ Importantly, while it includes a <command>cc</command> symlink to the c compiler for portability, the <envar>CC</envar> will be defined using the compiler's "real name" (i.e. <command>gcc</command> or <command>clang</command>).
1417+ This helps lousy build systems that inspect on the name of the compiler rather than run it.
1418+ </para>
1419+ </listitem>
1420+ </varlistentry>
1421+
13911422 <varlistentry>
13921423 <term>Perl</term>
13931424 <listitem><para>Adds the <filename>lib/site_perl</filename> subdirectory
pkgs/applications/video/mpv/default.nix+9−2
@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, fetchFromGitHub, makeWrapper
1+{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, makeWrapper
22, docutils, perl, pkgconfig, python3, which, ffmpeg
33, freefont_ttf, freetype, libass, libpthreadstubs
44, lua, lua5_sockets, libuchardet, libiconv ? null, darwin
@@ -90,7 +90,14 @@ in stdenv.mkDerivation rec {
9090 sha256 = "0746kmsg69675y5c70vn8imcr9d1zpjz97f27xr1vx00yjpd518v";
9191 };
9292
93− patchPhase = ''
93+ patches = [
94+ (fetchpatch {
95+ url = "https://github.com/mpv-player/mpv/commit/2ecf240b1cd20875991a5b18efafbe799864ff7f.patch";
96+ sha256 = "1sr0770rvhsgz8d7ysr9qqp4g9gwdhgj8g3rgnz90wl49lgrykhb";
97+ })
98+ ];
99+
100+ postPatch = ''
94101 patchShebangs ./TOOLS/
95102 '';
96103
pkgs/build-support/bintools-wrapper/add-flags.shnew file+40
@@ -0,0 +1,40 @@
1+# See cc-wrapper for comments.
2+var_templates_list=(
3+ NIX+IGNORE_LD_THROUGH_GCC
4+ NIX+LDFLAGS
5+ NIX+LDFLAGS_BEFORE
6+ NIX+LDFLAGS_AFTER
7+ NIX+LDFLAGS_HARDEN
8+)
9+var_templates_bool=(
10+ NIX+SET_BUILD_ID
11+ NIX+DONT_SET_RPATH
12+)
13+
14+declare -a role_infixes=()
15+if [ "${NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_BUILD:-}" ]; then
16+ role_infixes+=(_BUILD_)
17+fi
18+if [ "${NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_HOST:-}" ]; then
19+ role_infixes+=(_)
20+fi
21+if [ "${NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_TARGET:-}" ]; then
22+ role_infixes+=(_TARGET_)
23+fi
24+
25+for var in "${var_templates_list[@]}"; do
26+ mangleVarList "$var" "${role_infixes[@]}"
27+done
28+for var in "${var_templates_bool[@]}"; do
29+ mangleVarBool "$var" "${role_infixes[@]}"
30+done
31+
32+if [ -e @out@/nix-support/libc-ldflags ]; then
33+ NIX_@infixSalt@_LDFLAGS+=" $(< @out@/nix-support/libc-ldflags)"
34+fi
35+
36+if [ -e @out@/nix-support/libc-ldflags-before ]; then
37+ NIX_@infixSalt@_LDFLAGS_BEFORE="$(< @out@/nix-support/libc-ldflags-before) $NIX_@infixSalt@_LDFLAGS_BEFORE"
38+fi
39+
40+export NIX_BINTOOLS_WRAPPER_@infixSalt@_FLAGS_SET=1
pkgs/build-support/bintools-wrapper/add-hardening.shnew file+53
@@ -0,0 +1,53 @@
1+hardeningFlags=(relro bindnow)
2+# Intentionally word-split in case 'hardeningEnable' is defined in
3+# Nix. Also, our bootstrap tools version of bash is old enough that
4+# undefined arrays trip `set -u`.
5+if [[ -v hardeningEnable[@] ]]; then
6+ hardeningFlags+=(${hardeningEnable[@]})
7+fi
8+hardeningLDFlags=()
9+
10+declare -A hardeningDisableMap
11+
12+# Intentionally word-split in case 'hardeningDisable' is defined in Nix.
13+for flag in ${hardeningDisable[@]:-IGNORED_KEY} @hardening_unsupported_flags@
14+do
15+ hardeningDisableMap[$flag]=1
16+done
17+
18+if (( "${NIX_DEBUG:-0}" >= 1 )); then
19+ printf 'HARDENING: disabled flags:' >&2
20+ (( "${#hardeningDisableMap[@]}" )) && printf ' %q' "${!hardeningDisableMap[@]}" >&2
21+ echo >&2
22+fi
23+
24+if [[ -z "${hardeningDisableMap[all]:-}" ]]; then
25+ if (( "${NIX_DEBUG:-0}" >= 1 )); then
26+ echo 'HARDENING: Is active (not completely disabled with "all" flag)' >&2;
27+ fi
28+ for flag in "${hardeningFlags[@]}"
29+ do
30+ if [[ -z "${hardeningDisableMap[$flag]:-}" ]]; then
31+ case $flag in
32+ pie)
33+ if [[ ! ("$*" =~ " -shared " || "$*" =~ " -static ") ]]; then
34+ if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling LDFlags -pie >&2; fi
35+ hardeningLDFlags+=('-pie')
36+ fi
37+ ;;
38+ relro)
39+ if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling relro >&2; fi
40+ hardeningLDFlags+=('-z' 'relro')
41+ ;;
42+ bindnow)
43+ if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling bindnow >&2; fi
44+ hardeningLDFlags+=('-z' 'now')
45+ ;;
46+ *)
47+ # Ignore unsupported. Checked in Nix that at least *some*
48+ # tool supports each flag.
49+ ;;
50+ esac
51+ fi
52+ done
53+fi
pkgs/build-support/bintools-wrapper/default.nixnew file+292
@@ -0,0 +1,292 @@
1+# The Nixpkgs CC is not directly usable, since it doesn't know where
2+# the C library and standard header files are. Therefore the compiler
3+# produced by that package cannot be installed directly in a user
4+# environment and used from the command line. So we use a wrapper
5+# script that sets up the right environment variables so that the
6+# compiler and the linker just "work".
7+
8+{ name ? "", stdenvNoCC, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
9+, bintools ? null, libc ? null
10+, coreutils ? null, shell ? stdenvNoCC.shell, gnugrep ? null
11+, extraPackages ? [], extraBuildCommands ? ""
12+, buildPackages ? {}
13+, useMacosReexportHack ? false
14+}:
15+
16+with stdenvNoCC.lib;
17+
18+assert nativeTools -> nativePrefix != "";
19+assert !nativeTools ->
20+ bintools != null && coreutils != null && gnugrep != null;
21+assert !(nativeLibc && noLibc);
22+assert (noLibc || nativeLibc) == (libc == null);
23+
24+let
25+ stdenv = stdenvNoCC;
26+ inherit (stdenv) hostPlatform targetPlatform;
27+
28+ # Prefix for binaries. Customarily ends with a dash separator.
29+ #
30+ # TODO(@Ericson2314) Make unconditional, or optional but always true by
31+ # default.
32+ targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform)
33+ (targetPlatform.config + "-");
34+
35+ bintoolsVersion = (builtins.parseDrvName bintools.name).version;
36+ bintoolsName = (builtins.parseDrvName bintools.name).name;
37+
38+ libc_bin = if libc == null then null else getBin libc;
39+ libc_dev = if libc == null then null else getDev libc;
40+ libc_lib = if libc == null then null else getLib libc;
41+ bintools_bin = if nativeTools then "" else getBin bintools;
42+ # The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
43+ coreutils_bin = if nativeTools then "" else getBin coreutils;
44+
45+ dashlessTarget = stdenv.lib.replaceStrings ["-"] ["_"] targetPlatform.config;
46+
47+ # See description in cc-wrapper.
48+ infixSalt = dashlessTarget;
49+
50+ # The dynamic linker has different names on different platforms. This is a
51+ # shell glob that ought to match it.
52+ dynamicLinker =
53+ /**/ if libc == null then null
54+ else if targetPlatform.system == "i686-linux" then "${libc_lib}/lib/ld-linux.so.2"
55+ else if targetPlatform.system == "x86_64-linux" then "${libc_lib}/lib/ld-linux-x86-64.so.2"
56+ # ARM with a wildcard, which can be "" or "-armhf".
57+ else if (with targetPlatform; isArm && isLinux) then "${libc_lib}/lib/ld-linux*.so.3"
58+ else if targetPlatform.system == "aarch64-linux" then "${libc_lib}/lib/ld-linux-aarch64.so.1"
59+ else if targetPlatform.system == "powerpc-linux" then "${libc_lib}/lib/ld.so.1"
60+ else if targetPlatform.system == "mips64el-linux" then "${libc_lib}/lib/ld.so.1"
61+ else if targetPlatform.isDarwin then "/usr/lib/dyld"
62+ else if stdenv.lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1"
63+ else null;
64+
65+ expand-response-params =
66+ if buildPackages.stdenv.cc or null != null && buildPackages.stdenv.cc != "/dev/null"
67+ then import ../expand-response-params { inherit (buildPackages) stdenv; }
68+ else "";
69+
70+in
71+
72+stdenv.mkDerivation {
73+ name = targetPrefix
74+ + (if name != "" then name else "${bintoolsName}-wrapper")
75+ + (stdenv.lib.optionalString (bintools != null && bintoolsVersion != "") "-${bintoolsVersion}");
76+
77+ preferLocalBuild = true;
78+
79+ inherit bintools_bin libc_bin libc_dev libc_lib coreutils_bin;
80+ shell = getBin shell + shell.shellPath or "";
81+ gnugrep_bin = if nativeTools then "" else gnugrep;
82+
83+ inherit targetPrefix infixSalt;
84+
85+ outputs = [ "out" "info" "man" ];
86+
87+ passthru = {
88+ inherit bintools libc nativeTools nativeLibc nativePrefix;
89+
90+ emacsBufferSetup = pkgs: ''
91+ ; We should handle propagation here too
92+ (mapc
93+ (lambda (arg)
94+ (when (file-directory-p (concat arg "/lib"))
95+ (setenv "NIX_${infixSalt}_LDFLAGS" (concat (getenv "NIX_${infixSalt}_LDFLAGS") " -L" arg "/lib")))
96+ (when (file-directory-p (concat arg "/lib64"))
97+ (setenv "NIX_${infixSalt}_LDFLAGS" (concat (getenv "NIX_${infixSalt}_LDFLAGS") " -L" arg "/lib64"))))
98+ '(${concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)}))
99+ '';
100+ };
101+
102+ dontBuild = true;
103+ dontConfigure = true;
104+
105+ unpackPhase = ''
106+ src=$PWD
107+ '';
108+
109+ installPhase =
110+ ''
111+ set -u
112+
113+ mkdir -p $out/bin {$out,$info,$man}/nix-support
114+
115+ wrap() {
116+ local dst="$1"
117+ local wrapper="$2"
118+ export prog="$3"
119+ set +u
120+ substituteAll "$wrapper" "$out/bin/$dst"
121+ set -u
122+ chmod +x "$out/bin/$dst"
123+ }
124+ ''
125+
126+ + (if nativeTools then ''
127+ echo ${nativePrefix} > $out/nix-support/orig-bintools
128+
129+ ldPath="${nativePrefix}/bin"
130+ '' else ''
131+ echo $bintools_bin > $out/nix-support/orig-bintools
132+
133+ ldPath="${bintools_bin}/bin"
134+ ''
135+
136+ + optionalString (targetPlatform.isSunOS && nativePrefix != "") ''
137+ # Solaris needs an additional ld wrapper.
138+ ldPath="${nativePrefix}/bin"
139+ exec="$ldPath/${targetPrefix}ld"
140+ wrap ld-solaris ${./ld-solaris-wrapper.sh}
141+ '')
142+
143+ + ''
144+ # Create a symlink to as (the assembler).
145+ if [ -e $ldPath/${targetPrefix}as ]; then
146+ ln -s $ldPath/${targetPrefix}as $out/bin/${targetPrefix}as
147+ fi
148+
149+ '' + (if !useMacosReexportHack then ''
150+ wrap ${targetPrefix}ld ${./ld-wrapper.sh} ''${ld:-$ldPath/${targetPrefix}ld}
151+ '' else ''
152+ ldInner="${targetPrefix}ld-reexport-delegate"
153+ wrap "$ldInner" ${./macos-sierra-reexport-hack.bash} ''${ld:-$ldPath/${targetPrefix}ld}
154+ wrap "${targetPrefix}ld" ${./ld-wrapper.sh} "$out/bin/$ldInner"
155+ unset ldInner
156+ '') + ''
157+
158+ for variant in ld.gold ld.bfd ld.lld; do
159+ local underlying=$ldPath/${targetPrefix}$variant
160+ [[ -e "$underlying" ]] || continue
161+ wrap ${targetPrefix}$variant ${./ld-wrapper.sh} $underlying
162+ done
163+
164+ set +u
165+ '';
166+
167+ propagatedBuildInputs = extraPackages;
168+
169+ setupHook = ./setup-hook.sh;
170+
171+ postFixup =
172+ ''
173+ set -u
174+ ''
175+
176+ + optionalString (libc != null) (''
177+ ##
178+ ## General libc support
179+ ##
180+
181+ echo "-L${libc_lib}/lib" > $out/nix-support/libc-ldflags
182+
183+ echo "${libc_lib}" > $out/nix-support/orig-libc
184+ echo "${libc_dev}" > $out/nix-support/orig-libc-dev
185+
186+ ##
187+ ## Dynamic linker support
188+ ##
189+
190+ if [[ -z ''${dynamicLinker+x} ]]; then
191+ echo "Don't know the name of the dynamic linker for platform '${targetPlatform.config}', so guessing instead." >&2
192+ local dynamicLinker="${libc_lib}/lib/ld*.so.?"
193+ fi
194+
195+ # Expand globs to fill array of options
196+ dynamicLinker=($dynamicLinker)
197+
198+ case ''${#dynamicLinker[@]} in
199+ 0) echo "No dynamic linker found for platform '${targetPlatform.config}'." >&2;;
200+ 1) echo "Using dynamic linker: '$dynamicLinker'" >&2;;
201+ *) echo "Multiple dynamic linkers found for platform '${targetPlatform.config}'." >&2;;
202+ esac
203+
204+ if [ -n "''${dynamicLinker:-}" ]; then
205+ echo $dynamicLinker > $out/nix-support/dynamic-linker
206+
207+ '' + (if targetPlatform.isDarwin then ''
208+ printf "export LD_DYLD_PATH=%q\n" "$dynamicLinker" >> $out/nix-support/setup-hook
209+ '' else ''
210+ if [ -e ${libc_lib}/lib/32/ld-linux.so.2 ]; then
211+ echo ${libc_lib}/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
212+ fi
213+
214+ local ldflagsBefore=(-dynamic-linker "$dynamicLinker")
215+ '') + ''
216+ fi
217+
218+ # The dynamic linker is passed in `ldflagsBefore' to allow
219+ # explicit overrides of the dynamic linker by callers to ld
220+ # (the *last* value counts, so ours should come first).
221+ printWords "''${ldflagsBefore[@]}" > $out/nix-support/libc-ldflags-before
222+ '')
223+
224+ + optionalString (!nativeTools) ''
225+
226+ ##
227+ ## User env support
228+ ##
229+
230+ # Propagate the underling unwrapped bintools so that if you
231+ # install the wrapper, you get tools like objdump, the manpages,
232+ # etc. as well (same for any binaries of libc).
233+ printWords ${bintools_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages
234+
235+ ##
236+ ## Man page and info support
237+ ##
238+
239+ printWords ${bintools.info or ""} \
240+ >> $info/nix-support/propagated-build-inputs
241+ printWords ${bintools.man or ""} \
242+ >> $man/nix-support/propagated-build-inputs
243+ ''
244+
245+ + ''
246+
247+ ##
248+ ## Hardening support
249+ ##
250+
251+ # some linkers on some platforms don't support specific -z flags
252+ export hardening_unsupported_flags=""
253+ if [[ "$($ldPath/${targetPrefix}ld -z now 2>&1 || true)" =~ un(recognized|known)\ option ]]; then
254+ hardening_unsupported_flags+=" bindnow"
255+ fi
256+ if [[ "$($ldPath/${targetPrefix}ld -z relro 2>&1 || true)" =~ un(recognized|known)\ option ]]; then
257+ hardening_unsupported_flags+=" relro"
258+ fi
259+ ''
260+
261+ + optionalString hostPlatform.isCygwin ''
262+ hardening_unsupported_flags+=" pic"
263+ ''
264+
265+ + ''
266+ set +u
267+ substituteAll ${./add-flags.sh} $out/nix-support/add-flags.sh
268+ substituteAll ${./add-hardening.sh} $out/nix-support/add-hardening.sh
269+ substituteAll ${../cc-wrapper/utils.sh} $out/nix-support/utils.sh
270+
271+ ##
272+ ## Extra custom steps
273+ ##
274+
275+ ''
276+ + extraBuildCommands;
277+
278+ inherit dynamicLinker expand-response-params;
279+
280+ # for substitution in utils.sh
281+ expandResponseParams = "${expand-response-params}/bin/expand-response-params";
282+
283+ meta =
284+ let bintools_ = if bintools != null then bintools else {}; in
285+ (if bintools_ ? meta then removeAttrs bintools.meta ["priority"] else {}) //
286+ { description =
287+ stdenv.lib.attrByPath ["meta" "description"] "System binary utilities" bintools_
288+ + " (wrapper script)";
289+ } // optionalAttrs useMacosReexportHack {
290+ platforms = stdenv.lib.platforms.darwin;
291+ };
292+}
pkgs/build-support/cc-wrapper/ld-solaris-wrapper.sh → pkgs/build-support/bintools-wrapper/ld-solaris-wrapper.shrenamed

Only the mode changed.

pkgs/build-support/cc-wrapper/ld-wrapper.sh → pkgs/build-support/bintools-wrapper/ld-wrapper.shrenamed+3−3
@@ -14,12 +14,12 @@ if [ -n "@coreutils_bin@" ]; then
1414 PATH="@coreutils_bin@/bin"
1515fi
1616
17−if [ -z "${NIX_CC_WRAPPER_@infixSalt@_FLAGS_SET:-}" ]; then
17+source @out@/nix-support/utils.sh
18+
19+if [ -z "${NIX_BINTOOLS_WRAPPER_@infixSalt@_FLAGS_SET:-}" ]; then
1820 source @out@/nix-support/add-flags.sh
1921fi
2022
21−source @out@/nix-support/utils.sh
22−
2323
2424# Optionally filter out paths not refering to the store.
2525expandResponseParams "$@"
pkgs/build-support/cc-wrapper/macos-sierra-reexport-hack.bash → pkgs/build-support/bintools-wrapper/macos-sierra-reexport-hack.bashrenamed+3−1
@@ -81,8 +81,10 @@ else
8181
8282 symbolBloatObject=$outputNameLibless-symbol-hack.o
8383 if [[ ! -e $symbolBloatObject ]]; then
84+ # `-Q` means use GNU Assembler rather than Clang, avoiding an awkward
85+ # dependency cycle.
8486 printf '.private_extern _______child_hack_foo\nchild_hack_foo:\n' \
85− | @targetPrefix@as -- -o $symbolBloatObject
87+ | @targetPrefix@as -Q -- -o $symbolBloatObject
8688 fi
8789
8890 # first half of libs
pkgs/build-support/bintools-wrapper/setup-hook.shnew file+67
@@ -0,0 +1,67 @@
1+# Binutils Wrapper hygiene
2+#
3+# See comments in cc-wrapper's setup hook. This works exactly the same way.
4+
5+bintoolsWrapper_addLDVars () {
6+ case $depOffset in
7+ -1) local role='BUILD_' ;;
8+ 0) local role='' ;;
9+ 1) local role='TARGET_' ;;
10+ *) echo "bintools-wrapper: Error: Cannot be used with $depOffset-offset deps, " >2;
11+ return 1 ;;
12+ esac
13+
14+ if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then
15+ export NIX_${role}LDFLAGS+=" -L$1/lib64"
16+ fi
17+
18+ if [[ -d "$1/lib" ]]; then
19+ export NIX_${role}LDFLAGS+=" -L$1/lib"
20+ fi
21+}
22+
23+if [ -n "${crossConfig:-}" ]; then
24+ export NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_BUILD=1
25+ role_pre='BUILD_'
26+ role_post='_FOR_BUILD'
27+else
28+ export NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_HOST=1
29+ role_pre=""
30+ role_post=''
31+fi
32+
33+envHooks+=(bintoolsWrapper_addLDVars)
34+
35+# shellcheck disable=SC2157
36+if [ -n "@bintools_bin@" ]; then
37+ addToSearchPath _PATH @bintools_bin@/bin
38+fi
39+
40+# shellcheck disable=SC2157
41+if [ -n "@libc_bin@" ]; then
42+ addToSearchPath _PATH @libc_bin@/bin
43+fi
44+
45+# shellcheck disable=SC2157
46+if [ -n "@coreutils_bin@" ]; then
47+ addToSearchPath _PATH @coreutils_bin@/bin
48+fi
49+
50+# Export tool environment variables so various build systems use the right ones.
51+
52+export NIX_${role_pre}BINTOOLS=@out@
53+
54+for cmd in \
55+ ar as ld nm objcopy objdump readelf ranlib strip strings size windres
56+do
57+ if
58+ PATH=$_PATH type -p "@targetPrefix@${cmd}" > /dev/null
59+ then
60+ upper_case="$(echo "$cmd" | tr "[:lower:]" "[:upper:]")"
61+ export "${role_pre}${upper_case}=@targetPrefix@${cmd}";
62+ export "${upper_case}${role_post}=@targetPrefix@${cmd}";
63+ fi
64+done
65+
66+# No local scope in sourced file
67+unset -v role_pre role_post cmd upper_case
pkgs/build-support/cc-wrapper/add-flags.sh+8−27
@@ -4,19 +4,14 @@
44# that case, it is cheaper/better to not repeat this step and let the forked
55# wrapped binary just inherit the work of the forker's wrapper script.
66
7−var_templates=(
7+var_templates_list=(
88 NIX+CFLAGS_COMPILE
99 NIX+CFLAGS_LINK
1010 NIX+CXXSTDLIB_COMPILE
1111 NIX+CXXSTDLIB_LINK
1212 NIX+GNATFLAGS_COMPILE
13− NIX+IGNORE_LD_THROUGH_GCC
14− NIX+LDFLAGS
15− NIX+LDFLAGS_BEFORE
16− NIX+LDFLAGS_AFTER
17−
18− NIX+SET_BUILD_ID
19− NIX+DONT_SET_RPATH
13+)
14+var_templates_bool=(
2015 NIX+ENFORCE_NO_NATIVE
2116)
2217
@@ -35,17 +30,11 @@ fi
3530
3631# We need to mangle names for hygiene, but also take parameters/overrides
3732# from the environment.
38−for var in "${var_templates[@]}"; do
39− outputVar="${var/+/_@infixSalt@_}"
40− export ${outputVar}+=''
41− # For each role we serve, we accumulate the input parameters into our own
42− # cc-wrapper-derivation-specific environment variables.
43− for infix in "${role_infixes[@]}"; do
44− inputVar="${var/+/${infix}}"
45− if [ -v "$inputVar" ]; then
46− export ${outputVar}+="${!outputVar:+ }${!inputVar}"
47− fi
48− done
33+for var in "${var_templates_list[@]}"; do
34+ mangleVarList "$var" "${role_infixes[@]}"
35+done
36+for var in "${var_templates_bool[@]}"; do
37+ mangleVarBool "$var" "${role_infixes[@]}"
4938done
5039
5140# `-B@out@/bin' forces cc to use ld-wrapper.sh when calling ld.
@@ -66,17 +55,9 @@ if [ -e @out@/nix-support/gnat-cflags ]; then
6655 NIX_@infixSalt@_GNATFLAGS_COMPILE="$(< @out@/nix-support/gnat-cflags) $NIX_@infixSalt@_GNATFLAGS_COMPILE"
6756fi
6857
69−if [ -e @out@/nix-support/libc-ldflags ]; then
70− NIX_@infixSalt@_LDFLAGS+=" $(< @out@/nix-support/libc-ldflags)"
71−fi
72−
7358if [ -e @out@/nix-support/cc-ldflags ]; then
7459 NIX_@infixSalt@_LDFLAGS+=" $(< @out@/nix-support/cc-ldflags)"
7560fi
7661
77−if [ -e @out@/nix-support/libc-ldflags-before ]; then
78− NIX_@infixSalt@_LDFLAGS_BEFORE="$(< @out@/nix-support/libc-ldflags-before) $NIX_@infixSalt@_LDFLAGS_BEFORE"
79−fi
80−
8162# That way forked processes will not extend these environment variables again.
8263export NIX_CC_WRAPPER_@infixSalt@_FLAGS_SET=1
pkgs/build-support/cc-wrapper/add-hardening.sh−10
@@ -6,7 +6,6 @@ if [[ -v hardeningEnable[@] ]]; then
66 hardeningFlags+=(${hardeningEnable[@]})
77fi
88hardeningCFlags=()
9−hardeningLDFlags=()
109
1110declare -A hardeningDisableMap
1211
@@ -44,7 +43,6 @@ if [[ -z "${hardeningDisableMap[all]:-}" ]]; then
4443 if [[ ! ("$*" =~ " -shared " || "$*" =~ " -static ") ]]; then
4544 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling LDFlags -pie >&2; fi
4645 hardeningCFlags+=('-pie')
47− hardeningLDFlags+=('-pie')
4846 fi
4947 ;;
5048 pic)
@@ -59,14 +57,6 @@ if [[ -z "${hardeningDisableMap[all]:-}" ]]; then
5957 if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling format >&2; fi
6058 hardeningCFlags+=('-Wformat' '-Wformat-security' '-Werror=format-security')
6159 ;;
62− relro)
63− if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling relro >&2; fi
64− hardeningLDFlags+=('-z' 'relro')
65− ;;
66− bindnow)
67− if (( "${NIX_DEBUG:-0}" >= 1 )); then echo HARDENING: enabling bindnow >&2; fi
68− hardeningLDFlags+=('-z' 'now')
69− ;;
7060 *)
7161 # Ignore unsupported. Checked in Nix that at least *some*
7262 # tool supports each flag.
pkgs/build-support/cc-wrapper/cc-wrapper.sh+10−3
@@ -15,12 +15,18 @@ if [[ -n "@coreutils_bin@" && -n "@gnugrep_bin@" ]]; then
1515 PATH="@coreutils_bin@/bin:@gnugrep_bin@/bin"
1616fi
1717
18+source @out@/nix-support/utils.sh
19+
20+# Flirting with a layer violation here.
21+if [ -z "${NIX_BINTOOLS_WRAPPER_@infixSalt@_FLAGS_SET:-}" ]; then
22+ source @bintools@/nix-support/add-flags.sh
23+fi
24+
25+# Put this one second so libc ldflags take priority.
1826if [ -z "${NIX_CC_WRAPPER_@infixSalt@_FLAGS_SET:-}" ]; then
1927 source @out@/nix-support/add-flags.sh
2028fi
2129
22−source @out@/nix-support/utils.sh
23−
2430
2531# Parse command line options and set several variables.
2632# For instance, figure out if linker flags should be passed.
@@ -59,7 +65,8 @@ while (( "$n" < "$nParams" )); do
5965 cppInclude=0
6066 elif [ "$p" = -nostdinc++ ]; then
6167 cppInclude=0
62− elif [ "${p:0:1}" != - ]; then
68+ elif [[ "$p" != -?* ]]; then
69+ # A dash alone signifies standard input; it is not a flag
6370 nonFlagArgs=1
6471 fi
6572 n+=1
pkgs/build-support/cc-wrapper/default.nix+41−116
@@ -6,18 +6,17 @@
66# compiler and the linker just "work".
77
88{ name ? "", stdenvNoCC, nativeTools, noLibc ? false, nativeLibc, nativePrefix ? ""
9−, cc ? null, libc ? null, binutils ? null, coreutils ? null, shell ? stdenvNoCC.shell
9+, cc ? null, libc ? null, bintools, coreutils ? null, shell ? stdenvNoCC.shell
1010, zlib ? null, extraPackages ? [], extraBuildCommands ? ""
1111, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
1212, buildPackages ? {}
13−, useMacosReexportHack ? false
1413}:
1514
1615with stdenvNoCC.lib;
1716
1817assert nativeTools -> nativePrefix != "";
1918assert !nativeTools ->
20− cc != null && binutils != null && coreutils != null && gnugrep != null;
19+ cc != null && coreutils != null && gnugrep != null;
2120assert !(nativeLibc && noLibc);
2221assert (noLibc || nativeLibc) == (libc == null);
2322
@@ -42,7 +41,6 @@ let
4241 libc_dev = if libc == null then null else getDev libc;
4342 libc_lib = if libc == null then null else getLib libc;
4443 cc_solib = getLib cc;
45− binutils_bin = if nativeTools then "" else getBin binutils;
4644 # The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
4745 coreutils_bin = if nativeTools then "" else getBin coreutils;
4846
@@ -58,21 +56,6 @@ let
5856 # unstable implementation detail, however.
5957 infixSalt = dashlessTarget;
6058
61− # The dynamic linker has different names on different platforms. This is a
62− # shell glob that ought to match it.
63− dynamicLinker =
64− /**/ if libc == null then null
65− else if targetPlatform.system == "i686-linux" then "${libc_lib}/lib/ld-linux.so.2"
66− else if targetPlatform.system == "x86_64-linux" then "${libc_lib}/lib/ld-linux-x86-64.so.2"
67− # ARM with a wildcard, which can be "" or "-armhf".
68− else if (with targetPlatform; isArm && isLinux) then "${libc_lib}/lib/ld-linux*.so.3"
69− else if targetPlatform.system == "aarch64-linux" then "${libc_lib}/lib/ld-linux-aarch64.so.1"
70− else if targetPlatform.system == "powerpc-linux" then "${libc_lib}/lib/ld.so.1"
71− else if targetPlatform.system == "mips64el-linux" then "${libc_lib}/lib/ld.so.1"
72− else if targetPlatform.isDarwin then "/usr/lib/dyld"
73− else if stdenv.lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1"
74− else null;
75−
7659 expand-response-params =
7760 if buildPackages.stdenv.cc or null != null && buildPackages.stdenv.cc != "/dev/null"
7861 then import ../expand-response-params { inherit (buildPackages) stdenv; }
@@ -80,6 +63,14 @@ let
8063
8164in
8265
66+# Ensure bintools matches
67+assert libc_bin == bintools.libc_bin;
68+assert libc_dev == bintools.libc_dev;
69+assert libc_lib == bintools.libc_lib;
70+assert nativeTools == bintools.nativeTools;
71+assert nativeLibc == bintools.nativeLibc;
72+assert nativePrefix == bintools.nativePrefix;
73+
8374stdenv.mkDerivation {
8475 name = targetPrefix
8576 + (if name != "" then name else "${ccName}-wrapper")
@@ -87,8 +78,8 @@ stdenv.mkDerivation {
8778
8879 preferLocalBuild = true;
8980
90− inherit cc libc_bin libc_dev libc_lib binutils_bin coreutils_bin;
91− shell = getBin shell + shell.shellPath or "";
81+ inherit cc libc_bin libc_dev libc_lib bintools coreutils_bin;
82+ shell = getBin shell + stdenv.lib.optionalString (stdenv ? shellPath) stdenv.shellPath;
9283 gnugrep_bin = if nativeTools then "" else gnugrep;
9384
9485 inherit targetPrefix infixSalt;
@@ -98,20 +89,18 @@ stdenv.mkDerivation {
9889 passthru = {
9990 # "cc" is the generic name for a C compiler, but there is no one for package
10091 # providing the linker and related tools. The two we use now are GNU
101− # Binutils, and Apple's "cctools"; "binutils" as an attempt to find an
92+ # Binutils, and Apple's "cctools"; "bintools" as an attempt to find an
10293 # unused middle-ground name that evokes both.
103− bintools = binutils_bin;
94+ inherit bintools;
10495 inherit libc nativeTools nativeLibc nativePrefix isGNU isClang default_cxx_stdlib_compile;
10596
10697 emacsBufferSetup = pkgs: ''
10798 ; We should handle propagation here too
108− (mapc (lambda (arg)
109− (when (file-directory-p (concat arg "/include"))
110− (setenv "NIX_${infixSalt}_CFLAGS_COMPILE" (concat (getenv "NIX_${infixSalt}_CFLAGS_COMPILE") " -isystem " arg "/include")))
111− (when (file-directory-p (concat arg "/lib"))
112− (setenv "NIX_${infixSalt}_LDFLAGS" (concat (getenv "NIX_${infixSalt}_LDFLAGS") " -L" arg "/lib")))
113− (when (file-directory-p (concat arg "/lib64"))
114− (setenv "NIX_${infixSalt}_LDFLAGS" (concat (getenv "NIX_${infixSalt}_LDFLAGS") " -L" arg "/lib64")))) '(${concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)}))
99+ (mapc
100+ (lambda (arg)
101+ (when (file-directory-p (concat arg "/include"))
102+ (setenv "NIX_${infixSalt}_CFLAGS_COMPILE" (concat (getenv "NIX_${infixSalt}_CFLAGS_COMPILE") " -isystem " arg "/include"))))
103+ '(${concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)}))
115104 '';
116105 };
117106
@@ -141,45 +130,18 @@ stdenv.mkDerivation {
141130 echo ${if targetPlatform.isDarwin then cc else nativePrefix} > $out/nix-support/orig-cc
142131
143132 ccPath="${if targetPlatform.isDarwin then cc else nativePrefix}/bin"
144− ldPath="${nativePrefix}/bin"
145133 '' else ''
146134 echo $cc > $out/nix-support/orig-cc
147135
148136 ccPath="${cc}/bin"
149− ldPath="${binutils_bin}/bin"
150− ''
151−
152− + optionalString (targetPlatform.isSunOS && nativePrefix != "") ''
153− # Solaris needs an additional ld wrapper.
154− ldPath="${nativePrefix}/bin"
155− exec="$ldPath/${targetPrefix}ld"
156− wrap ld-solaris ${./ld-solaris-wrapper.sh}
157137 '')
158138
159139 + ''
160− # Create a symlink to as (the assembler). This is useful when a
161− # cc-wrapper is installed in a user environment, as it ensures that
162− # the right assembler is called.
163− if [ -e $ldPath/${targetPrefix}as ]; then
164− ln -s $ldPath/${targetPrefix}as $out/bin/${targetPrefix}as
165− fi
166−
167− '' + (if !useMacosReexportHack then ''
168− wrap ${targetPrefix}ld ${./ld-wrapper.sh} ''${ld:-$ldPath/${targetPrefix}ld}
169− '' else ''
170− ldInner="${targetPrefix}ld-reexport-delegate"
171− wrap "$ldInner" ${./macos-sierra-reexport-hack.bash} ''${ld:-$ldPath/${targetPrefix}ld}
172− wrap "${targetPrefix}ld" ${./ld-wrapper.sh} "$out/bin/$ldInner"
173− unset ldInner
174− '') + ''
175−
176− if [ -e ${binutils_bin}/bin/${targetPrefix}ld.gold ]; then
177− wrap ${targetPrefix}ld.gold ${./ld-wrapper.sh} ${binutils_bin}/bin/${targetPrefix}ld.gold
178− fi
179−
180− if [ -e ${binutils_bin}/bin/ld.bfd ]; then
181− wrap ${targetPrefix}ld.bfd ${./ld-wrapper.sh} ${binutils_bin}/bin/${targetPrefix}ld.bfd
182− fi
140+ # Create symlinks to everything in the bintools wrapper.
141+ for bbin in $bintools/bin/*; do
142+ mkdir -p "$out/bin"
143+ ln -s "$bbin" "$out/bin/$(basename $bbin)"
144+ done
183145
184146 # We export environment variables pointing to the wrapped nonstandard
185147 # cmds, lest some lousy configure script use those to guess compiler
@@ -239,16 +201,28 @@ stdenv.mkDerivation {
239201 ln -s $ccPath/${targetPrefix}ghdl $out/bin/${targetPrefix}ghdl
240202 '';
241203
242− propagatedBuildInputs = extraPackages;
204+ propagatedBuildInputs = [ bintools ] ++ extraPackages;
243205
244206 setupHook = ./setup-hook.sh;
245207
246208 postFixup =
247209 ''
248210 set -u
211+
212+ # Backwards compatability for packages expecting this file, e.g. with
213+ # `$NIX_CC/nix-support/dynamic-linker`.
214+ #
215+ # TODO(@Ericson2314): Remove this after stable release and force
216+ # everyone to refer to bintools-wrapper directly.
217+ if [[ -f "$bintools/nix-support/dynamic-linker" ]]; then
218+ ln -s "$bintools/nix-support/dynamic-linker" "$out/nix-support"
219+ fi
220+ if [[ -f "$bintools/nix-support/dynamic-linker-m32" ]]; then
221+ ln -s "$bintools/nix-support/dynamic-linker-m32" "$out/nix-support"
222+ fi
249223 ''
250224
251− + optionalString (libc != null) (''
225+ + optionalString (libc != null) ''
252226 ##
253227 ## General libc support
254228 ##
@@ -264,50 +238,11 @@ stdenv.mkDerivation {
264238 # compile, because it uses "#include_next <limits.h>" to find the
265239 # limits.h file in ../includes-fixed. To remedy the problem,
266240 # another -idirafter is necessary to add that directory again.
267− echo "-B${libc_lib}/lib/ -idirafter ${libc_dev}/include -idirafter ${cc}/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
268−
269− echo "-L${libc_lib}/lib" > $out/nix-support/libc-ldflags
241+ echo "-B${libc_lib}/lib/ -idirafter ${libc_dev}/include ${optionalString isGNU "-idirafter ${cc}/lib/gcc/*/*/include-fixed"}" > $out/nix-support/libc-cflags
270242
271243 echo "${libc_lib}" > $out/nix-support/orig-libc
272244 echo "${libc_dev}" > $out/nix-support/orig-libc-dev
273−
274− ##
275− ## Dynamic linker support
276− ##
277−
278− if [[ -z ''${dynamicLinker+x} ]]; then
279− echo "Don't know the name of the dynamic linker for platform '${targetPlatform.config}', so guessing instead." >&2
280− local dynamicLinker="${libc_lib}/lib/ld*.so.?"
281− fi
282−
283− # Expand globs to fill array of options
284− dynamicLinker=($dynamicLinker)
285−
286− case ''${#dynamicLinker[@]} in
287− 0) echo "No dynamic linker found for platform '${targetPlatform.config}'." >&2;;
288− 1) echo "Using dynamic linker: '$dynamicLinker'" >&2;;
289− *) echo "Multiple dynamic linkers found for platform '${targetPlatform.config}'." >&2;;
290− esac
291−
292− if [ -n "''${dynamicLinker:-}" ]; then
293− echo $dynamicLinker > $out/nix-support/dynamic-linker
294−
295− '' + (if targetPlatform.isDarwin then ''
296− printf "export LD_DYLD_PATH=%q\n" "$dynamicLinker" >> $out/nix-support/setup-hook
297− '' else ''
298− if [ -e ${libc_lib}/lib/32/ld-linux.so.2 ]; then
299− echo ${libc_lib}/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
300− fi
301−
302− local ldflagsBefore=(-dynamic-linker "$dynamicLinker")
303− '') + ''
304− fi
305−
306− # The dynamic linker is passed in `ldflagsBefore' to allow
307− # explicit overrides of the dynamic linker by callers to gcc/ld
308− # (the *last* value counts, so ours should come first).
309− printWords "''${ldflagsBefore[@]}" > $out/nix-support/libc-ldflags-before
310− '')
245+ ''
311246
312247 + optionalString (!nativeTools) ''
313248
@@ -348,7 +283,6 @@ stdenv.mkDerivation {
348283 # Propagate the wrapped cc so that if you install the wrapper,
349284 # you get tools like gcov, the manpages, etc. as well (including
350285 # for binutils and Glibc).
351− printWords ${cc} ${binutils_bin} ${if libc == null then "" else libc_bin} > $out/nix-support/propagated-user-env-packages
352286 printWords ${cc.man or ""} > $man/nix-support/propagated-user-env-packages
353287 ''
354288
@@ -358,14 +292,7 @@ stdenv.mkDerivation {
358292 ## Hardening support
359293 ##
360294
361− # some linkers on some platforms don't support specific -z flags
362295 export hardening_unsupported_flags=""
363− if [[ "$($ldPath/${targetPrefix}ld -z now 2>&1 || true)" =~ un(recognized|known)\ option ]]; then
364− hardening_unsupported_flags+=" bindnow"
365− fi
366− if [[ "$($ldPath/${targetPrefix}ld -z relro 2>&1 || true)" =~ un(recognized|known)\ option ]]; then
367− hardening_unsupported_flags+=" relro"
368− fi
369296 ''
370297
371298 + optionalString hostPlatform.isCygwin ''
@@ -384,7 +311,7 @@ stdenv.mkDerivation {
384311 ''
385312 + extraBuildCommands;
386313
387− inherit dynamicLinker expand-response-params;
314+ inherit expand-response-params;
388315
389316 # for substitution in utils.sh
390317 expandResponseParams = "${expand-response-params}/bin/expand-response-params";
@@ -395,7 +322,5 @@ stdenv.mkDerivation {
395322 { description =
396323 stdenv.lib.attrByPath ["meta" "description"] "System C compiler" cc_
397324 + " (wrapper script)";
398− } // optionalAttrs useMacosReexportHack {
399− platforms = stdenv.lib.platforms.darwin;
400325 };
401326}
pkgs/build-support/cc-wrapper/gnat-wrapper.sh+2−6
@@ -17,12 +17,12 @@ if [ -n "@coreutils_bin@" ]; then
1717 PATH="@coreutils_bin@/bin"
1818fi
1919
20+source @out@/nix-support/utils.sh
21+
2022if [ -z "${NIX_@infixSalt@_GNAT_WRAPPER_FLAGS_SET:-}" ]; then
2123 source @out@/nix-support/add-flags.sh
2224fi
2325
24−source @out@/nix-support/utils.sh
25−
2626
2727# Figure out if linker flags should be passed. GCC prints annoying
2828# warnings when they are not needed.
@@ -36,10 +36,6 @@ for i in "$@"; do
3636 dontLink=1
3737 elif [ "${i:0:1}" != - ]; then
3838 nonFlagArgs=1
39− elif [ "$i" = -m32 ]; then
40− if [ -e @out@/nix-support/dynamic-linker-m32 ]; then
41− NIX_@infixSalt@_LDFLAGS+=" -dynamic-linker $(< @out@/nix-support/dynamic-linker-m32)"
42− fi
4339 fi
4440done
4541
pkgs/build-support/cc-wrapper/setup-hook.sh+1−26
@@ -74,14 +74,6 @@ ccWrapper_addCVars () {
7474 export NIX_${role}CFLAGS_COMPILE+=" ${ccIncludeFlag:--isystem} $1/include"
7575 fi
7676
77− if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then
78− export NIX_${role}LDFLAGS+=" -L$1/lib64"
79− fi
80−
81− if [[ -d "$1/lib" ]]; then
82− export NIX_${role}LDFLAGS+=" -L$1/lib"
83− fi
84−
8577 if [[ -d "$1/Library/Frameworks" ]]; then
8678 export NIX_${role}CFLAGS_COMPILE+=" -F$1/Library/Frameworks"
8779 fi
@@ -118,11 +110,6 @@ if [ -n "@cc@" ]; then
118110 addToSearchPath _PATH @cc@/bin
119111fi
120112
121−# shellcheck disable=SC2157
122−if [ -n "@binutils_bin@" ]; then
123− addToSearchPath _PATH @binutils_bin@/bin
124−fi
125−
126113# shellcheck disable=SC2157
127114if [ -n "@libc_bin@" ]; then
128115 addToSearchPath _PATH @libc_bin@/bin
@@ -142,17 +129,5 @@ export ${role_pre}CXX=@named_cxx@
142129export CC${role_post}=@named_cc@
143130export CXX${role_post}=@named_cxx@
144131
145−for cmd in \
146− ar as ld nm objcopy objdump readelf ranlib strip strings size windres
147−do
148− if
149− PATH=$_PATH type -p "@targetPrefix@${cmd}" > /dev/null
150− then
151− upper_case="$(echo "$cmd" | tr "[:lower:]" "[:upper:]")"
152− export "${role_pre}${upper_case}=@targetPrefix@${cmd}";
153− export "${upper_case}${role_post}=@targetPrefix@${cmd}";
154− fi
155−done
156−
157132# No local scope in sourced file
158−unset -v role_pre role_post cmd upper_case
133+unset -v role_pre role_post
pkgs/build-support/cc-wrapper/utils.sh+32
@@ -1,3 +1,35 @@
1+mangleVarList() {
2+ local var="$1"
3+ shift
4+ local -a role_infixes=("$@")
5+
6+ local outputVar="${var/+/_@infixSalt@_}"
7+ declare -gx ${outputVar}+=''
8+ # For each role we serve, we accumulate the input parameters into our own
9+ # cc-wrapper-derivation-specific environment variables.
10+ for infix in "${role_infixes[@]}"; do
11+ local inputVar="${var/+/${infix}}"
12+ if [ -v "$inputVar" ]; then
13+ export ${outputVar}+="${!outputVar:+ }${!inputVar}"
14+ fi
15+ done
16+}
17+
18+mangleVarBool() {
19+ local var="$1"
20+ shift
21+ local -a role_infixes=("$@")
22+
23+ local outputVar="${var/+/_@infixSalt@_}"
24+ declare -gxi ${outputVar}+=0
25+ for infix in "${role_infixes[@]}"; do
26+ local inputVar="${var/+/${infix}}"
27+ if [ -v "$inputVar" ]; then
28+ let "${outputVar} |= ${!inputVar}"
29+ fi
30+ done
31+}
32+
133skip () {
234 if (( "${NIX_DEBUG:-0}" >= 1 )); then
335 echo "skipping impure path $1" >&2
pkgs/build-support/setup-hooks/ld-is-cc-hook.shnew file+5
@@ -0,0 +1,5 @@
1+ld-is-cc-hook() {
2+ LD=$CC
3+}
4+
5+preConfigureHooks+=(ld-is-cc-hook)
pkgs/build-support/setup-hooks/separate-debug-info.sh+3−3
@@ -19,7 +19,7 @@ _separateDebugInfo() {
1919 if ! isELF "$i"; then continue; fi
2020
2121 # Extract the Build ID. FIXME: there's probably a cleaner way.
22− local id="$(readelf -n "$i" | sed 's/.*Build ID: \([0-9a-f]*\).*/\1/; t; d')"
22+ local id="$($READELF -n "$i" | sed 's/.*Build ID: \([0-9a-f]*\).*/\1/; t; d')"
2323 if [ "${#id}" != 40 ]; then
2424 echo "could not find build ID of $i, skipping" >&2
2525 continue
@@ -28,8 +28,8 @@ _separateDebugInfo() {
2828 # Extract the debug info.
2929 header "separating debug info from $i (build ID $id)"
3030 mkdir -p "$dst/${id:0:2}"
31− objcopy --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
32− strip --strip-debug "$i"
31+ $OBJCOPY --only-keep-debug "$i" "$dst/${id:0:2}/${id:2}.debug"
32+ $STRIP --strip-debug "$i"
3333
3434 # Also a create a symlink <original-name>.debug.
3535 ln -sfn ".build-id/${id:0:2}/${id:2}.debug" "$dst/../$(basename "$i")"
pkgs/build-support/setup-hooks/strip.sh+1−1
@@ -30,7 +30,7 @@ stripDirs() {
3030
3131 if [ -n "${dirs}" ]; then
3232 header "stripping (with flags $stripFlags) in$dirs"
33− find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} strip $commonStripFlags $stripFlags 2>/dev/null || true
33+ find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} $STRIP $commonStripFlags $stripFlags 2>/dev/null || true
3434 stopNest
3535 fi
3636}
pkgs/build-support/setup-hooks/win-dll-link.sh+1−1
@@ -25,7 +25,7 @@ _linkDLLs() {
2525 linkCount=0
2626 # Iterate over any DLL that we depend on.
2727 local dll
28− for dll in $(objdump -p *.{exe,dll} | sed -n 's/.*DLL Name: \(.*\)/\1/p' | sort -u); do
28+ for dll in $($OBJDUMP -p *.{exe,dll} | sed -n 's/.*DLL Name: \(.*\)/\1/p' | sort -u); do
2929 if [ -e "./$dll" ]; then continue; fi
3030 # Locate the DLL - it should be an *executable* file on $DLLPATH.
3131 local dllPath="$(PATH="$DLLPATH" type -P "$dll")"
pkgs/build-support/trivial-builders.nix+2−2
@@ -95,8 +95,8 @@ rec {
9595
9696
9797 # Make a package that just contains a setup hook with the given contents.
98− makeSetupHook = { deps ? [], substitutions ? {} }: script:
99− runCommand "hook" substitutions
98+ makeSetupHook = { name ? "hook", deps ? [], substitutions ? {} }: script:
99+ runCommand name substitutions
100100 (''
101101 mkdir -p $out/nix-support
102102 cp ${script} $out/nix-support/setup-hook
pkgs/development/compilers/emscripten-fastcomp/default.nix+3−1
@@ -1,4 +1,4 @@
1−{ newScope, stdenv, wrapCC, wrapCCWith, symlinkJoin }:
1+{ newScope, stdenv, binutils-raw, wrapCCWith, symlinkJoin }:
22let
33 callPackage = newScope (self // {inherit stdenv;});
44
@@ -6,6 +6,8 @@ let
66 emscriptenfastcomp-unwrapped = callPackage ./emscripten-fastcomp.nix {};
77 emscriptenfastcomp-wrapped = wrapCCWith {
88 cc = self.emscriptenfastcomp-unwrapped;
9+ # Never want Apple's cctools for WASM target
10+ bintools = binutils-raw;
911 libc = stdenv.cc.libc;
1012 extraBuildCommands = ''
1113 # hardening flags break WASM support
pkgs/development/compilers/gcc/4.5/default.nix+1
@@ -356,6 +356,7 @@ stdenv.mkDerivation ({
356356 dontStrip = true;
357357 };
358358
359+ NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
359360 NIX_BUILD_CC = buildPackages.stdenv.cc;
360361
361362 # Needed for the cross compilation to work
pkgs/development/compilers/gcc/4.8/default.nix+1
@@ -444,6 +444,7 @@ stdenv.mkDerivation ({
444444 buildFlags = "";
445445 };
446446
447+ NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
447448 NIX_BUILD_CC = buildPackages.stdenv.cc;
448449
449450 # Needed for the cross compilation to work
pkgs/development/compilers/gcc/4.9/default.nix+1
@@ -442,6 +442,7 @@ stdenv.mkDerivation ({
442442 buildFlags = "";
443443 };
444444
445+ NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
445446 NIX_BUILD_CC = buildPackages.stdenv.cc;
446447
447448 # Needed for the cross compilation to work
pkgs/development/compilers/gcc/5/default.nix+1
@@ -451,6 +451,7 @@ stdenv.mkDerivation ({
451451 buildFlags = "";
452452 };
453453
454+ NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
454455 NIX_BUILD_CC = buildPackages.stdenv.cc;
455456
456457 # Needed for the cross compilation to work
pkgs/development/compilers/gcc/6/default.nix+1
@@ -452,6 +452,7 @@ stdenv.mkDerivation ({
452452 buildFlags = "";
453453 };
454454
455+ NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
455456 NIX_BUILD_CC = buildPackages.stdenv.cc;
456457
457458 # Needed for the cross compilation to work
pkgs/development/compilers/gcc/7/default.nix+1
@@ -446,6 +446,7 @@ stdenv.mkDerivation ({
446446 buildFlags = "";
447447 };
448448
449+ NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
449450 NIX_BUILD_CC = buildPackages.stdenv.cc;
450451
451452 # Needed for the cross compilation to work
pkgs/development/compilers/gcc/builder.sh+35−20
@@ -12,7 +12,7 @@ mkdir "$NIX_FIXINC_DUMMY"
1212if test "$staticCompiler" = "1"; then
1313 EXTRA_LDFLAGS="-static"
1414else
15− EXTRA_LDFLAGS="-Wl,-rpath,$lib/lib"
15+ EXTRA_LDFLAGS="-Wl,-rpath,${!outputLib}/lib"
1616fi
1717
1818
@@ -28,37 +28,55 @@ if test "$noSysDirs" = "1"; then
2828 EXTRA_BUILD_FLAGS EXTRA_FLAGS EXTRA_TARGET_FLAGS \
2929 EXTRA_BUILD_LDFLAGS EXTRA_TARGET_LDFLAGS
3030
31+ # Extract flags from Bintools Wrappers
32+ for pre in 'BUILD_' ''; do
33+ curBintools="NIX_${pre}BINTOOLS"
34+
35+ declare -a extraLDFlags=()
36+ if [[ -e "${!curBintools}/nix-support/orig-libc" ]]; then
37+ # Figure out what extra flags when linking to pass to the gcc
38+ # compilers being generated to make sure that they use our libc.
39+ extraLDFlags=($(< "${!curBintools}/nix-support/libc-ldflags") $(< "${!curBintools}/nix-support/libc-ldflags-before" || true))
40+
41+ # The path to the Libc binaries such as `crti.o'.
42+ libc_libdir="$(< "${!curBintools}/nix-support/orig-libc")/lib"
43+ else
44+ # Hack: support impure environments.
45+ extraLDFlags=("-L/usr/lib64" "-L/usr/lib")
46+ libc_libdir="/usr/lib"
47+ fi
48+ extraLDFlags=("-L$libc_libdir" "-rpath" "$libc_libdir"
49+ "${extraLDFlags[@]}")
50+ for i in "${extraLDFlags[@]}"; do
51+ declare EXTRA_${pre}LDFLAGS+=" -Wl,$i"
52+ done
53+ done
54+
55+ # Extract flags from CC Wrappers
3156 for pre in 'BUILD_' ''; do
3257 curCC="NIX_${pre}CC"
3358 curFIXINC="NIX_${pre}FIXINC_DUMMY"
3459
35− declare -a extraFlags=() extraLDFlags=()
60+ declare -a extraFlags=()
3661 if [[ -e "${!curCC}/nix-support/orig-libc" ]]; then
37− # Figure out what extra flags to pass to the gcc compilers being
38− # generated to make sure that they use our glibc.
39− extraFlags=($(cat "${!curCC}/nix-support/libc-cflags"))
40− extraLDFlags=($(cat "${!curCC}/nix-support/libc-ldflags") $(cat "${!curCC}/nix-support/libc-ldflags-before" || true))
62+ # Figure out what extra compiling flags to pass to the gcc compilers
63+ # being generated to make sure that they use our libc.
64+ extraFlags=($(< "${!curCC}/nix-support/libc-cflags"))
4165
42− # The path to the Glibc binaries such as `crti.o'.
43− glibc_libdir="$(cat "${!curCC}/nix-support/orig-libc")/lib"
44− glibc_devdir="$(cat "${!curCC}/nix-support/orig-libc-dev")"
66+ # The path to the Libc headers
67+ libc_devdir="$(< "${!curCC}/nix-support/orig-libc-dev")"
4568
4669 # Use *real* header files, otherwise a limits.h is generated that
47− # does not include Glibc's limits.h (notably missing SSIZE_MAX,
70+ # does not include Libc's limits.h (notably missing SSIZE_MAX,
4871 # which breaks the build).
49− declare NIX_${pre}FIXINC_DUMMY="$glibc_devdir/include"
72+ declare NIX_${pre}FIXINC_DUMMY="$libc_devdir/include"
5073 else
5174 # Hack: support impure environments.
5275 extraFlags=("-isystem" "/usr/include")
53− extraLDFlags=("-L/usr/lib64" "-L/usr/lib")
54− glibc_libdir="/usr/lib"
5576 declare NIX_${pre}FIXINC_DUMMY=/usr/include
5677 fi
5778
58− extraFlags=("-I${!curFIXINC}"
59− "${extraFlags[@]}")
60− extraLDFlags=("-L$glibc_libdir" "-rpath" "$glibc_libdir"
61− "${extraLDFlags[@]}")
79+ extraFlags=("-I${!curFIXINC}" "${extraFlags[@]}")
6280
6381 # BOOT_CFLAGS defaults to `-g -O2'; since we override it below, make
6482 # sure to explictly add them so that files compiled with the bootstrap
@@ -72,9 +90,6 @@ if test "$noSysDirs" = "1"; then
7290 fi
7391
7492 declare EXTRA_${pre}FLAGS="${extraFlags[*]}"
75− for i in "${extraLDFlags[@]}"; do
76− declare EXTRA_${pre}LDFLAGS+=" -Wl,$i"
77− done
7893 done
7994
8095 if test -z "${targetConfig-}"; then
pkgs/development/compilers/gcc/snapshot/default.nix+1
@@ -433,6 +433,7 @@ stdenv.mkDerivation ({
433433 buildFlags = "";
434434 };
435435
436+ NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
436437 NIX_BUILD_CC = buildPackages.stdenv.cc;
437438
438439 # Needed for the cross compilation to work
pkgs/development/compilers/llvm/3.7/default.nix+2−2
@@ -30,14 +30,14 @@ let
3030 libstdcxxClang = ccWrapperFun {
3131 cc = self.clang-unwrapped;
3232 /* FIXME is this right? */
33− inherit (stdenv.cc) libc nativeTools nativeLibc;
33+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
3434 extraPackages = [ libstdcxxHook ];
3535 };
3636
3737 libcxxClang = ccWrapperFun {
3838 cc = self.clang-unwrapped;
3939 /* FIXME is this right? */
40− inherit (stdenv.cc) libc nativeTools nativeLibc;
40+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
4141 extraPackages = [ self.libcxx self.libcxxabi ];
4242 };
4343
pkgs/development/compilers/llvm/3.8/default.nix+2−2
@@ -27,14 +27,14 @@ let
2727 libstdcxxClang = ccWrapperFun {
2828 cc = self.clang-unwrapped;
2929 /* FIXME is this right? */
30− inherit (stdenv.cc) libc nativeTools nativeLibc;
30+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
3131 extraPackages = [ libstdcxxHook ];
3232 };
3333
3434 libcxxClang = ccWrapperFun {
3535 cc = self.clang-unwrapped;
3636 /* FIXME is this right? */
37− inherit (stdenv.cc) libc nativeTools nativeLibc;
37+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
3838 extraPackages = [ self.libcxx self.libcxxabi ];
3939 };
4040
pkgs/development/compilers/llvm/3.9/default.nix+2−2
@@ -27,14 +27,14 @@ let
2727 libstdcxxClang = ccWrapperFun {
2828 cc = self.clang-unwrapped;
2929 /* FIXME is this right? */
30− inherit (stdenv.cc) libc nativeTools nativeLibc;
30+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
3131 extraPackages = [ libstdcxxHook ];
3232 };
3333
3434 libcxxClang = ccWrapperFun {
3535 cc = self.clang-unwrapped;
3636 /* FIXME is this right? */
37− inherit (stdenv.cc) libc nativeTools nativeLibc;
37+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
3838 extraPackages = [ self.libcxx self.libcxxabi ];
3939 };
4040
pkgs/development/compilers/llvm/4/default.nix+2−2
@@ -42,14 +42,14 @@ let
4242 libstdcxxClang = ccWrapperFun {
4343 cc = self.clang-unwrapped;
4444 /* FIXME is this right? */
45− inherit (stdenv.cc) libc nativeTools nativeLibc;
45+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
4646 extraPackages = [ libstdcxxHook ];
4747 };
4848
4949 libcxxClang = ccWrapperFun {
5050 cc = self.clang-unwrapped;
5151 /* FIXME is this right? */
52− inherit (stdenv.cc) libc nativeTools nativeLibc;
52+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
5353 extraPackages = [ self.libcxx self.libcxxabi ];
5454 };
5555
pkgs/development/compilers/llvm/5/default.nix+2−2
@@ -42,14 +42,14 @@ let
4242 libstdcxxClang = ccWrapperFun {
4343 cc = self.clang-unwrapped;
4444 /* FIXME is this right? */
45− inherit (stdenv.cc) libc nativeTools nativeLibc;
45+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
4646 extraPackages = [ libstdcxxHook ];
4747 };
4848
4949 libcxxClang = ccWrapperFun {
5050 cc = self.clang-unwrapped;
5151 /* FIXME is this right? */
52− inherit (stdenv.cc) libc nativeTools nativeLibc;
52+ inherit (stdenv.cc) bintools libc nativeTools nativeLibc;
5353 extraPackages = [ self.libcxx self.libcxxabi ];
5454 };
5555
pkgs/development/compilers/llvm/multi.nixnew file+48
@@ -0,0 +1,48 @@
1+{ runCommand,
2+clang,
3+gcc64,
4+gcc32,
5+glibc_multi
6+}:
7+
8+let
9+ combine = basegcc: runCommand "combine-gcc-libc" {} ''
10+ mkdir -p $out
11+ cp -r ${basegcc.cc}/lib $out/lib
12+
13+ chmod u+rw -R $out/lib
14+ cp -r ${basegcc.libc}/lib/* $(ls -d $out/lib/gcc/*/*)
15+ '';
16+ gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {} ''
17+ mkdir -p $out/lib/gcc
18+
19+ ln -s ${combine gcc64}/lib/gcc/* $out/lib/gcc/
20+ ln -s ${combine gcc32}/lib/gcc/* $out/lib/gcc/
21+ # XXX: This shouldn't be needed, clang just doesn't look for "i686-unknown"
22+ ln -s $out/lib/gcc/i686-unknown-linux-gnu $out/lib/gcc/i686-pc-linux-gnu
23+
24+
25+ # includes
26+ ln -s ${glibc_multi.dev}/include $out/
27+
28+ # dynamic linkers
29+ mkdir -p $out/lib/32
30+ ln -s ${glibc_multi.out}/lib/ld-linux* $out/lib
31+ ln -s ${glibc_multi.out}/lib/32/ld-linux* $out/lib/32/
32+ '';
33+
34+ clangMulti = clang.override {
35+ # Only used for providing expected structure re:dynamic linkers, AFAIK
36+ # Most of the magic is done by setting the --gcc-toolchain option below
37+ libc = gcc_multi_sysroot;
38+
39+ bintools = clang.bintools.override {
40+ libc = gcc_multi_sysroot;
41+ };
42+
43+ extraBuildCommands = ''
44+ sed -e '$a --gcc-toolchain=${gcc_multi_sysroot}' -i $out/nix-support/libc-cflags
45+ '';
46+ };
47+
48+in clangMulti
pkgs/development/interpreters/python/build-python-package.nix+2−2
@@ -7,7 +7,7 @@
77, setuptools
88, unzip
99, ensureNewerSourcesHook
10−, pythonModule
10+, toPythonModule
1111, namePrefix
1212, bootstrapped-pip
1313, flit
@@ -19,7 +19,7 @@ let
1919 wheel-specific = import ./build-python-package-wheel.nix { };
2020 common = import ./build-python-package-common.nix { inherit python bootstrapped-pip; };
2121 mkPythonDerivation = import ./mk-python-derivation.nix {
22− inherit lib python wrapPython setuptools unzip ensureNewerSourcesHook pythonModule namePrefix;
22+ inherit lib python wrapPython setuptools unzip ensureNewerSourcesHook toPythonModule namePrefix;
2323 };
2424in
2525
pkgs/development/interpreters/python/mk-python-derivation.nix+14−8
@@ -7,7 +7,7 @@
77, unzip
88, ensureNewerSourcesHook
99# Whether the derivation provides a Python module or not.
10−, pythonModule
10+, toPythonModule
1111, namePrefix
1212}:
1313
@@ -40,6 +40,12 @@
4040# Skip wrapping of python programs altogether
4141, dontWrapPythonPrograms ? false
4242
43+# Remove bytecode from bin folder.
44+# When a Python script has the extension `.py`, bytecode is generated
45+# Typically, executables in bin have no extension, so no bytecode is generated.
46+# However, some packages do provide executables with extensions, and thus bytecode is generated.
47+, removeBinBytecode ? true
48+
4349, meta ? {}
4450
4551, passthru ? {}
@@ -54,7 +60,7 @@ if disabled
5460then throw "${name} not supported for interpreter ${python.executable}"
5561else
5662
57−python.stdenv.mkDerivation (builtins.removeAttrs attrs [
63+toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
5864 "disabled" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts"
5965 ] // {
6066
@@ -77,6 +83,11 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs [
7783
7884 postFixup = lib.optionalString (!dontWrapPythonPrograms) ''
7985 wrapPythonPrograms
86+ '' + lib.optionalString removeBinBytecode ''
87+ if [ -d "$out/bin" ]; then
88+ rm -rf "$out/bin/__pycache__" # Python 3
89+ find "$out/bin" -type f -name "*.pyc" -delete # Python 2
90+ fi
8091 '' + lib.optionalString catchConflicts ''
8192 # Check if we have two packages with the same name in the closure and fail.
8293 # If this happens, something went wrong with the dependencies specs.
@@ -84,14 +95,9 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs [
8495 ${python.interpreter} ${./catch_conflicts}/catch_conflicts.py
8596 '' + attrs.postFixup or '''';
8697
87− passthru = {
88− inherit python; # The python interpreter
89− inherit pythonModule;
90− } // passthru;
91−
9298 meta = {
9399 # default to python's platforms
94100 platforms = python.meta.platforms;
95101 isBuildPythonPackage = python.meta.platforms;
96102 } // meta;
97−})
103+}))
pkgs/development/libraries/boost/1.65.nix+2
@@ -9,4 +9,6 @@ callPackage ./generic.nix (args // rec {
99 sha256 = "9807a5d16566c57fd74fb522764e0b134a8bbe6b6e8967b83afefd30dcd3be81";
1010 };
1111
12+ enableNumpy = true;
13+
1214})
pkgs/development/libraries/boost/generic.nix+2−2
@@ -10,7 +10,7 @@
1010, enablePIC ? false
1111, enableExceptions ? false
1212, enablePython ? hostPlatform == buildPlatform
13−, enableNumpy ? false, numpy ? null
13+, enableNumpy ? false
1414, taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
1515, patches ? null
1616, mpi ? null
@@ -156,7 +156,7 @@ stdenv.mkDerivation {
156156 ++ optional (hostPlatform == buildPlatform) icu
157157 ++ optional stdenv.isDarwin fixDarwinDylibNames
158158 ++ optional enablePython python
159− ++ optional enableNumpy numpy;
159+ ++ optional enableNumpy python.pkgs.numpy;
160160
161161 configureScript = "./bootstrap.sh";
162162 configureFlags = commonConfigureFlags
pkgs/development/libraries/fribidi/default.nix+11−7
@@ -1,22 +1,26 @@
1−{stdenv, fetchurl}:
1+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig }:
22
33stdenv.mkDerivation rec {
44 name = "fribidi-${version}";
55 version = "0.19.7";
66
7− src = fetchurl {
8− url = "http://fribidi.org/download/${name}.tar.bz2";
9− sha256 = "13jsb5qadlhsaxkbrb49nqslmbh904vvzhsm5mm2ghmv29i2l8h8";
7+ src = fetchFromGitHub {
8+ owner = "fribidi";
9+ repo = "fribidi";
10+ rev = version;
11+ sha256 = "10q5jfch5qzrj2w4fbkr086ank66plx8hp7ra9a01irj80pbk96d";
1012 };
1113
12− hardeningDisable = [ "format" ];
14+ nativeBuildInputs = [ autoreconfHook pkgconfig ];
15+
16+ # Configure script checks for glib, but it is only used for tests.
1317
1418 outputs = [ "out" "devdoc" ];
1519
1620 meta = with stdenv.lib; {
17− homepage = http://fribidi.org/;
21+ homepage = https://github.com/fribidi/fribidi;
1822 description = "GNU implementation of the Unicode Bidirectional Algorithm (bidi)";
19− license = licenses.gpl2;
23+ license = licenses.lgpl21;
2024 platforms = platforms.unix;
2125 };
2226}
pkgs/development/libraries/gstreamer/vaapi/default.nix+2−2
@@ -5,11 +5,11 @@
55
66stdenv.mkDerivation rec {
77 name = "gst-vaapi-${version}";
8− version = "1.12.3";
8+ version = "1.12.4";
99
1010 src = fetchurl {
1111 url = "${meta.homepage}/src/gstreamer-vaapi/gstreamer-vaapi-${version}.tar.xz";
12− sha256 = "0kbl2c4zv004qwhm9mc0jlhz2pc3dqrng2vwj68a81lnzpcazkgl";
12+ sha256 = "1jg9nvc8000yi2bcl3wn2yh2hwl7yvlwldj6778w8c0z5qj7fb8w";
1313 };
1414
1515 outputs = [ "out" "dev" ];
pkgs/development/libraries/libbfd/default.nix+2−2
@@ -5,11 +5,11 @@
55
66stdenv.mkDerivation rec {
77 name = "libbfd-${version}";
8− inherit (binutils-raw) version src;
8+ inherit (binutils-raw.bintools) version src;
99
1010 outputs = [ "out" "dev" ];
1111
12− patches = binutils-raw.patches ++ [
12+ patches = binutils-raw.bintools.patches ++ [
1313 ../../tools/misc/binutils/build-components-separately.patch
1414 ];
1515
pkgs/development/libraries/libjpeg-turbo/default.nix+2−2
@@ -4,11 +4,11 @@
44
55stdenv.mkDerivation rec {
66 name = "libjpeg-turbo-${version}";
7− version = "1.5.2";
7+ version = "1.5.3";
88
99 src = fetchurl {
1010 url = "mirror://sourceforge/libjpeg-turbo/${name}.tar.gz";
11− sha256 = "0a5m0psfp5952y5vrcs0nbdz1y9wqzg2ms0xwrx752034wxr964h";
11+ sha256 = "08r5b5mywwrxv4axvq80dm31cklz81grczlzlxr2xqa6pgi90j5j";
1212 }; # github releases still need autotools, surprisingly
1313
1414 patches =
pkgs/development/libraries/libopcodes/default.nix+2−2
@@ -5,11 +5,11 @@
55
66stdenv.mkDerivation rec {
77 name = "libopcodes-${version}";
8− inherit (binutils-raw) version src;
8+ inherit (binutils-raw.bintools) version src;
99
1010 outputs = [ "out" "dev" ];
1111
12− patches = binutils-raw.patches ++ [
12+ patches = binutils-raw.bintools.patches ++ [
1313 ../../tools/misc/binutils/build-components-separately.patch
1414 ];
1515
pkgs/development/libraries/libstdc++5/default.nix+1−1
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
6464 # being generated to make sure that they use our glibc.
6565 EXTRA_FLAGS="-I$NIX_FIXINC_DUMMY $(cat $NIX_CC/nix-support/libc-cflags) -O2"
6666
67− extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $(cat $NIX_CC/nix-support/libc-ldflags) $(cat $NIX_CC/nix-support/libc-ldflags-before)"
67+ extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $(cat $NIX_BINTOOLS/nix-support/libc-ldflags) $(cat $NIX_BINTOOLS/nix-support/libc-ldflags-before)"
6868 for i in $extraLDFlags; do
6969 EXTRA_FLAGS="$EXTRA_FLAGS -Wl,$i"
7070 done
pkgs/development/libraries/libuv/default.nix+2−2
@@ -2,14 +2,14 @@
22, ApplicationServices, CoreServices }:
33
44stdenv.mkDerivation rec {
5− version = "1.16.1";
5+ version = "1.18.0";
66 name = "libuv-${version}";
77
88 src = fetchFromGitHub {
99 owner = "libuv";
1010 repo = "libuv";
1111 rev = "v${version}";
12− sha256 = "06p3xy276spqbr9xzbs7qlpdk34qsn87s2qmp6xn4j7v3bnqja7z";
12+ sha256 = "0s71c2y4ll3vp463hsdk74q4hr7wprkxc2a4agw3za2hhzcb95pd";
1313 };
1414
1515 postPatch = let
pkgs/development/libraries/libva-utils/default.nixnew file+29
@@ -0,0 +1,29 @@
1+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig
2+, libdrm, libva
3+}:
4+
5+stdenv.mkDerivation rec {
6+ name = "libva-utils-${version}";
7+ inherit (libva) version;
8+
9+ src = fetchFromGitHub {
10+ owner = "01org";
11+ repo = "libva-utils";
12+ rev = version;
13+ sha256 = "02n51cvp8bzzjk4fargwvgh7z71y8spg24hqgaawbp3p3ahh7xxi";
14+ };
15+
16+ nativeBuildInputs = [ autoreconfHook pkgconfig ];
17+
18+ buildInputs = [ libdrm libva ];
19+
20+ enableParallelBuilding = true;
21+
22+ meta = with stdenv.lib; {
23+ description = "VAAPI tools: Video Acceleration API";
24+ homepage = http://www.freedesktop.org/wiki/Software/vaapi;
25+ license = licenses.mit;
26+ maintainers = with maintainers; [ garbas ];
27+ platforms = platforms.unix;
28+ };
29+}
pkgs/development/libraries/libva/default.nix+22−15
@@ -1,36 +1,43 @@
1−{ stdenv, lib, fetchurl, libX11, pkgconfig, libXext, libdrm, libXfixes, wayland, libffi
1+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig
2+, libXext, libdrm, libXfixes, wayland, libffi, libX11
23, mesa_noglu
34, minimal ? true, libva
45}:
56
67stdenv.mkDerivation rec {
7− name = "libva-${version}";
8− version = "1.7.3";
9−
10− src = fetchurl {
11− url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2";
12− sha256 = "1ndrf136rlw03xag7j1xpmf9015d1h0dpnv6v587jnh6k2a17g12";
8+ name = "libva-${lib.optionalString (!minimal) "full-"}${version}";
9+ version = "2.0.0";
10+
11+ src = fetchFromGitHub {
12+ owner = "01org";
13+ repo = "libva";
14+ rev = version;
15+ sha256 = "1x8rlmv5wfqjz3j87byrxb4d9vp5b4lrrin2fx254nwl3aqy15hy";
1316 };
1417
15− outputs = [ "bin" "dev" "out" ];
18+ outputs = [ "dev" "out" ];
1619
17− nativeBuildInputs = [ pkgconfig ];
20+ nativeBuildInputs = [ autoreconfHook pkgconfig ];
1821
1922 buildInputs = [ libdrm ]
2023 ++ lib.optionals (!minimal) [ libva libX11 libXext libXfixes wayland libffi mesa_noglu ];
2124 # TODO: share libs between minimal and !minimal - perhaps just symlink them
2225
23− configureFlags =
24− [ "--with-drivers-path=${mesa_noglu.driverLink}/lib/dri" ] ++
25− lib.optionals (!minimal) [ "--enable-glx" ];
26+ enableParallelBuilding = true;
27+
28+ configureFlags = [
29+ "--with-drivers-path=${mesa_noglu.driverLink}/lib/dri"
30+ ] ++ lib.optionals (!minimal) [ "--enable-glx" ];
2631
27− installFlags = [ "dummy_drv_video_ladir=$(out)/lib/dri" ];
32+ installFlags = [
33+ "dummy_drv_video_ladir=$(out)/lib/dri"
34+ ];
2835
2936 meta = with stdenv.lib; {
37+ description = "VAAPI library: Video Acceleration API";
3038 homepage = http://www.freedesktop.org/wiki/Software/vaapi;
3139 license = licenses.mit;
32− description = "VAAPI library: Video Acceleration API";
33− platforms = platforms.unix;
3440 maintainers = with maintainers; [ garbas ];
41+ platforms = platforms.unix;
3542 };
3643}
pkgs/development/libraries/mesa/default.nix+2−2
@@ -66,7 +66,7 @@ let
6666in
6767
6868let
69− version = "17.2.6";
69+ version = "17.2.7";
7070 branch = head (splitString "." version);
7171 driverLink = "/run/opengl-driver" + optionalString stdenv.isi686 "-32";
7272in
@@ -81,7 +81,7 @@ stdenv.mkDerivation {
8181 "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
8282 "https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
8383 ];
84− sha256 = "1pihiymglf3bf6w2vphac65v64hv71wgrj38mckbwc03c8j55n3a";
84+ sha256 = "0s3slgjxnx482yw0knn4a6alsy2cq28rah6hnjbmf12mvyldxksh";
8585 };
8686
8787 prePatch = "patchShebangs .";
pkgs/development/libraries/vaapi-intel/default.nix+10−6
@@ -1,14 +1,16 @@
1−{ stdenv, fetchurl, gnum4, pkgconfig, python2
1+{ stdenv, fetchFromGitHub, autoreconfHook, gnum4, pkgconfig, python2
22, intel-gpu-tools, libdrm, libva, libX11, mesa_noglu, wayland, libXext
33}:
44
55stdenv.mkDerivation rec {
66 name = "intel-vaapi-driver-${version}";
7− version = "1.8.2";
7+ inherit (libva) version;
88
9− src = fetchurl {
10− url = "http://www.freedesktop.org/software/vaapi/releases/libva-intel-driver/${name}.tar.bz2";
11− sha256 = "00mpcvininwr5c4wyhp16s4bddg7vclxxjm2sfq5h7lifjcxyv46";
9+ src = fetchFromGitHub {
10+ owner = "01org";
11+ repo = "libva-intel-driver";
12+ rev = version;
13+ sha256 = "1832nnva3d33wv52bj59bv62q7a807sdxjqqq0my7l9x7a4qdkzz";
1214 };
1315
1416 patchPhase = ''
@@ -25,10 +27,12 @@ stdenv.mkDerivation rec {
2527 "--enable-wayland"
2628 ];
2729
28− nativeBuildInputs = [ gnum4 pkgconfig python2 ];
30+ nativeBuildInputs = [ autoreconfHook gnum4 pkgconfig python2 ];
2931
3032 buildInputs = [ intel-gpu-tools libdrm libva libX11 libXext mesa_noglu wayland ];
3133
34+ enableParallelBuilding = true;
35+
3236 meta = with stdenv.lib; {
3337 homepage = http://cgit.freedesktop.org/vaapi/intel-driver/;
3438 license = licenses.mit;
pkgs/development/perl-modules/generic/builder.sh+1−4
@@ -17,10 +17,7 @@ preConfigure() {
1717 first=$(dd if="$fn" count=2 bs=1 2> /dev/null)
1818 if test "$first" = "#!"; then
1919 echo "patching $fn..."
20− sed < "$fn" > "$fn".tmp \
21− -e "s|^#\!\(.*/perl.*\)$|#\! \1$perlFlags|"
22− if test -x "$fn"; then chmod +x "$fn".tmp; fi
23− mv "$fn".tmp "$fn"
20+ sed -i "$fn" -e "s|^#\!\(.*[ /]perl.*\)$|#\!\1$perlFlags|"
2421 fi
2522 fi
2623 done
pkgs/development/tools/bloaty/default.nix+1−1
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
1919 preConfigure = ''
2020 substituteInPlace src/bloaty.cc \
2121 --replace "c++filt" \
22− "${stdenv.lib.getBin binutils}/bin/c++filt"
22+ "${binutils.bintools}/bin/c++filt"
2323 '';
2424
2525 doCheck = true;
pkgs/development/tools/build-managers/meson/default.nix+2−2
@@ -1,12 +1,12 @@
11{ lib, python3Packages }:
22python3Packages.buildPythonApplication rec {
3− version = "0.43.0";
3+ version = "0.44.0";
44 pname = "meson";
55 name = "${pname}-${version}";
66
77 src = python3Packages.fetchPypi {
88 inherit pname version;
9− sha256 = "0qn5hyzvam3rimn7g3671s1igj7fbkwdnf5nc8jr4d5swy25mq61";
9+ sha256 = "1rpqp9iwbvr4xvfdh3iyfh1ha274hbb66jbgw3pa5a73x4d4ilqn";
1010 };
1111
1212 postFixup = ''
pkgs/development/tools/misc/binutils/default.nix+1−1
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
5555 ./disambiguate-arm-targets.patch
5656 ];
5757
58− outputs = [ "out" "info" ];
58+ outputs = [ "out" "info" "man" ];
5959
6060 nativeBuildInputs = [ bison buildPackages.stdenv.cc ];
6161 buildInputs = [ zlib ];
pkgs/development/web/nodejs/v9.nix+2−2
@@ -5,7 +5,7 @@ let
55in
66 buildNodejs {
77 inherit enableNpm;
8− version = "9.2.0";
9− sha256 = "1hmvwfbavk2axqz9kin8b5zsld25gznhvlz55h3yl6nwx9iz5jk4";
8+ version = "9.3.0";
9+ sha256 = "1kap1hi4am5advfp6yb3bd5nhd2wx2j72cjq8qqg7yh95xg0g25j";
1010 patches = lib.optionals stdenv.isDarwin [ ./no-xcode-v7.patch ];
1111 }
pkgs/os-specific/darwin/binutils/default.nix+10−3
@@ -17,10 +17,11 @@ in
1717# TODO loop over targetPrefixed binaries too
1818stdenv.mkDerivation {
1919 name = "${targetPrefix}cctools-binutils-darwin";
20+ outputs = [ "out" "info" "man" ];
2021 buildCommand = ''
2122 mkdir -p $out/bin $out/include
2223
23− ln -s ${binutils-raw.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt
24+ ln -s ${binutils-raw.bintools.out}/bin/${targetPrefix}c++filt $out/bin/${targetPrefix}c++filt
2425
2526 # We specifically need:
2627 # - ld: binutils doesn't provide it on darwin
@@ -37,10 +38,16 @@ stdenv.mkDerivation {
3738 ln -sf "${cctools}/bin/$i" "$out/bin/$i"
3839 done
3940
40− # FIXME: this will give us incorrect man pages for bits of cctools
41− ln -s ${binutils-raw.out}/share $out/share
41+ ln -s ${binutils-raw.bintools.out}/share $out/share
4242
4343 ln -s ${cctools}/libexec $out/libexec
44+
45+ mkdir -p "$info/nix-support" "$man/nix-support"
46+ printWords ${binutils-raw.bintools.info} \
47+ >> $info/nix-support/propagated-build-inputs
48+ # FIXME: cctools missing man pages
49+ printWords ${binutils-raw.bintools.man} \
50+ >> $man/nix-support/propagated-build-inputs
4451 '';
4552
4653 passthru = {
pkgs/stdenv/darwin/default.nix+39−23
@@ -60,10 +60,40 @@ in rec {
6060 extraBuildInputs,
6161 allowedRequisites ? null}:
6262 let
63+ buildPackages = lib.optionalAttrs (last ? stdenv) {
64+ inherit (last) stdenv;
65+ };
66+
67+ coreutils = { name = "coreutils-9.9.9"; outPath = bootstrapTools; };
68+ gnugrep = { name = "gnugrep-9.9.9"; outPath = bootstrapTools; };
69+
70+ bintools = import ../../build-support/bintools-wrapper {
71+ inherit shell;
72+ inherit (last) stdenvNoCC;
73+
74+ nativeTools = false;
75+ nativeLibc = false;
76+ inherit buildPackages coreutils gnugrep;
77+ libc = last.pkgs.darwin.Libsystem;
78+ bintools = { name = "binutils-9.9.9"; outPath = bootstrapTools; };
79+ };
80+
81+ cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper {
82+ inherit shell;
83+ inherit (last) stdenvNoCC;
84+
85+ nativeTools = false;
86+ nativeLibc = false;
87+ inherit buildPackages coreutils gnugrep bintools;
88+ libc = last.pkgs.darwin.Libsystem;
89+ isClang = true;
90+ cc = { name = "clang-9.9.9"; outPath = bootstrapTools; };
91+ };
92+
6393 thisStdenv = import ../generic {
6494 inherit config shell extraNativeBuildInputs extraBuildInputs;
6595 allowedRequisites = if allowedRequisites == null then null else allowedRequisites ++ [
66− thisStdenv.cc.expand-response-params
96+ cc.expand-response-params cc.bintools
6797 ];
6898
6999 name = "stdenv-darwin-boot-${toString step}";
@@ -72,24 +102,9 @@ in rec {
72102 hostPlatform = localSystem;
73103 targetPlatform = localSystem;
74104
75− cc = if isNull last then "/dev/null" else import ../../build-support/cc-wrapper {
76− inherit shell;
77− inherit (last) stdenvNoCC;
78−
79− nativeTools = false;
80− nativeLibc = false;
81− buildPackages = lib.optionalAttrs (last ? stdenv) {
82− inherit (last) stdenv;
83− };
84− libc = last.pkgs.darwin.Libsystem;
85− isClang = true;
86− cc = { name = "clang-9.9.9"; outPath = bootstrapTools; };
87− binutils = { name = "binutils-9.9.9"; outPath = bootstrapTools; };
88− coreutils = { name = "coreutils-9.9.9"; outPath = bootstrapTools; };
89− gnugrep = { name = "gnugrep-9.9.9"; outPath = bootstrapTools; };
90− };
105+ inherit cc;
91106
92− preHook = stage0.stdenv.lib.optionalString (shell == "${bootstrapTools}/bin/bash") ''
107+ preHook = lib.optionalString (shell == "${bootstrapTools}/bin/bash") ''
93108 # Don't patch #!/interpreter because it leads to retained
94109 # dependencies on the bootstrapTools in the final stdenv.
95110 dontPatchShebangs=1
@@ -328,9 +343,10 @@ in rec {
328343 buildPackages = {
329344 inherit (prevStage) stdenv;
330345 };
331− inherit (pkgs) coreutils binutils gnugrep;
332− cc = pkgs.llvmPackages.clang-unwrapped;
333− libc = pkgs.darwin.Libsystem;
346+ inherit (pkgs) coreutils gnugrep;
347+ cc = pkgs.llvmPackages.clang-unwrapped;
348+ bintools = pkgs.darwin.binutils;
349+ libc = pkgs.darwin.Libsystem;
334350 };
335351
336352 extraNativeBuildInputs = [];
@@ -349,8 +365,8 @@ in rec {
349365 xz.out xz.bin libcxx libcxxabi gmp.out gnumake findutils bzip2.out
350366 bzip2.bin llvmPackages.llvm llvmPackages.llvm.lib zlib.out zlib.dev libffi.out coreutils ed diffutils gnutar
351367 gzip ncurses.out ncurses.dev ncurses.man gnused bash gawk
352− gnugrep llvmPackages.clang-unwrapped patch pcre.out binutils-raw.out
353− binutils gettext
368+ gnugrep llvmPackages.clang-unwrapped patch pcre.out gettext
369+ binutils-raw.bintools binutils binutils.bintools
354370 cc.expand-response-params
355371 ]) ++ (with pkgs.darwin; [
356372 dyld Libsystem CF cctools ICU libiconv locale
pkgs/stdenv/linux/default.nix+33−9
@@ -80,9 +80,10 @@ let
8080 inherit (prevStage) stdenv;
8181 };
8282 cc = prevStage.gcc-unwrapped;
83+ bintools = prevStage.binutils;
8384 isGNU = true;
8485 libc = prevStage.glibc;
85− inherit (prevStage) binutils coreutils gnugrep;
86+ inherit (prevStage) coreutils gnugrep;
8687 name = name;
8788 stdenvNoCC = prevStage.ccWrapperStdenv;
8889 };
@@ -143,7 +144,15 @@ in
143144 '';
144145 };
145146 gcc-unwrapped = bootstrapTools;
146− binutils = bootstrapTools;
147+ binutils = import ../../build-support/bintools-wrapper {
148+ nativeTools = false;
149+ nativeLibc = false;
150+ buildPackages = { };
151+ libc = self.glibc;
152+ inherit (self) stdenvNoCC coreutils gnugrep;
153+ bintools = bootstrapTools;
154+ name = "bootstrap-binutils-wrapper";
155+ };
147156 coreutils = bootstrapTools;
148157 gnugrep = bootstrapTools;
149158 };
@@ -165,7 +174,7 @@ in
165174
166175 # Rebuild binutils to use from stage2 onwards.
167176 overrides = self: super: {
168− binutils = super.binutils.override { gold = false; };
177+ binutils = super.binutils_nogold;
169178 inherit (prevStage)
170179 ccWrapperStdenv
171180 glibc gcc-unwrapped coreutils gnugrep;
@@ -188,9 +197,14 @@ in
188197 overrides = self: super: {
189198 inherit (prevStage)
190199 ccWrapperStdenv
191− binutils gcc-unwrapped coreutils gnugrep
200+ gcc-unwrapped coreutils gnugrep
192201 perl paxctl gnum4 bison;
193202 # This also contains the full, dynamically linked, final Glibc.
203+ binutils = prevStage.binutils.override {
204+ # Rewrap the binutils with the new glibc, so both the next
205+ # stage's wrappers use it.
206+ libc = self.glibc;
207+ };
194208 };
195209 })
196210
@@ -235,6 +249,15 @@ in
235249 # other purposes (binutils and top-level pkgs) too.
236250 inherit (prevStage) gettext gnum4 bison gmp perl glibc zlib linuxHeaders;
237251
252+ binutils = super.binutils.override {
253+ # Don't use stdenv's shell but our own
254+ shell = self.bash + "/bin/bash";
255+ # Build expand-response-params with last stage like below
256+ buildPackages = {
257+ inherit (prevStage) stdenv;
258+ };
259+ };
260+
238261 gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) {
239262 nativeTools = false;
240263 nativeLibc = false;
@@ -243,8 +266,9 @@ in
243266 inherit (prevStage) stdenv;
244267 };
245268 cc = prevStage.gcc-unwrapped;
269+ bintools = self.binutils;
246270 libc = self.glibc;
247− inherit (self) stdenvNoCC binutils coreutils gnugrep;
271+ inherit (self) stdenvNoCC coreutils gnugrep;
248272 name = "";
249273 shell = self.bash + "/bin/bash";
250274 };
@@ -299,8 +323,8 @@ in
299323 allowedRequisites = with prevStage; with lib;
300324 # Simple executable tools
301325 concatMap (p: [ (getBin p) (getLib p) ])
302− [ gzip bzip2 xz bash binutils coreutils diffutils findutils gawk
303− gnumake gnused gnutar gnugrep gnupatch patchelf ed paxctl
326+ [ gzip bzip2 xz bash binutils.bintools coreutils diffutils findutils
327+ gawk gnumake gnused gnutar gnugrep gnupatch patchelf ed paxctl
304328 ]
305329 # Library dependencies
306330 ++ map getLib (
@@ -310,7 +334,7 @@ in
310334 # More complicated cases
311335 ++ [
312336 glibc.out glibc.dev glibc.bin/*propagated from .dev*/ linuxHeaders
313− gcc gcc.cc gcc.cc.lib gcc.expand-response-params
337+ binutils gcc gcc.cc gcc.cc.lib gcc.expand-response-params
314338 ]
315339 ++ lib.optionals localSystem.isAarch64
316340 [ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ];
@@ -322,7 +346,7 @@ in
322346 attr acl paxctl zlib pcre;
323347 } // lib.optionalAttrs (super.targetPlatform == localSystem) {
324348 # Need to get rid of these when cross-compiling.
325− inherit (prevStage) binutils;
349+ inherit (prevStage) binutils binutils-raw;
326350 gcc = cc;
327351 };
328352 };
pkgs/stdenv/linux/make-bootstrap-tools-cross.nix+1−1
@@ -177,7 +177,7 @@ rec {
177177
178178 # Copy binutils.
179179 for i in as ld ar ranlib nm strip readelf objdump; do
180− cp ${binutils.out}/bin/$i $out/bin
180+ cp ${binutils.bintools.out}/bin/$i $out/bin
181181 done
182182
183183 chmod -R u+w $out
pkgs/stdenv/linux/make-bootstrap-tools.nix+1−1
@@ -126,7 +126,7 @@ rec {
126126
127127 # Copy binutils.
128128 for i in as ld ar ranlib nm strip readelf objdump; do
129− cp ${binutils.out}/bin/$i $out/bin
129+ cp ${binutils.bintools.out}/bin/$i $out/bin
130130 done
131131
132132 chmod -R u+w $out
pkgs/test/cc-wrapper/multilib.nixnew file+37
@@ -0,0 +1,37 @@
1+{ stdenv }:
2+
3+stdenv.mkDerivation {
4+ name = "cc-multilib-test";
5+
6+ # XXX: "depend" on cc-wrapper test?
7+
8+ # TODO: Have tests report pointer size or something; ensure they are what we asked for
9+ buildCommand = ''
10+ NIX_DEBUG=1 $CC -v
11+ NIX_DEBUG=1 $CXX -v
12+
13+ printf "checking whether compiler builds valid C binaries... " >&2
14+ $CC -o cc-check ${./cc-main.c}
15+ ./cc-check
16+
17+ printf "checking whether compiler builds valid 32bit C binaries... " >&2
18+ $CC -m32 -o c32-check ${./cc-main.c}
19+ ./c32-check
20+
21+ printf "checking whether compiler builds valid 64bit C binaries... " >&2
22+ $CC -m64 -o c64-check ${./cc-main.c}
23+ ./c64-check
24+
25+ printf "checking whether compiler builds valid 32bit C++ binaries... " >&2
26+ $CXX -m32 -o cxx32-check ${./cxx-main.cc}
27+ ./cxx32-check
28+
29+ printf "checking whether compiler builds valid 64bit C++ binaries... " >&2
30+ $CXX -m64 -o cxx64-check ${./cxx-main.cc}
31+ ./cxx64-check
32+
33+ touch $out
34+ '';
35+
36+ meta.platforms = stdenv.lib.platforms.x86_64;
37+}
pkgs/tools/typesetting/biber/default.nix−4
@@ -32,10 +32,6 @@ buildPerlModule rec {
3232 # Tests depend on the precise Unicode-Collate version (expects 1.19, but we have 1.25)
3333 doCheck = false;
3434
35− postUnpack = ''
36− sed '1s/env perl/perl/' -i */bin/biber
37− '';
38−
3935 meta = {
4036 description = "Backend for BibLaTeX";
4137 license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
pkgs/top-level/all-packages.nix+67−9
@@ -287,6 +287,9 @@ with pkgs;
287287 inherit url;
288288 };
289289
290+ ld-is-cc-hook = makeSetupHook { name = "ld-is-cc-hook"; }
291+ ../build-support/setup-hooks/ld-is-cc-hook.sh;
292+
290293 libredirect = callPackage ../build-support/libredirect { };
291294
292295 madonctl = callPackage ../applications/misc/madonctl { };
@@ -5505,7 +5508,9 @@ with pkgs;
55055508
55065509 clang-sierraHack = clang.override {
55075510 name = "clang-wrapper-with-reexport-hack";
5508− useMacosReexportHack = true;
5511+ bintools = clang.bintools.override {
5512+ useMacosReexportHack = true;
5513+ };
55095514 };
55105515
55115516 clang_5 = llvmPackages_5.clang;
@@ -5534,7 +5539,7 @@ with pkgs;
55345539 cc = build;
55355540 isClang = true;
55365541 inherit stdenvNoCC;
5537− libc = glibc;
5542+ inherit (targetPackages.stdenv.cc) bintools libc;
55385543 extraPackages = [ libcxx libcxxabi ];
55395544 nativeTools = false;
55405545 nativeLibc = false;
@@ -5606,24 +5611,42 @@ with pkgs;
56065611 };
56075612
56085613 wrapCCMulti = cc:
5609− if system == "x86_64-linux" then lowPrio (wrapCCWith {
5614+ if system == "x86_64-linux" then let
5615+ # Binutils with glibc multi
5616+ bintools = cc.bintools.override {
5617+ libc = glibc_multi;
5618+ };
5619+ in lowPrio (wrapCCWith {
56105620 cc = cc.cc.override {
56115621 stdenv = overrideCC stdenv (wrapCCWith {
56125622 cc = cc.cc;
5623+ inherit bintools;
56135624 libc = glibc_multi;
56145625 });
56155626 profiledCompiler = false;
56165627 enableMultilib = true;
56175628 };
5618−
56195629 libc = glibc_multi;
5620−
5630+ inherit bintools;
56215631 extraBuildCommands = ''
56225632 echo "dontMoveLib64=1" >> $out/nix-support/setup-hook
56235633 '';
56245634 }) else throw "Multilib ${cc.name} not supported on ‘${system}’";
56255635
5636+ wrapClangMulti = clang:
5637+ if system == "x86_64-linux" then
5638+ callPackage ../development/compilers/llvm/multi.nix {
5639+ inherit clang;
5640+ gcc32 = pkgsi686Linux.gcc;
5641+ gcc64 = pkgs.gcc;
5642+ }
5643+ else throw "Multilib ${clang.cc.name} not supported on '${system}'";
5644+
56265645 gcc_multi = wrapCCMulti gcc;
5646+ clang_multi = wrapClangMulti clang;
5647+
5648+ gccMultiStdenv = overrideCC stdenv gcc_multi;
5649+ clangMultiStdenv = overrideCC stdenv clang_multi;
56275650
56285651 gcc_debug = lowPrio (wrapCC (gcc.cc.override {
56295652 stripped = false;
@@ -5650,6 +5673,10 @@ with pkgs;
56505673 if targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers
56515674 else if targetPlatform.libc == "libSystem" then darwin.xcode
56525675 else null;
5676+ binutils1 = wrapBintoolsWith {
5677+ bintools = binutils-unwrapped;
5678+ libc = libcCross1;
5679+ };
56535680 in wrapCCWith {
56545681 name = "gcc-cross-wrapper";
56555682 cc = gccFun {
@@ -5663,8 +5690,10 @@ with pkgs;
56635690 crossStageStatic = true;
56645691 langCC = false;
56655692 libcCross = libcCross1;
5693+ targetPackages.stdenv.cc.bintools = binutils1;
56665694 enableShared = false;
56675695 };
5696+ bintools = binutils1;
56685697 libc = libcCross1;
56695698 };
56705699
@@ -5673,6 +5702,7 @@ with pkgs;
56735702 name = "gcc-cross-wrapper";
56745703 cc = gccCrossStageStatic.gcc;
56755704 libc = windows.mingw_headers2;
5705+ inherit binutils;
56765706 };
56775707
56785708 gcc45 = lowPrio (wrapCC (callPackage ../development/compilers/gcc/4.5 {
@@ -6435,7 +6465,8 @@ with pkgs;
64356465
64366466 wla-dx = callPackage ../development/compilers/wla-dx { };
64376467
6438− wrapCCWith = { name ? "", cc, libc, extraBuildCommands ? "" }: ccWrapperFun rec {
6468+ wrapCCWith = { name ? "", cc, bintools, libc, extraBuildCommands ? "" }:
6469+ ccWrapperFun rec {
64396470 nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false;
64406471 nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false;
64416472 nativePrefix = stdenv.cc.nativePrefix or "";
@@ -6444,14 +6475,20 @@ with pkgs;
64446475 isGNU = cc.isGNU or false;
64456476 isClang = cc.isClang or false;
64466477
6447− inherit name cc libc extraBuildCommands;
6478+ inherit name cc bintools libc extraBuildCommands;
64486479 };
64496480
64506481 ccWrapperFun = callPackage ../build-support/cc-wrapper;
6482+ bintoolsWrapperFun = callPackage ../build-support/bintools-wrapper;
64516483
64526484 wrapCC = cc: wrapCCWith {
64536485 name = lib.optionalString (targetPlatform != hostPlatform) "gcc-cross-wrapper";
64546486 inherit cc;
6487+ # This should be the only bintools runtime dep with this sort of logic. The
6488+ # Others should instead delegate to the next stage's choice with
6489+ # `targetPackages.stdenv.cc.bintools`. This one is different just to
6490+ # provide the default choice, avoiding infinite recursion.
6491+ bintools = if targetPlatform.isDarwin then darwin.binutils else binutils;
64556492 libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
64566493 };
64576494 # legacy version, used for gnat bootstrapping
@@ -6463,6 +6500,17 @@ with pkgs;
64636500 libc = glibc;
64646501 };
64656502
6503+ wrapBintoolsWith = { bintools, libc }: bintoolsWrapperFun {
6504+ nativeTools = targetPlatform == hostPlatform && stdenv.cc.nativeTools or false;
6505+ nativeLibc = targetPlatform == hostPlatform && stdenv.cc.nativeLibc or false;
6506+ nativePrefix = stdenv.cc.nativePrefix or "";
6507+
6508+ noLibc = (libc == null);
6509+
6510+ inherit bintools libc;
6511+ extraBuildCommands = "";
6512+ };
6513+
64666514 # prolog
64676515 yap = callPackage ../development/compilers/yap { };
64686516
@@ -7044,13 +7092,19 @@ with pkgs;
70447092 then darwin.binutils
70457093 else binutils-raw;
70467094
7047− binutils-raw = callPackage ../development/tools/misc/binutils {
7095+ binutils-unwrapped = callPackage ../development/tools/misc/binutils {
70487096 # FHS sys dirs presumably only have stuff for the build platform
70497097 noSysDirs = (targetPlatform != buildPlatform) || noSysDirs;
70507098 };
7099+ binutils-raw = wrapBintoolsWith {
7100+ libc = if targetPlatform != hostPlatform then libcCross else stdenv.cc.libc;
7101+ bintools = binutils-unwrapped;
7102+ };
70517103
70527104 binutils_nogold = lowPrio (binutils-raw.override {
7053− gold = false;
7105+ bintools = binutils-raw.bintools.override {
7106+ gold = false;
7107+ };
70547108 });
70557109
70567110 bison2 = callPackage ../development/tools/parsing/bison/2.x.nix { };
@@ -9787,6 +9841,7 @@ with pkgs;
97879841
97889842 libva = callPackage ../development/libraries/libva { };
97899843 libva-full = libva.override { minimal = false; };
9844+ libva-utils = callPackage ../development/libraries/libva-utils { };
97909845
97919846 libvdpau = callPackage ../development/libraries/libvdpau { };
97929847
@@ -20034,6 +20089,9 @@ with pkgs;
2003420089 cc-wrapper-libcxx-5 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_5.libcxxStdenv; };
2003520090 stdenv-inputs = callPackage ../test/stdenv-inputs { };
2003620091
20092+ cc-multilib-gcc = callPackage ../test/cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
20093+ cc-multilib-clang = callPackage ../test/cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
20094+
2003720095 macOSSierraShared = callPackage ../test/macos-sierra-shared {};
2003820096 };
2003920097
pkgs/top-level/darwin-packages.nix+8−2
@@ -10,8 +10,14 @@ in
1010
1111 apple_sdk = callPackage ../os-specific/darwin/apple-sdk { };
1212
13− binutils = callPackage ../os-specific/darwin/binutils {
14− inherit (darwin) cctools;
13+ binutils = pkgs.wrapBintoolsWith {
14+ libc =
15+ if pkgs.targetPlatform != pkgs.hostPlatform
16+ then pkgs.libcCross
17+ else pkgs.stdenv.cc.libc;
18+ bintools = callPackage ../os-specific/darwin/binutils {
19+ inherit (darwin) cctools;
20+ };
1521 };
1622
1723 cctools = callPackage ../os-specific/darwin/cctools/port.nix {
pkgs/top-level/perl-packages.nix+3
@@ -4849,6 +4849,7 @@ let self = _self // overrides; _self = with self; {
48494849 url = "mirror://cpan/authors/id/J/JG/JGMYERS/${name}.tar.gz";
48504850 sha256 = "834d893aa7db6ce3f158afbd0e432d6ed15a276e0940db0a74be13fd9c4bbbf1";
48514851 };
4852+ nativeBuildInputs = [ pkgs.ld-is-cc-hook ];
48524853 propagatedBuildInputs = [ ModuleBuild ];
48534854 meta = {
48544855 description = "An Encode::Encoding subclass that detects the encoding of data";
@@ -5162,6 +5163,7 @@ let self = _self // overrides; _self = with self; {
51625163 url = "mirror://cpan/modules/by-module/ExtUtils/${name}.tar.gz";
51635164 sha256 = "1a77hxf2pa8ia9na72rijv1yhpn2bjrdsybwk2dj2l938pl3xn0w";
51645165 };
5166+ nativeBuildInputs = [ pkgs.ld-is-cc-hook ];
51655167 propagatedBuildInputs = [ CaptureTiny ];
51665168 };
51675169
@@ -8488,6 +8490,7 @@ let self = _self // overrides; _self = with self; {
84888490 url = "mirror://cpan/modules/by-module/Math/${name}.tar.gz";
84898491 sha256 = "0i9wzvig7ayijc9nvh5x5rryk1jrcj1hcvfmlcj449rnnxx24dav";
84908492 };
8493+ nativeBuildInputs = [ pkgs.ld-is-cc-hook ];
84918494 propagatedBuildInputs = [ ModuleBuildWithXSpp ExtUtilsXSpp ExtUtilsTypemapsDefault TestDeep ];
84928495 };
84938496
pkgs/top-level/python-packages.nix+7−10
@@ -56,14 +56,14 @@ let
5656 flit = self.flit;
5757 # We want Python libraries to be named like e.g. "python3.6-${name}"
5858 inherit namePrefix;
59− pythonModule = python;
59+ inherit toPythonModule;
6060 }));
6161
6262 buildPythonApplication = makeOverridablePythonPackage ( makeOverridable (callPackage ../development/interpreters/python/build-python-package.nix {
6363 inherit bootstrapped-pip;
6464 flit = self.flit;
6565 namePrefix = "";
66− pythonModule = false;
66+ toPythonModule = x: x; # Application does not provide modules.
6767 }));
6868
6969 graphiteVersion = "1.0.2";
@@ -87,15 +87,12 @@ let
8787 in fetcher (builtins.removeAttrs attrs ["format"]) );
8888
8989 # Check whether a derivation provides a Python module.
90− hasPythonModule = drv: (hasAttr "pythonModule" drv) && ( (getAttr "pythonModule" drv) == python);
90+ hasPythonModule = drv: drv?pythonModule && drv.pythonModule == python;
9191
9292 # Get list of required Python modules given a list of derivations.
9393 requiredPythonModules = drvs: let
94− filterNull = list: filter (x: !isNull x) list;
95− conditionalGetRecurse = attr: condition: drv: let f = conditionalGetRecurse attr condition; in
96− (if (condition drv) then unique [drv]++(concatMap f (filterNull(getAttr attr drv))) else []);
97− _required = drv: conditionalGetRecurse "propagatedBuildInputs" hasPythonModule drv;
98− in [python] ++ (unique (concatMap _required (filterNull drvs)));
94+ modules = filter hasPythonModule drvs;
95+ in unique ([python] ++ modules ++ concatLists (catAttrs "requiredPythonModules" modules));
9996
10097 # Create a PYTHONPATH from a list of derivations. This function recurses into the items to find derivations
10198 # providing Python modules.
@@ -106,9 +103,9 @@ let
106103 drv.overrideAttrs( oldAttrs: {
107104 # Use passthru in order to prevent rebuilds when possible.
108105 passthru = (oldAttrs.passthru or {})// {
109− name = namePrefix + oldAttrs.name;
110106 pythonModule = python;
111107 pythonPath = [ ]; # Deprecated, for compatibility.
108+ requiredPythonModules = requiredPythonModules drv.propagatedBuildInputs;
112109 };
113110 });
114111
@@ -129,7 +126,7 @@ in {
129126
130127 recursivePthLoader = callPackage ../development/python-modules/recursive-pth-loader { };
131128
132− setuptools = callPackage ../development/python-modules/setuptools { };
129+ setuptools = toPythonModule (callPackage ../development/python-modules/setuptools { });
133130
134131 vowpalwabbit = callPackage ../development/python-modules/vowpalwabbit {
135132 pythonPackages = self;
pkgs/top-level/release.nix+2
@@ -112,6 +112,8 @@ let
112112 jobs.tests.cc-wrapper-clang-39.x86_64-darwin
113113 jobs.tests.cc-wrapper-libcxx-39.x86_64-linux
114114 jobs.tests.cc-wrapper-libcxx-39.x86_64-darwin
115+ jobs.tests.cc-multilib-gcc.x86_64-linux
116+ jobs.tests.cc-multilib-clang.x86_64-linux
115117 jobs.tests.stdenv-inputs.x86_64-linux
116118 jobs.tests.stdenv-inputs.x86_64-darwin
117119 jobs.tests.macOSSierraShared.x86_64-darwin