* Trying to get gcc 4.2.0 to compile...

* Compute --enable-languages in the Nix expression instead of in the
  builder.
* Pass some flags through the Make command line instead of patching
  the Makefiles.
* gcc: generate code for i686 by default (instead of i386).
* gcc: patch out some references to /lib and /usr/lib.

svn path=/nixpkgs/trunk/; revision=8722
This commit is contained in:
Eelco Dolstra 2007-05-20 20:27:55 +00:00
parent 9e960a4fb6
commit b8dae869b3
3 changed files with 253 additions and 167 deletions

View File

@ -35,29 +35,24 @@ if test "$noSysDirs" = "1"; then
for i in $extraLDFlags; do for i in $extraLDFlags; do
export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i" export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
done done
export CFLAGS=$extraCFlags
export CXXFLAGS=$extraCFlags makeFlagsArray=( \
NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
LIMITS_H_TEST=true \
X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
)
fi fi
preConfigure=preConfigure preConfigure=preConfigure
preConfigure() { preConfigure() {
# Determine the frontends to build.
langs="c"
if test -n "$langCC"; then
langs="$langs,c++"
fi
if test -n "$langF77"; then
langs="$langs,f77"
fi
# Perform the build in a different directory. # Perform the build in a different directory.
mkdir ../build mkdir ../build
cd ../build cd ../build
configureScript=../$sourceRoot/configure configureScript=../$sourceRoot/configure
configureFlags="--enable-languages=$langs $configureFlags"
} }

View File

