summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2010-09-25 10:16:26 +0800
committerSaul Wold <Saul.Wold@intel.com>2010-09-27 08:59:15 -0700
commitce456306dad3fdf42494830011dacae213c48edf (patch)
tree0dfca13c02aa1880a5353b21676cc48bd65834b9 /meta/recipes-devtools/gcc
parentb3ef7f59e2c7e7ea232b4a22bfaf423cd747c2a7 (diff)
downloadpoky-ce456306dad3fdf42494830011dacae213c48edf.tar.gz
gcc: enable poison parameters detection
If not configured with --enable-target-optspace, gcc will report errors if there is '-Os' optimization in parameters. This fixes [BUGID #342] Also add "--enable-target-optspace" option to arm gcc configuration. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Diffstat (limited to 'meta/recipes-devtools/gcc')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.5.0.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.5.0/gcc-poison-parameters.patch83
-rw-r--r--meta/recipes-devtools/gcc/gcc-configure-common.inc2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-kernel-3.4.4_csl-arm-2005q3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross_4.3.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross_csl-arm-2008q1.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk_4.3.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime_4.3.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc_4.3.3.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc_4.5.0.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc_csl-arm-2008q1.bb2
24 files changed, 106 insertions, 22 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0.inc b/meta/recipes-devtools/gcc/gcc-4.5.0.inc
index 6da8ddaa53..2b5c82975a 100644
--- a/meta/recipes-devtools/gcc/gcc-4.5.0.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.5.0.inc
@@ -48,6 +48,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
48 file://64bithack.patch \ 48 file://64bithack.patch \
49 file://optional_libstdc.patch \ 49 file://optional_libstdc.patch \
50 file://disable_relax_pic_calls_flag.patch \ 50 file://disable_relax_pic_calls_flag.patch \
51 file://gcc-poison-parameters.patch \
51 " 52 "
52 53
53SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 " 54SRC_URI_append_sh3 = " file://sh3-installfix-fixheaders.patch;patch=1 "
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-poison-parameters.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-poison-parameters.patch
new file mode 100644
index 0000000000..3cc7cbad4b
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.5.0/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
9diff --git a/gcc/config.in b/gcc/config.in
10index a9e208f..3004321 100644
11--- a/gcc/config.in
12+++ b/gcc/config.in
13@@ -132,6 +132,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. */
26diff --git a/gcc/configure b/gcc/configure
27index 2e022ed..004ec0b 100755
28--- a/gcc/configure
29+++ b/gcc/configure
30@@ -909,6 +909,7 @@ enable_maintainer_mode
31 enable_version_specific_runtime_libs
32 with_slibdir
33 enable_plugin
34+enable_target_optspace
35 '
36 ac_precious_vars='build_alias
37 host_alias
38@@ -25289,6 +25290,13 @@ $as_echo "#define ENABLE_PLUGIN 1" >>confdefs.h
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
52diff --git a/gcc/configure.ac b/gcc/configure.ac
53index ac4ca70..18ec0aa 100644
54--- a/gcc/configure.ac
55+++ b/gcc/configure.ac
56@@ -4434,6 +4434,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
68diff --git a/gcc/opts.c b/gcc/opts.c
69index 139cd26..2fdd96a 100644
70--- a/gcc/opts.c
71+++ b/gcc/opts.c
72@@ -945,6 +945,11 @@ decode_options (unsigned int argc, const char **argv)
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. */
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index d86cb9a0b6..9dd8feef7c 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -17,7 +17,7 @@ LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
17# hidden symbols in libgcc.a which linker complains 17# hidden symbols in libgcc.a which linker complains
18# when linking shared libraries further in the build like (gnutls) 18# when linking shared libraries further in the build like (gnutls)
19 19
20SPECIAL_ARCH_LIST = "powerpc arm" 20SPECIAL_ARCH_LIST = "powerpc"
21OPTSPACE = ${@base_contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}", "", "--enable-target-optspace",d)} 21OPTSPACE = ${@base_contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}", "", "--enable-target-optspace",d)}
22 22
23EXTRA_OECONF_BASE ?= "" 23EXTRA_OECONF_BASE ?= ""
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb
index 87cd27a95c..43bab3961d 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
5require gcc-configure-sdk.inc 5require gcc-configure-sdk.inc
6require gcc-package-sdk.inc 6require gcc-package-sdk.inc
7 7
8PR = "r18" 8PR = "r19"
9 9
10DEPENDS += "gmp-nativesdk mpfr-nativesdk" 10DEPENDS += "gmp-nativesdk mpfr-nativesdk"
11RDEPENDS_${PN} += "mpfr-nativesdk" 11RDEPENDS_${PN} += "mpfr-nativesdk"
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb
index a9f79b6509..37a0933bd2 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
5require gcc-configure-sdk.inc 5require gcc-configure-sdk.inc
6require gcc-package-sdk.inc 6require gcc-package-sdk.inc
7 7
8PR = "r8" 8PR = "r9"
9 9
10DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk" 10DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
11RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk" 11RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
index 38e0964fed..081b7d60fb 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
@@ -1,5 +1,5 @@
1require gcc-cross_${PV}.bb 1require gcc-cross_${PV}.bb
2require gcc-cross-initial.inc 2require gcc-cross-initial.inc
3 3
4PR = "r3" 4PR = "r4"
5 5
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb
index e05fb346e8..7072fdf4a0 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb
@@ -1,5 +1,5 @@
1require gcc-cross_${PV}.bb 1require gcc-cross_${PV}.bb
2require gcc-cross-initial.inc 2require gcc-cross-initial.inc
3 3
4PR = "r8" 4PR = "r9"
5 5
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb
index e65d5df671..9a30cb5119 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb
@@ -1,4 +1,4 @@
1require gcc-cross_${PV}.bb 1require gcc-cross_${PV}.bb
2require gcc-cross-intermediate.inc 2require gcc-cross-intermediate.inc
3PR = "r3" 3PR = "r4"
4 4
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb
index e0147743ee..bb145710c1 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb
@@ -1,4 +1,4 @@
1require gcc-cross_${PV}.bb 1require gcc-cross_${PV}.bb
2require gcc-cross-intermediate.inc 2require gcc-cross-intermediate.inc
3PR = "r8" 3PR = "r9"
4 4
diff --git a/meta/recipes-devtools/gcc/gcc-cross-kernel-3.4.4_csl-arm-2005q3.bb b/meta/recipes-devtools/gcc/gcc-cross-kernel-3.4.4_csl-arm-2005q3.bb
index 675d3e44af..88e38420eb 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-kernel-3.4.4_csl-arm-2005q3.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross-kernel-3.4.4_csl-arm-2005q3.bb
@@ -9,7 +9,7 @@ require gcc-cross-kernel.inc
9 9
10DEFAULT_PREFERENCE = "-1" 10DEFAULT_PREFERENCE = "-1"
11 11
12PR = "r3" 12PR = "r4"
13 13
14SRC_URI += "file://gcc-3.4.4-makefile-fix.patch;patch=1" 14SRC_URI += "file://gcc-3.4.4-makefile-fix.patch;patch=1"
15 15
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-cross_4.3.3.bb
index d22fb9ed22..5eaac5fa1b 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_4.3.3.bb
@@ -1,4 +1,4 @@
1PR = "r16" 1PR = "r17"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-cross4.inc 4require gcc-cross4.inc
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb
index d3a068e1f6..72032762bf 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb
@@ -1,4 +1,4 @@
1PR = "r9" 1PR = "r10"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-cross4.inc 4require gcc-cross4.inc
diff --git a/meta/recipes-devtools/gcc/gcc-cross_csl-arm-2008q1.bb b/meta/recipes-devtools/gcc/gcc-cross_csl-arm-2008q1.bb
index 7cef7e7a3a..89534f18ec 100644
--- a/meta/recipes-devtools/gcc/gcc-cross_csl-arm-2008q1.bb
+++ b/meta/recipes-devtools/gcc/gcc-cross_csl-arm-2008q1.bb
@@ -1,4 +1,4 @@
1PR = "r4" 1PR = "r5"
2 2
3require gcc-csl-arm-2008q1.inc 3require gcc-csl-arm-2008q1.inc
4require gcc-cross4.inc 4require gcc-cross4.inc
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
index 44dd50dcb8..5daa31b888 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
@@ -1,3 +1,3 @@
1require gcc-cross-initial_${PV}.bb 1require gcc-cross-initial_${PV}.bb
2require gcc-crosssdk-initial.inc 2require gcc-crosssdk-initial.inc
3PR = "r4" 3PR = "r5"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb
index 9daa2925b1..c14846a397 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb
@@ -1,4 +1,4 @@
1require gcc-cross-initial_${PV}.bb 1require gcc-cross-initial_${PV}.bb
2require gcc-crosssdk-initial.inc 2require gcc-crosssdk-initial.inc
3 3
4PR = "r8" 4PR = "r9"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb
index ae439622ac..cd1f96651b 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb
@@ -1,3 +1,3 @@
1require gcc-cross-intermediate_${PV}.bb 1require gcc-cross-intermediate_${PV}.bb
2require gcc-crosssdk-intermediate.inc 2require gcc-crosssdk-intermediate.inc
3PR = "r7" 3PR = "r8"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb
index eeb2d87d54..b8204c4dc6 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb
@@ -1,4 +1,4 @@
1require gcc-cross-intermediate_${PV}.bb 1require gcc-cross-intermediate_${PV}.bb
2require gcc-crosssdk-intermediate.inc 2require gcc-crosssdk-intermediate.inc
3 3
4PR = "r8" 4PR = "r9"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_4.3.3.bb
index ffbd671598..12de62ae3f 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk_4.3.3.bb
@@ -1,3 +1,3 @@
1require gcc-cross_${PV}.bb 1require gcc-cross_${PV}.bb
2require gcc-crosssdk.inc 2require gcc-crosssdk.inc
3PR="r2" 3PR="r3"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb
index ffb0739c5d..df4807d5ad 100644
--- a/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb
@@ -1,4 +1,4 @@
1require gcc-cross_${PV}.bb 1require gcc-cross_${PV}.bb
2require gcc-crosssdk.inc 2require gcc-crosssdk.inc
3 3
4PR = "r8" 4PR = "r9"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.3.3.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.3.3.bb
index 8c7c123f2e..6b375f323a 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_4.3.3.bb
@@ -1,4 +1,4 @@
1PR = "r16" 1PR = "r17"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-configure-runtime.inc 4require gcc-configure-runtime.inc
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb
index 79ce466a29..2bfc0df1cb 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb
@@ -1,4 +1,4 @@
1PR = "r8" 1PR = "r9"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-configure-runtime.inc 4require gcc-configure-runtime.inc
diff --git a/meta/recipes-devtools/gcc/gcc_4.3.3.bb b/meta/recipes-devtools/gcc/gcc_4.3.3.bb
index ca22e0f69c..582fff49ac 100644
--- a/meta/recipes-devtools/gcc/gcc_4.3.3.bb
+++ b/meta/recipes-devtools/gcc/gcc_4.3.3.bb
@@ -1,4 +1,4 @@
1PR = "r9" 1PR = "r10"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-configure-target.inc 4require gcc-configure-target.inc
diff --git a/meta/recipes-devtools/gcc/gcc_4.5.0.bb b/meta/recipes-devtools/gcc/gcc_4.5.0.bb
index a42fb39764..880c99c8e9 100644
--- a/meta/recipes-devtools/gcc/gcc_4.5.0.bb
+++ b/meta/recipes-devtools/gcc/gcc_4.5.0.bb
@@ -1,4 +1,4 @@
1PR = "r8" 1PR = "r9"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-configure-target.inc 4require gcc-configure-target.inc
diff --git a/meta/recipes-devtools/gcc/gcc_csl-arm-2008q1.bb b/meta/recipes-devtools/gcc/gcc_csl-arm-2008q1.bb
index 4999c6a53e..cc7540af15 100644
--- a/meta/recipes-devtools/gcc/gcc_csl-arm-2008q1.bb
+++ b/meta/recipes-devtools/gcc/gcc_csl-arm-2008q1.bb
@@ -1,4 +1,4 @@
1PR = "r2" 1PR = "r3"
2 2
3require gcc-${PV}.inc 3require gcc-${PV}.inc
4require gcc-configure-target.inc 4require gcc-configure-target.inc