Making the cross-built packages not depend on the gcc cross compiler directly,
but on a nix-store path only having the cross-built gcc libraries. This trims down a lot the runtime dependency tree for cross-built packages. I also remove the glibc dependency on the native bash. svn path=/nixpkgs/branches/stdenv-updates/; revision=23040
This commit is contained in:
parent
eddc9d6ab5
commit
ae3383e001
@ -38,7 +38,10 @@ if test -n "$nativeTools"; then
|
|||||||
gccPath="$nativePrefix/bin"
|
gccPath="$nativePrefix/bin"
|
||||||
ldPath="$nativePrefix/bin"
|
ldPath="$nativePrefix/bin"
|
||||||
else
|
else
|
||||||
ldflags="$ldflags -L$gcc/lib"
|
if test -n "$gccLibs"; then
|
||||||
|
ldflags="$ldflags -L$gccLibs/lib -L$gccLibs/lib64"
|
||||||
|
fi
|
||||||
|
ldflags="$ldflags -L$gcc/lib -L$gcc/lib64"
|
||||||
gccPath="$gcc/bin"
|
gccPath="$gcc/bin"
|
||||||
ldPath="$binutils/$crossConfig/bin"
|
ldPath="$binutils/$crossConfig/bin"
|
||||||
fi
|
fi
|
||||||
|
@ -13,6 +13,20 @@ assert nativeTools -> nativePrefix != "";
|
|||||||
assert !nativeTools -> gcc != null && binutils != null;
|
assert !nativeTools -> gcc != null && binutils != null;
|
||||||
assert !noLibc -> (!nativeLibc -> libc != null);
|
assert !noLibc -> (!nativeLibc -> libc != null);
|
||||||
|
|
||||||
|
let
|
||||||
|
chosenName = if name == "" then gcc.name else name;
|
||||||
|
gccLibs = stdenv.mkDerivation {
|
||||||
|
name = chosenName + "-libs";
|
||||||
|
phases = [ "installPhase" ];
|
||||||
|
installPhase = ''
|
||||||
|
ensureDir $out
|
||||||
|
cp -Rd ${gcc}/lib $out/lib
|
||||||
|
if [ -d ${gcc}/lib64 ]; then
|
||||||
|
cp -Rd ${gcc}/lib64 $out/lib64
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
setupHook = ./setup-hook.sh;
|
setupHook = ./setup-hook.sh;
|
||||||
@ -22,7 +36,8 @@ stdenv.mkDerivation {
|
|||||||
addFlags = ./add-flags;
|
addFlags = ./add-flags;
|
||||||
inherit nativeTools nativeLibc nativePrefix gcc libc binutils;
|
inherit nativeTools nativeLibc nativePrefix gcc libc binutils;
|
||||||
crossConfig = if (cross != null) then cross.config else null;
|
crossConfig = if (cross != null) then cross.config else null;
|
||||||
name = if name == "" then gcc.name else name;
|
gccLibs = if gcc != null then gccLibs else null;
|
||||||
|
name = chosenName;
|
||||||
langC = if nativeTools then true else gcc.langC;
|
langC = if nativeTools then true else gcc.langC;
|
||||||
langCC = if nativeTools then true else gcc.langCC;
|
langCC = if nativeTools then true else gcc.langCC;
|
||||||
langF77 = if nativeTools then false else gcc ? langFortran;
|
langF77 = if nativeTools then false else gcc ? langFortran;
|
||||||
|
@ -74,5 +74,10 @@ in
|
|||||||
|
|
||||||
dontStrip=1
|
dontStrip=1
|
||||||
'';
|
'';
|
||||||
}
|
|
||||||
|
# To avoid a dependency on the build system 'bash'.
|
||||||
|
preFixup = ''
|
||||||
|
rm $out/bin/{ldd,tzselect,catchsegv,xtrace}
|
||||||
|
'';
|
||||||
|
}
|
||||||
else {}))
|
else {}))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user