GCC 4.6: Incorporate changes made in 4.5 to support cross-builds to GNU.
svn path=/nixpkgs/trunk/; revision=30628
This commit is contained in:
parent
46d3cd449f
commit
8404afcfe4
@ -5,11 +5,6 @@ export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
|
|||||||
mkdir $NIX_FIXINC_DUMMY
|
mkdir $NIX_FIXINC_DUMMY
|
||||||
|
|
||||||
|
|
||||||
# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
|
|
||||||
# Thing.
|
|
||||||
export CPP="gcc -E"
|
|
||||||
export CXXCPP="g++ -E"
|
|
||||||
|
|
||||||
if test "$staticCompiler" = "1"; then
|
if test "$staticCompiler" = "1"; then
|
||||||
EXTRA_LDFLAGS="-static"
|
EXTRA_LDFLAGS="-static"
|
||||||
else
|
else
|
||||||
|
@ -153,13 +153,17 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
postPatch =
|
postPatch =
|
||||||
if (stdenv.system == "i586-pc-gnu"
|
if (stdenv.system == "i586-pc-gnu"
|
||||||
|
|| (libcCross != null # e.g., building `gcc.hostDrv'
|
||||||
|
&& libcCross ? crossConfig
|
||||||
|
&& libcCross.crossConfig == "i586-pc-gnu")
|
||||||
|| (cross != null && cross.config == "i586-pc-gnu"
|
|| (cross != null && cross.config == "i586-pc-gnu"
|
||||||
&& libcCross != null))
|
&& libcCross != null))
|
||||||
then
|
then
|
||||||
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
# On GNU/Hurd glibc refers to Hurd & Mach headers and libpthread is not
|
||||||
# in glibc, so add the right `-I' flags to the default spec string.
|
# in glibc, so add the right `-I' flags to the default spec string.
|
||||||
|
assert libcCross != null -> libpthreadCross != null;
|
||||||
let
|
let
|
||||||
libc = if cross != null then libcCross else stdenv.glibc;
|
libc = if libcCross != null then libcCross else stdenv.glibc;
|
||||||
gnu_h = "gcc/config/gnu.h";
|
gnu_h = "gcc/config/gnu.h";
|
||||||
i386_gnu_h = "gcc/config/i386/gnu.h";
|
i386_gnu_h = "gcc/config/i386/gnu.h";
|
||||||
extraCPPDeps =
|
extraCPPDeps =
|
||||||
@ -181,12 +185,18 @@ stdenv.mkDerivation ({
|
|||||||
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
|
echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
|
||||||
sed -i "${gnu_h}" \
|
sed -i "${gnu_h}" \
|
||||||
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
-es'|LIB_SPEC *"\(.*\)$|LIB_SPEC "${extraLibSpec} \1|g'
|
||||||
|
|
||||||
|
echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
|
||||||
|
sed -i "${gnu_h}" \
|
||||||
|
-es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
|
||||||
|
sed -i gcc/config/t-gnu \
|
||||||
|
-es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc}/include|g'
|
||||||
''
|
''
|
||||||
else if cross != null || stdenv.gcc.libc != null then
|
else if cross != null || stdenv.gcc.libc != null then
|
||||||
# On NixOS, use the right path to the dynamic linker instead of
|
# On NixOS, use the right path to the dynamic linker instead of
|
||||||
# `/lib/ld*.so'.
|
# `/lib/ld*.so'.
|
||||||
let
|
let
|
||||||
libc = if (cross != null && libcCross != null) then libcCross else stdenv.gcc.libc;
|
libc = if (libcCross != null) then libcCross else stdenv.gcc.libc;
|
||||||
in
|
in
|
||||||
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
|
'' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
|
||||||
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
|
for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
|
||||||
|
Loading…
x
Reference in New Issue
Block a user