mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
Merge pull request #46857 from obsidiansystems/darwin-to-linux-prep
misc pkgs: various cross fixes in preparation for darwin->linux
This commit is contained in:
commit
35378f0141
12 changed files with 44 additions and 37 deletions
|
@ -116,6 +116,7 @@ let version = "4.8.5";
|
|||
"--enable-sjlj-exceptions"
|
||||
"--enable-threads=win32"
|
||||
"--disable-win32-registry"
|
||||
"--disable-libmpx" # requires libc
|
||||
] else if crossStageStatic then [
|
||||
"--disable-libssp"
|
||||
"--disable-nls"
|
||||
|
@ -124,8 +125,9 @@ let version = "4.8.5";
|
|||
"--disable-libgomp"
|
||||
"--disable-libquadmath"
|
||||
"--disable-shared"
|
||||
"--disable-libatomic" # libatomic requires libc
|
||||
"--disable-decimal-float" # libdecnumber requires libc
|
||||
"--disable-libatomic" # requires libc
|
||||
"--disable-decimal-float" # requires libc
|
||||
"--disable-libmpx" # requires libc
|
||||
] else [
|
||||
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
|
||||
else "--with-headers=${getDev libcCross}/include")
|
||||
|
|
|
@ -121,6 +121,7 @@ let version = "4.9.4";
|
|||
"--enable-sjlj-exceptions"
|
||||
"--enable-threads=win32"
|
||||
"--disable-win32-registry"
|
||||
"--disable-libmpx" # requires libc
|
||||
] else if crossStageStatic then [
|
||||
"--disable-libssp"
|
||||
"--disable-nls"
|
||||
|
@ -129,8 +130,9 @@ let version = "4.9.4";
|
|||
"--disable-libgomp"
|
||||
"--disable-libquadmath"
|
||||
"--disable-shared"
|
||||
"--disable-libatomic" # libatomic requires libc
|
||||
"--disable-decimal-float" # libdecnumber requires libc
|
||||
"--disable-libatomic" # requires libc
|
||||
"--disable-decimal-float" # requires libc
|
||||
"--disable-libmpx" # requires libc
|
||||
] else [
|
||||
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
|
||||
else "--with-headers=${getDev libcCross}/include")
|
||||
|
|
|
@ -107,6 +107,7 @@ let version = "5.5.0";
|
|||
"--enable-sjlj-exceptions"
|
||||
"--enable-threads=win32"
|
||||
"--disable-win32-registry"
|
||||
"--disable-libmpx" # requires libc
|
||||
] else if crossStageStatic then [
|
||||
"--disable-libssp"
|
||||
"--disable-nls"
|
||||
|
@ -115,8 +116,9 @@ let version = "5.5.0";
|
|||
"--disable-libgomp"
|
||||
"--disable-libquadmath"
|
||||
"--disable-shared"
|
||||
"--disable-libatomic" # libatomic requires libc
|
||||
"--disable-decimal-float" # libdecnumber requires libc
|
||||
"--disable-libatomic" # requires libc
|
||||
"--disable-decimal-float" # requires libc
|
||||
"--disable-libmpx" # requires libc
|
||||
] else [
|
||||
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
|
||||
else "--with-headers=${getDev libcCross}/include")
|
||||
|
|
|
@ -105,6 +105,7 @@ let version = "6.4.0";
|
|||
"--enable-sjlj-exceptions"
|
||||
"--enable-threads=win32"
|
||||
"--disable-win32-registry"
|
||||
"--disable-libmpx" # requires libc
|
||||
] else if crossStageStatic then [
|
||||
"--disable-libssp"
|
||||
"--disable-nls"
|
||||
|
@ -113,11 +114,9 @@ let version = "6.4.0";
|
|||
"--disable-libgomp"
|
||||
"--disable-libquadmath"
|
||||
"--disable-shared"
|
||||
"--disable-libatomic" # libatomic requires libc
|
||||
"--disable-decimal-float" # libdecnumber requires libc
|
||||
# maybe only needed on musl, PATH_MAX
|
||||
# https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
|
||||
"--disable-libmpx"
|
||||
"--disable-libatomic" # requires libc
|
||||
"--disable-decimal-float" # requires libc
|
||||
"--disable-libmpx" # requires libc
|
||||
] else [
|
||||
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
|
||||
else "--with-headers=${getDev libcCross}/include")
|
||||
|
|
|
@ -77,6 +77,7 @@ let version = "7.3.0";
|
|||
"--enable-sjlj-exceptions"
|
||||
"--enable-threads=win32"
|
||||
"--disable-win32-registry"
|
||||
"--disable-libmpx" # requires libc
|
||||
] else if crossStageStatic then [
|
||||
"--disable-libssp"
|
||||
"--disable-nls"
|
||||
|
@ -85,11 +86,9 @@ let version = "7.3.0";
|
|||
"--disable-libgomp"
|
||||
"--disable-libquadmath"
|
||||
"--disable-shared"
|
||||
"--disable-libatomic" # libatomic requires libc
|
||||
"--disable-decimal-float" # libdecnumber requires libc
|
||||
# maybe only needed on musl, PATH_MAX
|
||||
# https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
|
||||
"--disable-libmpx"
|
||||
"--disable-libatomic" # requires libc
|
||||
"--disable-decimal-float" # requires libc
|
||||
"--disable-libmpx" # requires libc
|
||||
] else [
|
||||
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
|
||||
else "--with-headers=${getDev libcCross}/include")
|
||||
|
|
|
@ -72,6 +72,7 @@ let version = "8.2.0";
|
|||
"--enable-sjlj-exceptions"
|
||||
"--enable-threads=win32"
|
||||
"--disable-win32-registry"
|
||||
"--disable-libmpx" # requires libc
|
||||
] else if crossStageStatic then [
|
||||
"--disable-libssp"
|
||||
"--disable-nls"
|
||||
|
@ -80,11 +81,9 @@ let version = "8.2.0";
|
|||
"--disable-libgomp"
|
||||
"--disable-libquadmath"
|
||||
"--disable-shared"
|
||||
"--disable-libatomic" # libatomic requires libc
|
||||
"--disable-decimal-float" # libdecnumber requires libc
|
||||
# maybe only needed on musl, PATH_MAX
|
||||
# https://github.com/richfelker/musl-cross-make/blob/0867cdf300618d1e3e87a0a939fa4427207ad9d7/litecross/Makefile#L62
|
||||
"--disable-libmpx"
|
||||
"--disable-libatomic" # requires libc
|
||||
"--disable-decimal-float" # requires libc
|
||||
"--disable-libmpx" # requires libc
|
||||
] else [
|
||||
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
|
||||
else "--with-headers=${getDev libcCross}/include")
|
||||
|
|
|
@ -69,6 +69,7 @@ let version = "7-20170409";
|
|||
"--enable-sjlj-exceptions"
|
||||
"--enable-threads=win32"
|
||||
"--disable-win32-registry"
|
||||
"--disable-libmpx" # requires libc
|
||||
] else if crossStageStatic then [
|
||||
"--disable-libssp"
|
||||
"--disable-nls"
|
||||
|
@ -77,8 +78,9 @@ let version = "7-20170409";
|
|||
"--disable-libgomp"
|
||||
"--disable-libquadmath"
|
||||
"--disable-shared"
|
||||
"--disable-libatomic" # libatomic requires libc
|
||||
"--disable-decimal-float" # libdecnumber requires libc
|
||||
"--disable-libatomic" # requires libc
|
||||
"--disable-decimal-float" # requires libc
|
||||
"--disable-libmpx" # requires libc
|
||||
] else [
|
||||
(if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
|
||||
else "--with-headers=${getDev libcCross}/include")
|
||||
|
|
|
@ -94,8 +94,7 @@ callPackage ./common.nix { inherit stdenv; } {
|
|||
mv $bin/bin/getconf_ $bin/bin/getconf
|
||||
'';
|
||||
|
||||
# Hack to get around eval issue.
|
||||
separateDebugInfo = !stdenv.isDarwin;
|
||||
separateDebugInfo = true;
|
||||
|
||||
meta.description = "The GNU C Library";
|
||||
}
|
||||
|
|
|
@ -53,12 +53,15 @@ in lib.init bootStages ++ [
|
|||
else buildPackages.gcc;
|
||||
|
||||
extraNativeBuildInputs = old.extraNativeBuildInputs
|
||||
++ lib.optionals
|
||||
(hostPlatform.isLinux && !buildPlatform.isLinux)
|
||||
[ buildPackages.patchelf buildPackages.paxctl ]
|
||||
++ lib.optional
|
||||
(let f = p: !p.isx86 || p.libc == "musl"; in f hostPlatform && !(f buildPlatform))
|
||||
buildPackages.updateAutotoolsGnuConfigScriptsHook
|
||||
# without proper `file` command, libtool sometimes fails
|
||||
# to recognize 64-bit DLLs
|
||||
++ lib.optional (hostPlatform.config == "x86_64-w64-mingw32") buildPackages.file
|
||||
++ lib.optional
|
||||
(hostPlatform.isAarch64 || hostPlatform.isMips || hostPlatform.libc == "musl")
|
||||
buildPackages.updateAutotoolsGnuConfigScriptsHook
|
||||
;
|
||||
});
|
||||
})
|
||||
|
|
|
@ -83,9 +83,7 @@ rec {
|
|||
doCheck' = doCheck && stdenv.hostPlatform == stdenv.buildPlatform;
|
||||
doInstallCheck' = doInstallCheck && stdenv.hostPlatform == stdenv.buildPlatform;
|
||||
|
||||
outputs' =
|
||||
outputs ++
|
||||
(if separateDebugInfo then assert stdenv.hostPlatform.isLinux; [ "debug" ] else []);
|
||||
outputs' = outputs ++ lib.optional separateDebugInfo "debug";
|
||||
|
||||
fixedOutputDrv = attrs ? outputHash;
|
||||
noNonNativeDeps = builtins.length (depsBuildTarget ++ depsBuildTargetPropagated
|
||||
|
@ -176,7 +174,7 @@ rec {
|
|||
// {
|
||||
# A hack to make `nix-env -qa` and `nix search` ignore broken packages.
|
||||
# TODO(@oxij): remove this assert when something like NixOS/nix#1771 gets merged into nix.
|
||||
name = assert validity.handled; name + lib.optionalString
|
||||
name = assert validity.handled && (separateDebugInfo -> stdenv.hostPlatform.isLinux); name + lib.optionalString
|
||||
# Fixed-output derivations like source tarballs shouldn't get a host
|
||||
# suffix. But we have some weird ones with run-time deps that are
|
||||
# just used for their side-affects. Those might as well since the
|
||||
|
|
|
@ -251,7 +251,8 @@ in
|
|||
};
|
||||
extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
|
||||
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
|
||||
lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook;
|
||||
lib.optional (!localSystem.isx86 || localSystem.libc == "musl")
|
||||
prevStage.updateAutotoolsGnuConfigScriptsHook;
|
||||
})
|
||||
|
||||
|
||||
|
@ -292,7 +293,8 @@ in
|
|||
};
|
||||
extraNativeBuildInputs = [ prevStage.patchelf prevStage.xz ] ++
|
||||
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
|
||||
lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook;
|
||||
lib.optional (!localSystem.isx86 || localSystem.libc == "musl")
|
||||
prevStage.updateAutotoolsGnuConfigScriptsHook;
|
||||
})
|
||||
|
||||
# Construct the final stdenv. It uses the Glibc and GCC, and adds
|
||||
|
@ -324,7 +326,8 @@ in
|
|||
|
||||
extraNativeBuildInputs = [ prevStage.patchelf prevStage.paxctl ] ++
|
||||
# Many tarballs come with obsolete config.sub/config.guess that don't recognize aarch64.
|
||||
lib.optional (!localSystem.isx86) prevStage.updateAutotoolsGnuConfigScriptsHook;
|
||||
lib.optional (!localSystem.isx86 || localSystem.libc == "musl")
|
||||
prevStage.updateAutotoolsGnuConfigScriptsHook;
|
||||
|
||||
cc = prevStage.gcc;
|
||||
|
||||
|
@ -357,7 +360,7 @@ in
|
|||
++ [ /*propagated from .dev*/ linuxHeaders
|
||||
binutils gcc gcc.cc gcc.cc.lib gcc.expand-response-params
|
||||
]
|
||||
++ lib.optionals (!localSystem.isx86)
|
||||
++ lib.optionals (!localSystem.isx86 || localSystem.libc == "musl")
|
||||
[ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ];
|
||||
|
||||
overrides = self: super: {
|
||||
|
|
|
@ -6509,7 +6509,6 @@ with pkgs;
|
|||
libcCross1 =
|
||||
if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers
|
||||
else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode
|
||||
else if stdenv.targetPlatform.libc == "musl" then musl
|
||||
else null;
|
||||
binutils1 = wrapBintoolsWith {
|
||||
bintools = binutils-unwrapped;
|
||||
|
|
Loading…
Reference in a new issue