summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch114
1 files changed, 114 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000000..af0b81ba4c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
@@ -0,0 +1,114 @@
1Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it.
2
3This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET.
4
5Other changes I had to do include:
6
7- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though.
8
9- passing the right CFLAGS to configure scripts as exported environment variables
10
11I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do.
12
13Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3?
14
15Paolo
16
172008-02-19 Paolo Bonzini <bonzini@gnu.org>
18
19 PR bootstrap/32009
20 PR bootstrap/32161
21
22 * configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Compute here.
23 * configure: Regenerate.
24
25 * Makefile.def: Define stage_libcflags for all bootstrap stages.
26 * Makefile.tpl (BOOT_LIBCFLAGS, STAGE2_LIBCFLAGS, STAGE3_LIBCFLAGS,
27 STAGE4_LIBCFLAGS): New.
28 (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Subst from autoconf, without
29 $(SYSROOT_CFLAGS_FOR_TARGET) and $(DEBUG_PREFIX_CFLAGS_FOR_TARGET).
30 (BASE_TARGET_EXPORTS): Append them here to C{,XX}FLAGS.
31 (EXTRA_TARGET_FLAGS): Append them here to {LIB,}C{,XX}FLAGS.
32 (configure-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags
33 for target modules. Don't export LIBCFLAGS.
34 (all-stage[+id+]-[+prefix+][+module+]): Pass stage_libcflags; pass
35 $(BASE_FLAGS_TO_PASS) where [+args+] was passed, and [+args+] after
36 the overridden CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
37 (invocations of `all'): Replace $(TARGET_FLAGS_TO_PASS) with
38 $(EXTRA_TARGET_FLAGS), $(FLAGS_TO_PASS) with $(EXTRA_HOST_FLAGS).
39 * Makefile.in: Regenerate.
40
41config:
422008-02-19 Paolo Bonzini <bonzini@gnu.org>
43
44 PR bootstrap/32009
45 * mh-ppc-darwin (BOOT_CFLAGS): Reenable.
46
47gcc:
482008-02-19 Paolo Bonzini <bonzini@gnu.org>
49
50 PR bootstrap/32009
51 * doc/install.texi: Correct references to CFLAGS, replacing them
52 with BOOT_CFLAGS. Document flags used during bootstrap for
53 target libraries.
54
55
56---
57 Makefile.def | 25
58 Makefile.in | 1845 ++++++++++++++++++++++++++++++-------------------
59 Makefile.tpl | 91 +-
60 config/mh-ppc-darwin | 3
61 configure | 36
62 configure.ac | 32
63 gcc/Makefile.in | 2
64 gcc/configure | 6
65 gcc/configure.ac | 3
66 gcc/doc/install.texi | 56 -
67 libiberty/Makefile.in | 162 ++--
68 libiberty/configure | 46 -
69 libiberty/configure.ac | 43 -
70 13 files changed, 1454 insertions(+), 896 deletions(-)
71
72Index: gcc-4.5.0/configure
73===================================================================
74--- gcc-4.5.0.orig/configure 2010-06-25 14:51:59.409382073 -0700
75+++ gcc-4.5.0/configure 2010-06-25 14:52:35.157132702 -0700
76@@ -7130,6 +7130,38 @@
77 fi
78
79
80+# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
81+# might be empty or "-g". We don't require a C++ compiler, so CXXFLAGS
82+# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
83+# We want to ensure that TARGET libraries (which we know are built with
84+# gcc) are built with "-O2 -g", so include those options when setting
85+# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
86+if test "x$CFLAGS_FOR_TARGET" = x; then
87+ CFLAGS_FOR_TARGET=$CFLAGS
88+ case " $CFLAGS " in
89+ *" -O2 "*) ;;
90+ *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
91+ esac
92+ case " $CFLAGS " in
93+ *" -g "* | *" -g3 "*) ;;
94+ *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
95+ esac
96+fi
97+
98+
99+if test "x$CXXFLAGS_FOR_TARGET" = x; then
100+ CXXFLAGS_FOR_TARGET=$CXXFLAGS
101+ case " $CXXFLAGS " in
102+ *" -O2 "*) ;;
103+ *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
104+ esac
105+ case " $CXXFLAGS " in
106+ *" -g "* | *" -g3 "*) ;;
107+ *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
108+ esac
109+fi
110+
111+
112 # Handle --with-headers=XXX. If the value is not "yes", the contents of
113 # the named directory are copied to $(tooldir)/sys-include.
114 if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then