3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/gcc-4.2/no-sys-dirs.patch
Armijn Hemel 8191ee8927 fix patch, still does not build cleanly
svn path=/nixpkgs/trunk/; revision=8716
2007-05-17 23:37:57 +00:00

151 lines
5.8 KiB
Diff

diff -ruN gcc-4.1.0/gcc/cppdefault.c gcc-4.1.0.new/gcc/cppdefault.c
--- gcc-4.1.0/gcc/cppdefault.c 2005-06-25 04:02:01.000000000 +0200
+++ gcc-4.1.0.new/gcc/cppdefault.c 2006-03-01 18:48:58.000000000 +0100
@@ -41,6 +41,10 @@
# undef CROSS_INCLUDE_DIR
#endif
+#undef LOCAL_INCLUDE_DIR
+#undef SYSTEM_INCLUDE_DIR
+#undef STANDARD_INCLUDE_DIR
+
const struct default_include cpp_include_defaults[]
#ifdef INCLUDE_DEFAULTS
= INCLUDE_DEFAULTS;
diff -ruN gcc-4.1.0/gcc/Makefile.in gcc-4.1.0.new/gcc/Makefile.in
--- gcc-4.1.0/gcc/Makefile.in 2006-02-16 16:23:24.000000000 +0100
+++ gcc-4.1.0.new/gcc/Makefile.in 2006-03-01 18:55:12.000000000 +0100
@@ -219,7 +219,7 @@
CPPFLAGS = @CPPFLAGS@
# These exists to be overridden by the x-* and t-* files, respectively.
-X_CFLAGS =
+X_CFLAGS = $(NIX_EXTRA_CFLAGS) $(NIX_EXTRA_LDFLAGS)
T_CFLAGS =
X_CPPFLAGS =
@@ -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
+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
+# `fixinc' from fixing header files in /usr/include. However,
+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
+# it to some dummy directory.
+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
# Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
@@ -395,7 +399,7 @@
STMP_FIXINC = @STMP_FIXINC@
# Test to see whether <limits.h> exists in the system header files.
-LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
+LIMITS_H_TEST = true
# Directory for prefix to system directories, for
# each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
@@ -3002,7 +3006,7 @@
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
- -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
+ -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
@TARGET_SYSTEM_ROOT_DEFINE@
diff -ruN gcc-4.2.0/libstdc++-v3/include/Makefile.in gcc-4.2.0.new/libstdc++-v3/include/Makefile.in
--- gcc-4.2.0/libstdc++-v3/include/Makefile.in 2007-04-13 01:06:37.000000000 +0200
+++ gcc-4.2.0.new/libstdc++-v3/include/Makefile.in 2007-05-18 01:10:04.000000000 +0200
@@ -1433,14 +1433,14 @@
if [ ! -d "${pch1_output_builddir}" ]; then \
mkdir -p ${pch1_output_builddir}; \
fi; \
- $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O0 -g ${pch1_source} -o $@
+ $(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) -O0 -g ${pch1_source} -o $@
touch ${pch1_output_anchor}
${pch1b_output}: ${allstamped} ${host_builddir}/c++config.h ${pch1_source}
if [ ! -d "${pch1_output_builddir}" ]; then \
mkdir -p ${pch1_output_builddir}; \
fi; \
- $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch1_source} -o $@
+ $(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,7 +1448,7 @@
if [ ! -d "${pch2_output_builddir}" ]; then \
mkdir -p ${pch2_output_builddir}; \
fi; \
- $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch2_source} -o $@
+ $(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,7 +1456,7 @@
if [ ! -d "${pch3_output_builddir}" ]; then \
mkdir -p ${pch3_output_builddir}; \
fi; \
- $(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) -O2 -g ${pch3_source} -o $@
+ $(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 -ruN gcc-4.1.0/ltcf-cxx.sh gcc-4.1.0.new/ltcf-cxx.sh
--- gcc-4.1.0/ltcf-cxx.sh 2005-07-16 04:30:53.000000000 +0200
+++ gcc-4.1.0.new/ltcf-cxx.sh 2006-03-01 18:58:15.000000000 +0100
@@ -989,7 +989,7 @@
# the conftest object file.
pre_test_object_deps_done=no
- for p in `eval $output_verbose_link_cmd`; do
+ for p in `true`; do
case $p in
diff -ruN gcc-4.1.0/ltconfig gcc-4.1.0.new/ltconfig
--- gcc-4.1.0/ltconfig 2005-07-16 04:30:53.000000000 +0200
+++ gcc-4.1.0.new/ltconfig 2006-03-01 18:59:58.000000000 +0100
@@ -2322,6 +2322,11 @@
# 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_LDFLAGS"
+
# Is the compiler the GNU C compiler?
with_gcc=$with_gcc
diff -ruN gcc-4.1.0/Makefile.in gcc-4.1.0.new/Makefile.in
--- gcc-4.1.0/Makefile.in 2005-12-15 15:02:02.000000000 +0100
+++ gcc-4.1.0.new/Makefile.in 2006-03-01 19:41:04.000000000 +0100
@@ -286,7 +286,7 @@
WINDRES = @WINDRES@
CFLAGS = @CFLAGS@
-LDFLAGS =
+LDFLAGS = $(NIX_EXTRA_LDFLAGS)
LIBCFLAGS = $(CFLAGS)
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
@@ -329,12 +329,12 @@
# CFLAGS will be just -g. We want to ensure that TARGET libraries
# (which we know are built with gcc) are built with optimizations so
# prepend -O2 when setting CFLAGS_FOR_TARGET.
-CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
+CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(NIX_EXTRA_CFLAGS)
SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
+CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(NIX_EXTRA_CFLAGS)
LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
-LDFLAGS_FOR_TARGET =
+LDFLAGS_FOR_TARGET = $(NIX_EXTRA_LDFLAGS)
PICFLAG_FOR_TARGET =
# ------------------------------------