I made changes to achieve a working cross-built gcc wrapper. Now,
"gcc45.hostDrv" works in the host system, together with libc, binutils, dynamic linker, ... svn path=/nixpkgs/branches/stdenv-updates/; revision=24971
This commit is contained in:
parent
cd9d91306c
commit
1b62c9c061
@ -52,6 +52,22 @@ stdenv.mkDerivation {
|
|||||||
zlib = if (gcc != null && gcc ? langVhdl) then zlib else null;
|
zlib = if (gcc != null && gcc ? langVhdl) then zlib else null;
|
||||||
shell = if shell == "" then stdenv.shell else shell;
|
shell = if shell == "" then stdenv.shell else shell;
|
||||||
|
|
||||||
|
crossAttrs = {
|
||||||
|
shell = shell.hostDrv + "${shell.hostDrv.shellPath}";
|
||||||
|
libc = libc.hostDrv;
|
||||||
|
coreutils = coreutils.hostDrv;
|
||||||
|
binutils = binutils.hostDrv;
|
||||||
|
gcc = gcc.hostDrv;
|
||||||
|
#
|
||||||
|
# This is not the best way to do this. I think the reference should be
|
||||||
|
# the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
|
||||||
|
# do this sufficient if/else.
|
||||||
|
dynamicLinker =
|
||||||
|
(if stdenv.cross.arch == "arm" then "ld-linux.so.3" else
|
||||||
|
if stdenv.cross.arch == "mips" then "ld.so.1" else
|
||||||
|
abort "don't know the name of the dynamic linker for this platform");
|
||||||
|
};
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
let gcc_ = if gcc != null then gcc else {}; in
|
let gcc_ = if gcc != null then gcc else {}; in
|
||||||
(if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) //
|
(if gcc_ ? meta then removeAttrs gcc.meta ["priority"] else {}) //
|
||||||
|
@ -15,7 +15,9 @@ let
|
|||||||
|
|
||||||
needsPortsNative = stdenv.isMips || stdenv.isArm;
|
needsPortsNative = stdenv.isMips || stdenv.isArm;
|
||||||
needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
|
needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
|
||||||
needsPorts = if cross == null then needsPortsNative else needsPortsCross;
|
needsPorts = if (stdenv ? cross) && stdenv.cross != null then true
|
||||||
|
else if cross == null then needsPortsNative
|
||||||
|
else needsPortsCross;
|
||||||
|
|
||||||
srcPorts = fetchurl {
|
srcPorts = fetchurl {
|
||||||
# A tarball I manually made from a git clone, for the tag "glibc-2.12.1".
|
# A tarball I manually made from a git clone, for the tag "glibc-2.12.1".
|
||||||
|
@ -81,4 +81,8 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
maintainers = [ stdenv.lib.maintainers.ludo ];
|
maintainers = [ stdenv.lib.maintainers.ludo ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
shellPath = "/bin/bash";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -2052,6 +2052,7 @@ let
|
|||||||
nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else "";
|
nativePrefix = if stdenv ? gcc then stdenv.gcc.nativePrefix else "";
|
||||||
gcc = baseGCC;
|
gcc = baseGCC;
|
||||||
libc = glibc;
|
libc = glibc;
|
||||||
|
shell = bash;
|
||||||
inherit stdenv binutils coreutils zlib;
|
inherit stdenv binutils coreutils zlib;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2917,13 +2918,13 @@ let
|
|||||||
installLocales = getPkgConfig "glibc" "locales" false;
|
installLocales = getPkgConfig "glibc" "locales" false;
|
||||||
});
|
});
|
||||||
|
|
||||||
glibc212 = callPackage ../development/libraries/glibc-2.12 {
|
glibc212 = (callPackage ../development/libraries/glibc-2.12 {
|
||||||
kernelHeaders = linuxHeaders;
|
kernelHeaders = linuxHeaders;
|
||||||
installLocales = getPkgConfig "glibc" "locales" false;
|
installLocales = getPkgConfig "glibc" "locales" false;
|
||||||
machHeaders = null;
|
machHeaders = null;
|
||||||
hurdHeaders = null;
|
hurdHeaders = null;
|
||||||
gccCross = null;
|
gccCross = null;
|
||||||
};
|
}) // { hostDrv = glibc212Cross; };
|
||||||
|
|
||||||
glibc212Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.12)
|
glibc212Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc-2.12)
|
||||||
(let crossGNU = (crossSystem != null && crossSystem.config == "i586-pc-gnu");
|
(let crossGNU = (crossSystem != null && crossSystem.config == "i586-pc-gnu");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user