summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.5.1/gcc-poison-parameters.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.5.1/gcc-poison-parameters.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.5.1/gcc-poison-parameters.patch85
1 files changed, 0 insertions, 85 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.1/gcc-poison-parameters.patch b/meta/recipes-devtools/gcc/gcc-4.5.1/gcc-poison-parameters.patch
deleted file mode 100644
index 74d45277e2..0000000000
--- a/meta/recipes-devtools/gcc/gcc-4.5.1/gcc-poison-parameters.patch
+++ /dev/null
@@ -1,85 +0,0 @@
1Upstream-Status: Pending
2
3gcc: add poison parameters detection
4
5Add the logic that, if not configured with "--enable-target-optspace",
6gcc will meet error when build target app with "-Os" option.
7This could avoid potential binary crash.
8
9Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
10
11diff --git a/gcc/config.in b/gcc/config.in
12index a9e208f..3004321 100644
13--- a/gcc/config.in
14+++ b/gcc/config.in
15@@ -132,6 +132,12 @@
16 #endif
17
18
19+/* Define to enable target optspace support. */
20+#ifndef USED_FOR_TARGET
21+#undef ENABLE_TARGET_OPTSPACE
22+#endif
23+
24+
25 /* Define if you want all operations on RTL (the basic data structure of the
26 optimizer and back end) to be checked for dynamic type safety at runtime.
27 This is quite expensive. */
28diff --git a/gcc/configure b/gcc/configure
29index 2e022ed..004ec0b 100755
30--- a/gcc/configure
31+++ b/gcc/configure
32@@ -909,6 +909,7 @@ enable_maintainer_mode
33 enable_version_specific_runtime_libs
34 with_slibdir
35 enable_plugin
36+enable_target_optspace
37 '
38 ac_precious_vars='build_alias
39 host_alias
40@@ -25289,6 +25290,13 @@ $as_echo "#define ENABLE_PLUGIN 1" >>confdefs.h
41
42 fi
43
44+if test x"$enable_target_optspace" != x; then :
45+
46+$as_echo "#define ENABLE_TARGET_OPTSPACE 1" >>confdefs.h
47+
48+fi
49+
50+
51 # Configure the subdirectories
52 # AC_CONFIG_SUBDIRS($subdirs)
53
54diff --git a/gcc/configure.ac b/gcc/configure.ac
55index ac4ca70..18ec0aa 100644
56--- a/gcc/configure.ac
57+++ b/gcc/configure.ac
58@@ -4434,6 +4434,11 @@ if test x"$enable_plugin" = x"yes"; then
59 AC_DEFINE(ENABLE_PLUGIN, 1, [Define to enable plugin support.])
60 fi
61
62+AC_SUBST(enable_target_optspace)
63+if test x"$enable_target_optspace" != x; then
64+ AC_DEFINE(ENABLE_TARGET_OPTSPACE, 1, [Define to enable target optspace support.])
65+fi
66+
67 # Configure the subdirectories
68 # AC_CONFIG_SUBDIRS($subdirs)
69
70diff --git a/gcc/opts.c b/gcc/opts.c
71index 139cd26..2fdd96a 100644
72--- a/gcc/opts.c
73+++ b/gcc/opts.c
74@@ -945,6 +945,11 @@ decode_options (unsigned int argc, const char **argv)
75 else
76 set_param_value ("min-crossjump-insns", initial_min_crossjump_insns);
77
78+#ifndef ENABLE_TARGET_OPTSPACE
79+ if (optimize_size == 1)
80+ error ("Do not use -Os option if --enable-target-optspace is not set.");
81+#endif
82+
83 if (first_time_p)
84 {
85 /* Initialize whether `char' is signed. */