summaryrefslogtreecommitdiffstats
path: root/toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-poison-parameters.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-03-23 08:22:26 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2012-03-24 07:35:22 +0100
commitff0f815593c33f1a82ba4d1cbe41e6b987da1f47 (patch)
tree22b43fa2e84f25cc948df79f9e9de07e8ec57418 /toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-poison-parameters.patch
parent6b22bd198a87b5f113971d8fcd0e7211cd143c7d (diff)
downloadmeta-openembedded-ff0f815593c33f1a82ba4d1cbe41e6b987da1f47.tar.gz
toolchain-layer: move binutils and gcc from meta-oe into here
Acked-by: Martin Jansa <Martin.Jansa@gmail.com> Acked-by: Eric Bénard <eric@eukrea.com> Acked-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-poison-parameters.patch')
-rw-r--r--toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-poison-parameters.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-poison-parameters.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-poison-parameters.patch
new file mode 100644
index 0000000000..ba20e8b15e
--- /dev/null
+++ b/toolchain-layer/recipes-devtools/gcc/gcc-4.5/gcc-poison-parameters.patch
@@ -0,0 +1,83 @@
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_5-branch/gcc/config.in
10===================================================================
11--- gcc-4_5-branch.orig/gcc/config.in
12+++ gcc-4_5-branch/gcc/config.in
13@@ -138,6 +138,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_5-branch/gcc/configure
27===================================================================
28--- gcc-4_5-branch.orig/gcc/configure
29+++ gcc-4_5-branch/gcc/configure
30@@ -915,6 +915,7 @@ enable_version_specific_runtime_libs
31 with_slibdir
32 enable_poison_system_directories
33 enable_plugin
34+enable_target_optspace
35 '
36 ac_precious_vars='build_alias
37 host_alias
38@@ -25658,6 +25659,13 @@ $as_echo "#define ENABLE_PLUGIN 1" >>con
39
40 fi
41
42+if test x"$enable_target_optspace" != x; then :
43+
44+$as_echo "#define ENABLE_TARGET_OPTSPACE 1" >>confdefs.h
45+
46+fi
47+
48+
49 # Configure the subdirectories
50 # AC_CONFIG_SUBDIRS($subdirs)
51
52Index: gcc-4_5-branch/gcc/configure.ac
53===================================================================
54--- gcc-4_5-branch.orig/gcc/configure.ac
55+++ gcc-4_5-branch/gcc/configure.ac
56@@ -4659,6 +4659,11 @@ if test x"$enable_plugin" = x"yes"; then
57 AC_DEFINE(ENABLE_PLUGIN, 1, [Define to enable plugin support.])
58 fi
59
60+AC_SUBST(enable_target_optspace)
61+if test x"$enable_target_optspace" != x; then
62+ AC_DEFINE(ENABLE_TARGET_OPTSPACE, 1, [Define to enable target optspace support.])
63+fi
64+
65 # Configure the subdirectories
66 # AC_CONFIG_SUBDIRS($subdirs)
67
68Index: gcc-4_5-branch/gcc/opts.c
69===================================================================
70--- gcc-4_5-branch.orig/gcc/opts.c
71+++ gcc-4_5-branch/gcc/opts.c
72@@ -953,6 +953,11 @@ decode_options (unsigned int argc, const
73 else
74 set_param_value ("min-crossjump-insns", initial_min_crossjump_insns);
75
76+#ifndef ENABLE_TARGET_OPTSPACE
77+ if (optimize_size == 1)
78+ error ("Do not use -Os option if --enable-target-optspace is not set.");
79+#endif
80+
81 if (first_time_p)
82 {
83 /* Initialize whether `char' is signed. */