Merge pull request #40933 from obsidiansystems/linux-to-darwin
stdenv, binutils: Build cctools targeting macOS on Linux without pointless rebuilds
This commit is contained in:
commit
ee9dc37e04
@ -19,10 +19,11 @@ in
|
|||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = targetPrefix + basename;
|
name = targetPrefix + basename;
|
||||||
|
|
||||||
src = fetchurl {
|
# HACK to ensure that we preserve source from bootstrap binutils to not rebuild LLVM
|
||||||
|
src = stdenv.__bootPackages.binutils-unwrapped.src or (fetchurl {
|
||||||
url = "mirror://gnu/binutils/${basename}.tar.bz2";
|
url = "mirror://gnu/binutils/${basename}.tar.bz2";
|
||||||
sha256 = "028cklfqaab24glva1ks2aqa1zxa6w6xmc8q34zs1sb7h22dxspg";
|
sha256 = "028cklfqaab24glva1ks2aqa1zxa6w6xmc8q34zs1sb7h22dxspg";
|
||||||
};
|
});
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
# Turn on --enable-new-dtags by default to make the linker set
|
# Turn on --enable-new-dtags by default to make the linker set
|
||||||
|
@ -90,9 +90,14 @@ let
|
|||||||
'' + lib.optionalString hostPlatform.isDarwin ''
|
'' + lib.optionalString hostPlatform.isDarwin ''
|
||||||
export NIX_DONT_SET_RPATH=1
|
export NIX_DONT_SET_RPATH=1
|
||||||
export NIX_NO_SELF_RPATH=1
|
export NIX_NO_SELF_RPATH=1
|
||||||
'' + lib.optionalString targetPlatform.isDarwin ''
|
''
|
||||||
export NIX_TARGET_DONT_SET_RPATH=1
|
# TODO this should be uncommented, but it causes stupid mass rebuilds. I
|
||||||
'';
|
# think the best solution would just be to fixup linux RPATHs so we don't
|
||||||
|
# need to set `-rpath` anywhere.
|
||||||
|
# + lib.optionalString targetPlatform.isDarwin ''
|
||||||
|
# export NIX_TARGET_DONT_SET_RPATH=1
|
||||||
|
# ''
|
||||||
|
;
|
||||||
|
|
||||||
inherit initialPath shell
|
inherit initialPath shell
|
||||||
defaultNativeBuildInputs defaultBuildInputs;
|
defaultNativeBuildInputs defaultBuildInputs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user