@ -6,6 +6,8 @@
assert langC; assert langC;
with import ../../../lib;
stdenv.mkDerivation { stdenv.mkDerivation {
name = "gcc-4.2.0"; name = "gcc-4.2.0";
builder = ./builder.sh; builder = ./builder.sh;
@ -26,22 +28,34 @@ stdenv.mkDerivation {
patches = patches =
[./pass-cxxcpp.patch] [./pass-cxxcpp.patch]
++ (if noSysDirs then [./no-sys-dirs.patch] else []); ++ optional noSysDirs [./no-sys-dirs.patch];
inherit noSysDirs langC langCC langF77 profiledCompiler staticCompiler; inherit noSysDirs profiledCompiler staticCompiler;
configureFlags = " configureFlags = "
--disable-multilib --disable-multilib
--disable-libstdcxx-pch --disable-libstdcxx-pch
--disable-libmudflap --disable-libmudflap
--disable-libssp --disable-libssp
--with-system-zlib
--enable-languages=${
concatStrings (intersperse ","
( optional langC "c"
++ optional langCC "c++"
++ optional langF77 "f77"
)
)
}
${if stdenv.isi686 then "--with-arch=i686" else ""}
"; ";
makeFlags = if staticCompiler then "LDFLAGS=-static" else ""; makeFlags = if staticCompiler then "LDFLAGS=-static" else "";
passthru = { inherit langC langCC langF77; };
meta = { meta = {
homepage = "http://gcc.gnu.org/"; homepage = "http://gcc.gnu.org/";
license = "GPL/LGPL"; license = "GPL/LGPL";
description = "GNU Compiler Collection, 4.1.x"; description = "GNU Compiler Collection, 4.2.x";
}; };
} }

View File

@ -1,150 +1,227 @@
diff -ruN gcc-4.1.0/gcc/cppdefault.c gcc-4.1.0.new/gcc/cppdefault.c diff -rc gcc-4.2.0-orig/Makefile.in gcc-4.2.0/Makefile.in
--- gcc-4.1.0/gcc/cppdefault.c 2005-06-25 04:02:01.000000000 +0200 *** gcc-4.2.0-orig/Makefile.in 2006-12-29 18:47:06.000000000 +0100
+++ gcc-4.1.0.new/gcc/cppdefault.c 2006-03-01 18:48:58.000000000 +0100 --- gcc-4.2.0/Makefile.in 2007-05-20 21:06:42.000000000 +0200
@@ -41,6 +41,10 @@ ***************
# undef CROSS_INCLUDE_DIR *** 364,369 ****
#endif --- 364,377 ----
@host_makefile_frag@
+#undef LOCAL_INCLUDE_DIR ###
+#undef SYSTEM_INCLUDE_DIR
+#undef STANDARD_INCLUDE_DIR + CFLAGS += $(NIX_EXTRA_CFLAGS)
+ + CPPFLAGS_FOR_TARGET += $(NIX_EXTRA_CFLAGS)
const struct default_include cpp_include_defaults[] + CXXFLAGS += $(NIX_EXTRA_CFLAGS)
#ifdef INCLUDE_DEFAULTS + LDFLAGS += $(NIX_EXTRA_LDFLAGS)
= INCLUDE_DEFAULTS; + LDFLAGS_FOR_TARGET += $(NIX_EXTRA_LDFLAGS)
diff -ruN gcc-4.1.0/gcc/Makefile.in gcc-4.1.0.new/gcc/Makefile.in + BOOT_CFLAGS += $(NIX_EXTRA_CFLAGS)
--- gcc-4.1.0/gcc/Makefile.in 2006-02-16 16:23:24.000000000 +0100 + BOOT_LDFLAGS += $(NIX_EXTRA_LDFLAGS)
+++ gcc-4.1.0.new/gcc/Makefile.in 2006-03-01 18:55:12.000000000 +0100 +
@@ -219,7 +219,7 @@ # This is the list of directories that may be needed in RPATH_ENVVAR
CPPFLAGS = @CPPFLAGS@ # so that prorgams built for the target machine work.
TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc)
# These exists to be overridden by the x-* and t-* files, respectively. diff -rc gcc-4.2.0-orig/gcc/Makefile.in gcc-4.2.0/gcc/Makefile.in
-X_CFLAGS = *** gcc-4.2.0-orig/gcc/Makefile.in 2007-03-12 05:40:09.000000000 +0100
+X_CFLAGS = $(NIX_EXTRA_CFLAGS) $(NIX_EXTRA_LDFLAGS) --- gcc-4.2.0/gcc/Makefile.in 2007-05-20 19:35:13.000000000 +0200
T_CFLAGS = ***************
*** 396,402 ****
X_CPPFLAGS = MD5_H = $(srcdir)/../include/md5.h
@@ -383,7 +383,11 @@
MD5_H = $(srcdir)/../include/md5.h # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
! NATIVE_SYSTEM_HEADER_DIR = /usr/include
# Default native SYSTEM_HEADER_DIR, to be overridden by targets. # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-NATIVE_SYSTEM_HEADER_DIR = /usr/include CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
+# `fixinc' from fixing header files in /usr/include. However, --- 396,406 ----
+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set MD5_H = $(srcdir)/../include/md5.h
+# it to some dummy directory.
+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY) # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets. ! # Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ ! # `fixinc' from fixing header files in /usr/include. However,
! # NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
@@ -395,7 +399,7 @@ ! # it to some dummy directory.
STMP_FIXINC = @STMP_FIXINC@ ! NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
# Test to see whether <limits.h> exists in the system header files. CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
+LIMITS_H_TEST = true ***************
*** 3066,3072 ****
# Directory for prefix to system directories, for -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
# each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc. -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
@@ -3002,7 +3006,7 @@ -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \ ! -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \ -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \ -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
- -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \ @TARGET_SYSTEM_ROOT_DEFINE@
+ -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \ --- 3070,3076 ----
-DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \ -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \ -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
@TARGET_SYSTEM_ROOT_DEFINE@ -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
diff -ruN gcc-4.2.0/libstdc++-v3/include/Makefile.in gcc-4.2.0.new/libstdc++-v3/include/Makefile.in ! -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
--- gcc-4.2.0/libstdc++-v3/include/Makefile.in 2007-04-13 01:06:37.000000000 +0200 -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
+++ gcc-4.2.0.new/libstdc++-v3/include/Makefile.in 2007-05-18 01:10:04.000000000 +0200 -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
@@ -1433,14 +1433,14 @@ @TARGET_SYSTEM_ROOT_DEFINE@
if [ ! -d "${pch1_output_builddir}" ]; then \ diff -rc gcc-4.2.0-orig/gcc/cppdefault.c gcc-4.2.0/gcc/cppdefault.c
mkdir -p ${pch1_output_builddir}; \ *** gcc-4.2.0-orig/gcc/cppdefault.c 2006-01-20 22:00:03.000000000 +0100
fi; \ --- gcc-4.2.0/gcc/cppdefault.c 2007-05-20 17:16:44.000000000 +0200
- $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O0 -g ${pch1_source} -o $@ ***************
+ $(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) -O0 -g ${pch1_source} -o $@ *** 41,46 ****
touch ${pch1_output_anchor} --- 41,50 ----
# undef CROSS_INCLUDE_DIR
${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source} #endif
if [ ! -d "${pch1_output_builddir}" ]; then \
mkdir -p ${pch1_output_builddir}; \ + #undef LOCAL_INCLUDE_DIR
fi; \ + #undef SYSTEM_INCLUDE_DIR
- $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch1_source} -o $@ + #undef STANDARD_INCLUDE_DIR
+ $(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch1_source} -o $@ +
touch ${pch1_output_anchor} const struct default_include cpp_include_defaults[]
#ifdef INCLUDE_DEFAULTS
# Build a precompiled TR1 include, stdtr1c++.h.gch/O2.gch = INCLUDE_DEFAULTS;
@@ -1448,7 +1448,7 @@ diff -rc gcc-4.2.0-orig/gcc/gcc.c gcc-4.2.0/gcc/gcc.c
if [ ! -d "${pch2_output_builddir}" ]; then \ *** gcc-4.2.0-orig/gcc/gcc.c 2007-03-05 21:37:05.000000000 +0100
mkdir -p ${pch2_output_builddir}; \ --- gcc-4.2.0/gcc/gcc.c 2007-05-20 17:49:48.000000000 +0200
fi; \ ***************
- $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch2_source} -o $@ *** 1449,1458 ****
+ $(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch2_source} -o $@ /* Default prefixes to attach to command names. */
touch ${pch2_output_anchor}
#ifndef STANDARD_STARTFILE_PREFIX_1
# Build a precompiled extension include, extc++.h.gch/O2.gch ! #define STANDARD_STARTFILE_PREFIX_1 "/lib/"
@@ -1456,7 +1456,7 @@ #endif
if [ ! -d "${pch3_output_builddir}" ]; then \ #ifndef STANDARD_STARTFILE_PREFIX_2
mkdir -p ${pch3_output_builddir}; \ ! #define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
fi; \ #endif
- $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch3_source} -o $@
+ $(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch3_source} -o $@ #ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */
touch ${pch3_output_anchor} --- 1449,1458 ----
/* Default prefixes to attach to command names. */
# For robustness sake (in light of junk files or in-source
diff -ruN gcc-4.1.0/ltcf-cxx.sh gcc-4.1.0.new/ltcf-cxx.sh #ifndef STANDARD_STARTFILE_PREFIX_1
--- gcc-4.1.0/ltcf-cxx.sh 2005-07-16 04:30:53.000000000 +0200 ! #define STANDARD_STARTFILE_PREFIX_1 ""
+++ gcc-4.1.0.new/ltcf-cxx.sh 2006-03-01 18:58:15.000000000 +0100 #endif
@@ -989,7 +989,7 @@ #ifndef STANDARD_STARTFILE_PREFIX_2
# the conftest object file. ! #define STANDARD_STARTFILE_PREFIX_2 ""
pre_test_object_deps_done=no #endif
- for p in `eval $output_verbose_link_cmd`; do #ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */
+ for p in `true`; do ***************
*** 1473,1480 ****
case $p in #endif
diff -ruN gcc-4.1.0/ltconfig gcc-4.1.0.new/ltconfig static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
--- gcc-4.1.0/ltconfig 2005-07-16 04:30:53.000000000 +0200 ! static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
+++ gcc-4.1.0.new/ltconfig 2006-03-01 18:59:58.000000000 +0100 ! static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
@@ -2322,6 +2322,11 @@ static const char *md_exec_prefix = MD_EXEC_PREFIX;
# A language-specific compiler.
CC=$CC static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
--- 1473,1480 ----
+# Ugly hack to get libmudflap (and possibly other libraries) to build. #endif
+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
+# to Glibc gets lost. Here we forcibly add it to any invocation. static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+CC="\$CC $NIX_EXTRA_LDFLAGS" ! static const char *const standard_exec_prefix_1 = "/no-such-path/";
+ ! static const char *const standard_exec_prefix_2 = "/no-such-path/";
# Is the compiler the GNU C compiler? static const char *md_exec_prefix = MD_EXEC_PREFIX;
with_gcc=$with_gcc
static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
diff -ruN gcc-4.1.0/Makefile.in gcc-4.1.0.new/Makefile.in diff -rc gcc-4.2.0-orig/libstdc++-v3/include/Makefile.in gcc-4.2.0/libstdc++-v3/include/Makefile.in
--- gcc-4.1.0/Makefile.in 2005-12-15 15:02:02.000000000 +0100 *** gcc-4.2.0-orig/libstdc++-v3/include/Makefile.in 2007-04-13 01:06:37.000000000 +0200
+++ gcc-4.1.0.new/Makefile.in 2006-03-01 19:41:04.000000000 +0100 --- gcc-4.2.0/libstdc++-v3/include/Makefile.in 2007-05-20 17:16:44.000000000 +0200
@@ -286,7 +286,7 @@ ***************
WINDRES = @WINDRES@ *** 1433,1446 ****
if [ ! -d "${pch1_output_builddir}" ]; then \
CFLAGS = @CFLAGS@ mkdir -p ${pch1_output_builddir}; \
-LDFLAGS = fi; \
+LDFLAGS = $(NIX_EXTRA_LDFLAGS) ! $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O0 -g ${pch1_source} -o $@
LIBCFLAGS = $(CFLAGS) touch ${pch1_output_anchor}
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates ${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source}
@@ -329,12 +329,12 @@ if [ ! -d "${pch1_output_builddir}" ]; then \
# CFLAGS will be just -g. We want to ensure that TARGET libraries mkdir -p ${pch1_output_builddir}; \
# (which we know are built with gcc) are built with optimizations so fi; \
# prepend -O2 when setting CFLAGS_FOR_TARGET. ! $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch1_source} -o $@
-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) touch ${pch1_output_anchor}
+CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(NIX_EXTRA_CFLAGS)
SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ # Build a precompiled TR1 include, stdtr1c++.h.gch/O2.gch
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) --- 1433,1446 ----
+CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(NIX_EXTRA_CFLAGS) if [ ! -d "${pch1_output_builddir}" ]; then \
LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) mkdir -p ${pch1_output_builddir}; \
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates fi; \
-LDFLAGS_FOR_TARGET = ! $(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) -O0 -g ${pch1_source} -o $@
+LDFLAGS_FOR_TARGET = $(NIX_EXTRA_LDFLAGS) touch ${pch1_output_anchor}
PICFLAG_FOR_TARGET =
${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source}
# ------------------------------------ if [ ! -d "${pch1_output_builddir}" ]; then \
mkdir -p ${pch1_output_builddir}; \
fi; \
! $(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch1_source} -o $@
touch ${pch1_output_anchor}
# Build a precompiled TR1 include, stdtr1c++.h.gch/O2.gch
***************
*** 1448,1454 ****
if [ ! -d "${pch2_output_builddir}" ]; then \
mkdir -p ${pch2_output_builddir}; \
fi; \
! $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch2_source} -o $@
touch ${pch2_output_anchor}
# Build a precompiled extension include, extc++.h.gch/O2.gch
--- 1448,1454 ----
if [ ! -d "${pch2_output_builddir}" ]; then \
mkdir -p ${pch2_output_builddir}; \
fi; \
! $(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch2_source} -o $@
touch ${pch2_output_anchor}
# Build a precompiled extension include, extc++.h.gch/O2.gch
***************
*** 1456,1462 ****
if [ ! -d "${pch3_output_builddir}" ]; then \
mkdir -p ${pch3_output_builddir}; \
fi; \
! $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch3_source} -o $@
touch ${pch3_output_anchor}
# For robustness sake (in light of junk files or in-source
--- 1456,1462 ----
if [ ! -d "${pch3_output_builddir}" ]; then \
mkdir -p ${pch3_output_builddir}; \
fi; \
! $(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch3_source} -o $@
touch ${pch3_output_anchor}
# For robustness sake (in light of junk files or in-source
diff -rc gcc-4.2.0-orig/ltcf-cxx.sh gcc-4.2.0/ltcf-cxx.sh
*** gcc-4.2.0-orig/ltcf-cxx.sh 2005-07-16 04:30:53.000000000 +0200
--- gcc-4.2.0/ltcf-cxx.sh 2007-05-20 17:16:44.000000000 +0200
***************
*** 989,995 ****
# the conftest object file.
pre_test_object_deps_done=no
! for p in `eval $output_verbose_link_cmd`; do
case $p in
--- 989,995 ----
# the conftest object file.
pre_test_object_deps_done=no
! for p in `true`; do
case $p in
diff -rc gcc-4.2.0-orig/ltconfig gcc-4.2.0/ltconfig
*** gcc-4.2.0-orig/ltconfig 2007-02-14 18:08:35.000000000 +0100
--- gcc-4.2.0/ltconfig 2007-05-20 22:16:24.000000000 +0200
***************
*** 2322,2327 ****
--- 2322,2332 ----
# A language-specific compiler.
CC=$CC
+ # Ugly hack to get libmudflap (and possibly other libraries) to build.
+ # Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
+ # to Glibc gets lost. Here we forcibly add it to any invocation.
+ CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
+
# Is the compiler the GNU C compiler?
with_gcc=$with_gcc