summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-poison-parameters.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-04-19 21:27:09 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-04-28 10:44:21 +0100
commit3669de7f96100a5d4fbfc9b4e2ebc16851ba98ea (patch)
tree66743557d4203b019988970a6fa3ac603c06c991 /meta/recipes-devtools/gcc/gcc-4.6.0/gcc-poison-parameters.patch
parent07a6bec75c59fec06d0947ada708482900bf067a (diff)
downloadpoky-3669de7f96100a5d4fbfc9b4e2ebc16851ba98ea.tar.gz
gcc: Add recipes for 4.6.0
This is initial set of patches for testing them out The patches need documentation is pending Some patches especially uclibc related are not needed they must be dropped. (From OE-Core rev: 26858099bc104efc3b3d15d9298018285c551b9a) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-poison-parameters.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-poison-parameters.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-poison-parameters.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-poison-parameters.patch
new file mode 100644
index 0000000000..f36fa8195e
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-poison-parameters.patch
@@ -0,0 +1,74 @@
1gcc: add poison parameters detection
2
3Add the logic that, if not configured with "--enable-target-optspace",
4gcc will meet error when build target app with "-Os" option.
5This could avoid potential binary crash.
6
7Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
8
9Index: gcc-4.6.0/gcc/config.in
10===================================================================
11--- gcc-4.6.0.orig/gcc/config.in
12+++ gcc-4.6.0/gcc/config.in
13@@ -150,6 +150,12 @@
14 #endif
15
16
17+/* Define to enable target optspace support. */
18+#ifndef USED_FOR_TARGET
19+#undef ENABLE_TARGET_OPTSPACE
20+#endif
21+
22+
23 /* Define if you want all operations on RTL (the basic data structure of the
24 optimizer and back end) to be checked for dynamic type safety at runtime.
25 This is quite expensive. */
26Index: gcc-4.6.0/gcc/configure
27===================================================================
28--- gcc-4.6.0.orig/gcc/configure
29+++ gcc-4.6.0/gcc/configure
30@@ -26434,6 +26434,13 @@ $as_echo "#define ENABLE_LIBQUADMATH_SUP
31 fi
32
33
34+if test x"$enable_target_optspace" != x; then :
35+
36+$as_echo "#define ENABLE_TARGET_OPTSPACE 1" >>confdefs.h
37+
38+fi
39+
40+
41 # Configure the subdirectories
42 # AC_CONFIG_SUBDIRS($subdirs)
43
44Index: gcc-4.6.0/gcc/configure.ac
45===================================================================
46--- gcc-4.6.0.orig/gcc/configure.ac
47+++ gcc-4.6.0/gcc/configure.ac
48@@ -4907,6 +4907,11 @@ if test "${ENABLE_LIBQUADMATH_SUPPORT}"
49 fi
50
51
52+AC_SUBST(enable_target_optspace)
53+if test x"$enable_target_optspace" != x; then
54+ AC_DEFINE(ENABLE_TARGET_OPTSPACE, 1, [Define to enable target optspace support.])
55+fi
56+
57 # Configure the subdirectories
58 # AC_CONFIG_SUBDIRS($subdirs)
59
60Index: gcc-4.6.0/gcc/opts.c
61===================================================================
62--- gcc-4.6.0.orig/gcc/opts.c
63+++ gcc-4.6.0/gcc/opts.c
64@@ -605,6 +605,10 @@ default_options_optimization (struct gcc
65 maybe_set_param_value (PARAM_MIN_CROSSJUMP_INSNS,
66 default_param_value (PARAM_MIN_CROSSJUMP_INSNS),
67 opts->x_param_values, opts_set->x_param_values);
68+#ifndef ENABLE_TARGET_OPTSPACE
69+ if (optimize_size == 1)
70+ error ("Do not use -Os option if --enable-target-optspace is not set.");
71+#endif
72
73 /* Allow default optimizations to be specified on a per-machine basis. */
74 maybe_default_options (opts, opts_set,