gcc: Fix building against the split Glibc
This commit is contained in:
@@ -29,7 +29,7 @@ if test "$noSysDirs" = "1"; then
|
|||||||
# Use *real* header files, otherwise a limits.h is generated
|
# Use *real* header files, otherwise a limits.h is generated
|
||||||
# that does not include Glibc's limits.h (notably missing
|
# that does not include Glibc's limits.h (notably missing
|
||||||
# SSIZE_MAX, which breaks the build).
|
# SSIZE_MAX, which breaks the build).
|
||||||
export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
|
export NIX_FIXINC_DUMMY=$libc_dev/include
|
||||||
|
|
||||||
# The path to the Glibc binaries such as `crti.o'.
|
# The path to the Glibc binaries such as `crti.o'.
|
||||||
glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib"
|
glibc_libdir="$(cat $NIX_GCC/nix-support/orig-libc)/lib"
|
||||||
@@ -170,9 +170,8 @@ preConfigure() {
|
|||||||
# Patch the configure script so it finds glibc headers. It's
|
# Patch the configure script so it finds glibc headers. It's
|
||||||
# important for example in order not to get libssp built,
|
# important for example in order not to get libssp built,
|
||||||
# because its functionality is in glibc already.
|
# because its functionality is in glibc already.
|
||||||
glibc_headers="$(cat $NIX_GCC/nix-support/orig-libc)/include"
|
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "s,glibc_header_dir=/usr/include,glibc_header_dir=$glibc_headers", \
|
-e "s,glibc_header_dir=/usr/include,glibc_header_dir=$libc_dev/include", \
|
||||||
gcc/configure
|
gcc/configure
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ let version = "4.6.3";
|
|||||||
"-stage-final";
|
"-stage-final";
|
||||||
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
|
||||||
|
|
||||||
bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
|
bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@@ -187,13 +187,15 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
|
|
||||||
src = (import ./sources.nix) {
|
srcs = (import ./sources.nix) {
|
||||||
inherit fetchurl optional version;
|
inherit fetchurl optional version;
|
||||||
inherit langC langCC langFortran langJava langAda langGo;
|
inherit langC langCC langFortran langJava langAda langGo;
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit patches enableMultilib;
|
inherit patches enableMultilib;
|
||||||
|
|
||||||
|
libc_dev = stdenv.gcc.libc_dev;
|
||||||
|
|
||||||
postPatch =
|
postPatch =
|
||||||
if (stdenv.isGNU
|
if (stdenv.isGNU
|
||||||
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
|| (libcCross != null # e.g., building `gcc.crossDrv'
|
||||||
|
|||||||
Reference in New Issue
Block a user