summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-poison-parameters.patch
diff options
context:
space:
mode:
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,