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