* nativeGlibc -> nativeLibc (gcc-cross-wrapper is probably broken
right now; should merge gcc-wrapper changes). svn path=/nixpkgs/trunk/; revision=6876
This commit is contained in:
parent
c43f885d2d
commit
01fbf62a2c
@ -5,7 +5,7 @@ source $substitute
|
|||||||
# Force gcc to use ld-wrapper.sh when calling ld.
|
# Force gcc to use ld-wrapper.sh when calling ld.
|
||||||
cflagsCompile="-B$out/bin/"
|
cflagsCompile="-B$out/bin/"
|
||||||
|
|
||||||
if test -z "$nativeGlibc"; then
|
if test -z "$nativeLibc"; then
|
||||||
# The "-B$glibc/lib/" flag is a quick hack to force gcc to link
|
# The "-B$glibc/lib/" flag is a quick hack to force gcc to link
|
||||||
# against the crt1.o from our own glibc, rather than the one in
|
# against the crt1.o from our own glibc, rather than the one in
|
||||||
# /usr/lib. The real solution is of course to prevent those paths
|
# /usr/lib. The real solution is of course to prevent those paths
|
||||||
@ -13,10 +13,10 @@ if test -z "$nativeGlibc"; then
|
|||||||
# The dynamic linker is passed in `ldflagsBefore' to allow
|
# The dynamic linker is passed in `ldflagsBefore' to allow
|
||||||
# explicit overrides of the dynamic linker by callers to gcc/ld
|
# explicit overrides of the dynamic linker by callers to gcc/ld
|
||||||
# (the *last* value counts, so ours should come first).
|
# (the *last* value counts, so ours should come first).
|
||||||
cflagsCompile="$cflagsCompile -B$glibc/usr/lib/ -isystem $glibc/usr/include"
|
cflagsCompile="$cflagsCompile -B$libc/usr/lib/ -isystem $libc/usr/include"
|
||||||
ldflags="$ldflags -L$glibc/usr/lib"
|
ldflags="$ldflags -L$libc/usr/lib"
|
||||||
#ldflagsBefore="-dynamic-linker $glibc/lib/ld-linux.so.2"
|
#ldflagsBefore="-dynamic-linker $libc/lib/ld-linux.so.2"
|
||||||
ldflagsBefore="-dynamic-linker $glibc/lib/ld-uClibc.so.0"
|
ldflagsBefore="-dynamic-linker $libc/lib/ld-uClibc.so.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$nativeTools"; then
|
if test -n "$nativeTools"; then
|
||||||
@ -43,7 +43,7 @@ doSubstitute() {
|
|||||||
--subst-var "gcc" \
|
--subst-var "gcc" \
|
||||||
--subst-var "gccProg" \
|
--subst-var "gccProg" \
|
||||||
--subst-var "binutils" \
|
--subst-var "binutils" \
|
||||||
--subst-var "glibc" \
|
--subst-var "libc" \
|
||||||
--subst-var "cflagsCompile" \
|
--subst-var "cflagsCompile" \
|
||||||
--subst-var "cflagsLink" \
|
--subst-var "cflagsLink" \
|
||||||
--subst-var "ldflags" \
|
--subst-var "ldflags" \
|
||||||
@ -91,7 +91,7 @@ chmod +x "$out/bin/$cross-ld"
|
|||||||
# Emit a setup hook. Also store the path to the original GCC and
|
# Emit a setup hook. Also store the path to the original GCC and
|
||||||
# Glibc.
|
# Glibc.
|
||||||
test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc
|
test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc
|
||||||
test -n "$glibc" && echo $glibc > $out/nix-support/orig-glibc
|
test -n "$libc" && echo $libc > $out/nix-support/orig-libc
|
||||||
|
|
||||||
doSubstitute "$addFlags" "$out/nix-support/add-flags"
|
doSubstitute "$addFlags" "$out/nix-support/add-flags"
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
# stdenv.mkDerivation provides a wrapper that sets up the right environment
|
# stdenv.mkDerivation provides a wrapper that sets up the right environment
|
||||||
# variables so that the compiler and the linker just "work".
|
# variables so that the compiler and the linker just "work".
|
||||||
|
|
||||||
{ name ? "", stdenv, nativeTools, nativeGlibc, nativePrefix ? ""
|
{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
|
||||||
, gcc ? null, glibc ? null, binutils ? null, shell ? "", cross ? ""
|
, gcc ? null, libc ? null, binutils ? null, shell ? "", cross ? ""
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert nativeTools -> nativePrefix != "";
|
assert nativeTools -> nativePrefix != "";
|
||||||
assert !nativeTools -> gcc != null && binutils != null;
|
assert !nativeTools -> gcc != null && binutils != null;
|
||||||
assert !nativeGlibc -> glibc != null;
|
assert !nativeLibc -> libc != null;
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
@ -21,7 +21,7 @@ stdenv.mkDerivation {
|
|||||||
ldWrapper = ./ld-wrapper.sh;
|
ldWrapper = ./ld-wrapper.sh;
|
||||||
utils = ./utils.sh;
|
utils = ./utils.sh;
|
||||||
addFlags = ./add-flags;
|
addFlags = ./add-flags;
|
||||||
inherit nativeTools nativeGlibc nativePrefix gcc glibc binutils cross;
|
inherit nativeTools nativeLibc nativePrefix gcc libc binutils cross;
|
||||||
name = if name == "" then gcc.name else name;
|
name = if name == "" then gcc.name else name;
|
||||||
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;
|
||||||
|
@ -10,7 +10,7 @@ genericStdenv {
|
|||||||
gcc = gccWrapper {
|
gcc = gccWrapper {
|
||||||
name = "gcc-native";
|
name = "gcc-native";
|
||||||
nativeTools = true;
|
nativeTools = true;
|
||||||
nativeGlibc = true;
|
nativeLibc = true;
|
||||||
nativePrefix = "/usr";
|
nativePrefix = "/usr";
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@ genericStdenv {
|
|||||||
gcc = gccWrapper {
|
gcc = gccWrapper {
|
||||||
name = "gcc-darwin";
|
name = "gcc-darwin";
|
||||||
nativeTools = true;
|
nativeTools = true;
|
||||||
nativeGlibc = true;
|
nativeLibc = true;
|
||||||
nativePrefix = "/usr";
|
nativePrefix = "/usr";
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@ genericStdenv {
|
|||||||
gcc = gccWrapper {
|
gcc = gccWrapper {
|
||||||
name = "gcc-native";
|
name = "gcc-native";
|
||||||
nativeTools = true;
|
nativeTools = true;
|
||||||
nativeGlibc = true;
|
nativeLibc = true;
|
||||||
nativePrefix = "/usr";
|
nativePrefix = "/usr";
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user