]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc: enable poison parameters detection
authorDongxiao Xu <dongxiao.xu@intel.com>
Sat, 25 Sep 2010 02:16:26 +0000 (10:16 +0800)
committerSaul Wold <Saul.Wold@intel.com>
Mon, 27 Sep 2010 15:59:15 +0000 (08:59 -0700)
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>
28 files changed:
meta/recipes-devtools/gcc/gcc-4.5.0.inc
meta/recipes-devtools/gcc/gcc-4.5.0/gcc-poison-parameters.patch [new file with mode: 0644]
meta/recipes-devtools/gcc/gcc-configure-common.inc
meta/recipes-devtools/gcc/gcc-cross-canadian_4.3.3.bb
meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.0.bb
meta/recipes-devtools/gcc/gcc-cross-initial_4.3.3.bb
meta/recipes-devtools/gcc/gcc-cross-initial_4.5.0.bb
meta/recipes-devtools/gcc/gcc-cross-intermediate_4.3.3.bb
meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.0.bb
meta/recipes-devtools/gcc/gcc-cross-kernel-3.4.4_csl-arm-2005q3.bb
meta/recipes-devtools/gcc/gcc-cross_4.3.3.bb
meta/recipes-devtools/gcc/gcc-cross_4.5.0.bb
meta/recipes-devtools/gcc/gcc-cross_csl-arm-2008q1.bb
meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.3.3.bb
meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.0.bb
meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.3.3.bb
meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.0.bb
meta/recipes-devtools/gcc/gcc-crosssdk_4.3.3.bb
meta/recipes-devtools/gcc/gcc-crosssdk_4.5.0.bb
meta/recipes-devtools/gcc/gcc-runtime_4.3.3.bb
meta/recipes-devtools/gcc/gcc-runtime_4.5.0.bb
meta/recipes-devtools/gcc/gcc_4.3.3.bb
meta/recipes-devtools/gcc/gcc_4.5.0.bb
meta/recipes-devtools/gcc/gcc_csl-arm-2008q1.bb
meta/recipes-graphics/libxsettings-client/libxsettings-client/disable_Os_option.patch [new file with mode: 0644]
meta/recipes-graphics/libxsettings-client/libxsettings-client_0.10.bb
meta/recipes-support/libproxy/libproxy-0.4.3/disable_Os_option.patch [new file with mode: 0644]
meta/recipes-support/libproxy/libproxy_0.4.3.bb

index 6da8ddaa538d428f98a478aac0a7fa5d2ebe3cb6..2b5c82975a14088c37ae71eeca05ec85ac11faff 100644 (file)
@@ -48,6 +48,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
           file://64bithack.patch \
           file://optional_libstdc.patch \
           file://disable_relax_pic_calls_flag.patch \
+          file://gcc-poison-parameters.patch \
          "
        
 SRC_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 (file)
index 0000000..3cc7cba
--- /dev/null
@@ -0,0 +1,83 @@
+gcc: add poison parameters detection
+
+Add the logic that, if not configured with "--enable-target-optspace",
+gcc will meet error when build target app with "-Os" option.
+This could avoid potential binary crash.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff --git a/gcc/config.in b/gcc/config.in
+index a9e208f..3004321 100644
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -132,6 +132,12 @@
+ #endif
++/* Define to enable target optspace support. */
++#ifndef USED_FOR_TARGET
++#undef ENABLE_TARGET_OPTSPACE
++#endif
++
++
+ /* Define if you want all operations on RTL (the basic data structure of the
+    optimizer and back end) to be checked for dynamic type safety at runtime.
+    This is quite expensive. */
+diff --git a/gcc/configure b/gcc/configure
+index 2e022ed..004ec0b 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -909,6 +909,7 @@ enable_maintainer_mode
+ enable_version_specific_runtime_libs
+ with_slibdir
+ enable_plugin
++enable_target_optspace
+ '
+       ac_precious_vars='build_alias
+ host_alias
+@@ -25289,6 +25290,13 @@ $as_echo "#define ENABLE_PLUGIN 1" >>confdefs.h
+ fi
++if test x"$enable_target_optspace" != x; then :
++
++$as_echo "#define ENABLE_TARGET_OPTSPACE 1" >>confdefs.h
++
++fi
++
++
+ # Configure the subdirectories
+ # AC_CONFIG_SUBDIRS($subdirs)
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index ac4ca70..18ec0aa 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4434,6 +4434,11 @@ if test x"$enable_plugin" = x"yes"; then
+   AC_DEFINE(ENABLE_PLUGIN, 1, [Define to enable plugin support.])
+ fi
++AC_SUBST(enable_target_optspace)
++if test x"$enable_target_optspace" != x; then
++  AC_DEFINE(ENABLE_TARGET_OPTSPACE, 1, [Define to enable target optspace support.])
++fi
++
+ # Configure the subdirectories
+ # AC_CONFIG_SUBDIRS($subdirs)
+diff --git a/gcc/opts.c b/gcc/opts.c
+index 139cd26..2fdd96a 100644
+--- a/gcc/opts.c
++++ b/gcc/opts.c
+@@ -945,6 +945,11 @@ decode_options (unsigned int argc, const char **argv)
+   else
+     set_param_value ("min-crossjump-insns", initial_min_crossjump_insns);
++#ifndef ENABLE_TARGET_OPTSPACE
++  if (optimize_size == 1)
++    error ("Do not use -Os option if --enable-target-optspace is not set.");
++#endif
++
+   if (first_time_p)
+     {
+       /* Initialize whether `char' is signed.  */
index d86cb9a0b6f2faa01b88c27d033de8974ba26a36..9dd8feef7c542cd7ac2997fd7e53f8ed9a969bde 100644 (file)
@@ -17,7 +17,7 @@ LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
 # hidden symbols in libgcc.a which linker complains
 # when linking shared libraries further in the build like (gnutls)
 
-SPECIAL_ARCH_LIST = "powerpc arm"
+SPECIAL_ARCH_LIST = "powerpc"
 OPTSPACE = ${@base_contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}", "", "--enable-target-optspace",d)}
 
 EXTRA_OECONF_BASE ?= ""
index 87cd27a95c39e88aeedb0d63baed8b754c94b984..43bab3961dfe23da80ed866d24e9d499de4ad432 100644 (file)
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
 require gcc-configure-sdk.inc
 require gcc-package-sdk.inc
 
-PR = "r18"
+PR = "r19"
 
 DEPENDS += "gmp-nativesdk mpfr-nativesdk"
 RDEPENDS_${PN} += "mpfr-nativesdk"
index a9f79b650959d653ca675ce8517966f008650095..37a0933bd2030e2451909a62458a4006d3dd464a 100644 (file)
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
 require gcc-configure-sdk.inc
 require gcc-package-sdk.inc
 
-PR = "r8"
+PR = "r9"
 
 DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
 RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
index 38e0964fedc8b8c50ad63849863e8ff216edea44..081b7d60fb5946d582bc1423e1e549b731972787 100644 (file)
@@ -1,5 +1,5 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-initial.inc
 
-PR = "r3"
+PR = "r4"
 
index e05fb346e8e53ce4d76acd3e9ac647e091494a89..7072fdf4a0269a3a36505878728ca502c9388f28 100644 (file)
@@ -1,5 +1,5 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-initial.inc
 
-PR = "r8"
+PR = "r9"
 
index e65d5df671789da6dd819783b32ac602bba79996..9a30cb51195a5376bff61bc8390e0978aaa36b3c 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-intermediate.inc
-PR = "r3"
+PR = "r4"
 
index e0147743ee36938e48fae3627b32eb5774f202cb..bb145710c1bb4215b130f364a8464d4d499da99e 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-intermediate.inc
-PR = "r8"
+PR = "r9"
 
index 675d3e44af9668618c9db3cf422a9f8d57dbf138..88e38420ebfccc912fd93b81612cc7d16da3aa1c 100644 (file)
@@ -9,7 +9,7 @@ require gcc-cross-kernel.inc
 
 DEFAULT_PREFERENCE = "-1"
 
-PR = "r3"
+PR = "r4"
 
 SRC_URI += "file://gcc-3.4.4-makefile-fix.patch;patch=1"
 
index d22fb9ed22a4b034bb0d49c27a572dc03c57f1d8..5eaac5fa1b06d9de313795d0a8250421234bbc89 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r16"
+PR = "r17"
 
 require gcc-${PV}.inc
 require gcc-cross4.inc
index d3a068e1f6631ffd8754f385ab2efae0ae8119e6..72032762bfd6d9e2f77afb18a6ae368c7cfdb26d 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r9"
+PR = "r10"
 
 require gcc-${PV}.inc
 require gcc-cross4.inc
index 7cef7e7a3ac58cd967c37f08e43a1e4a92190fa6..89534f18ecec5640c36490928cf06225aab57624 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r4"
+PR = "r5"
 
 require gcc-csl-arm-2008q1.inc
 require gcc-cross4.inc
index 44dd50dcb856b53ce66e2b6004f884457aa8d6ee..5daa31b8883838de0d9678fd3709f9c4cbecbc71 100644 (file)
@@ -1,3 +1,3 @@
 require gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
-PR = "r4"
+PR = "r5"
index 9daa2925b1c9117c1cafa06ba5530549c7496aa4..c14846a397a86830a0b3601ff6feb6e939c90f7a 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
 
-PR = "r8"
+PR = "r9"
index ae439622acb6cc19f417a91213eb7c03e9a12576..cd1f96651bb90749081b3ee0e6f185a8d1859468 100644 (file)
@@ -1,3 +1,3 @@
 require gcc-cross-intermediate_${PV}.bb
 require gcc-crosssdk-intermediate.inc
-PR = "r7"
+PR = "r8"
index eeb2d87d541415244da1a5172d0637ec1aadd809..b8204c4dc692f723ec00f7edc449c1ea0f4c7846 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross-intermediate_${PV}.bb
 require gcc-crosssdk-intermediate.inc
 
-PR = "r8"
+PR = "r9"
index ffbd6715982eb8894281de12aa490d9a923d51ae..12de62ae3fce08f8d41d455f056dbd027d507319 100644 (file)
@@ -1,3 +1,3 @@
 require gcc-cross_${PV}.bb
 require gcc-crosssdk.inc
-PR="r2"
+PR="r3"
index ffb0739c5de44aff35e7162af2f3d8d76857114c..df4807d5ad456af0e8efd00631e5b7bc1b203302 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-crosssdk.inc
 
-PR = "r8"
+PR = "r9"
index 8c7c123f2ec873f2d1ff5d09993c7ff664da2d52..6b375f323a1ba14ef6bc52edfd5f79713538c361 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r16"
+PR = "r17"
 
 require gcc-${PV}.inc
 require gcc-configure-runtime.inc
index 79ce466a29b610554f6589cd3337dd3d082c49d2..2bfc0df1cb11e1dfeef3189af55796e4b16f5b69 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r8"
+PR = "r9"
 
 require gcc-${PV}.inc
 require gcc-configure-runtime.inc
index ca22e0f69cd5e7074e27dac72dc16aff7bec50f3..582fff49ac65165765e3354d50aa119890d42643 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r9"
+PR = "r10"
 
 require gcc-${PV}.inc
 require gcc-configure-target.inc
index a42fb39764ab882d6da7c989426def6a2493dc67..880c99c8e91487542f7e653ad247db3a1cca5908 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r8"
+PR = "r9"
 
 require gcc-${PV}.inc
 require gcc-configure-target.inc
index 4999c6a53ece46065a2ee996b39449baaa6d279d..cc7540af15049a2728479ee6e3646c3e1cd8458b 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r2"
+PR = "r3"
 
 require gcc-${PV}.inc
 require gcc-configure-target.inc
diff --git a/meta/recipes-graphics/libxsettings-client/libxsettings-client/disable_Os_option.patch b/meta/recipes-graphics/libxsettings-client/libxsettings-client/disable_Os_option.patch
new file mode 100644 (file)
index 0000000..716f562
--- /dev/null
@@ -0,0 +1,17 @@
+Do not set Os optimization in target APP CFLAGS, since it may have potential
+error if "--enable-target-optspace" is not set when configuring GCC.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -ruN Xsettings-client-0.10-orig/configure.ac Xsettings-client-0.10/configure.ac
+--- Xsettings-client-0.10-orig/configure.ac    2010-09-21 14:01:47.000000000 +0800
++++ Xsettings-client-0.10/configure.ac 2010-09-21 14:02:01.000000000 +0800
+@@ -3,7 +3,7 @@
+ AM_INIT_AUTOMAKE(Xsettings-client, 0.10)
+ AM_CONFIG_HEADER(config.h)
+-CFLAGS="-Os -Wall"
++CFLAGS="-O2 -Wall"
+ # Checks for programs.
+ AC_PROG_CC
index ecd6d181eb6d63430b157d0eda9d420d6631ed41..9cd15a2b7dd0832fc084721ef1fe2d860b4faaae 100644 (file)
@@ -9,13 +9,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7cfac9d2d4dc3694cc7eb605cf32a69b \
 PRIORITY = "optional"
 DEPENDS = "virtual/libx11"
 
-PR = "r3"
+PR = "r4"
 
 headers = "xsettings-common.h xsettings-client.h"
 
 SRC_URI = "http://projects.o-hand.com/matchbox/sources/optional-dependencies/Xsettings-client-0.10.tar.gz \
         file://MIT-style-license \
-        file://link-x11.patch;apply=yes"
+        file://link-x11.patch;apply=yes \
+        file://disable_Os_option.patch"
 
 S = "${WORKDIR}/Xsettings-client-0.10"
 
diff --git a/meta/recipes-support/libproxy/libproxy-0.4.3/disable_Os_option.patch b/meta/recipes-support/libproxy/libproxy-0.4.3/disable_Os_option.patch
new file mode 100644 (file)
index 0000000..cdf6ff6
--- /dev/null
@@ -0,0 +1,17 @@
+Do not set Os optimization in target APP CFLAGS, since it may have potential
+error if "--enable-target-optspace" is not set when configuring GCC.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -ruN libproxy-0.4.3-orig/CMakeLists.txt libproxy-0.4.3/CMakeLists.txt
+--- libproxy-0.4.3-orig/CMakeLists.txt 2010-09-21 17:16:06.000000000 +0800
++++ libproxy-0.4.3/CMakeLists.txt      2010-09-21 17:16:40.000000000 +0800
+@@ -61,7 +61,7 @@
+   add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
+ else()
+   add_definitions(-D_POSIX_C_SOURCE=1)
+-  set(CMAKE_CXX_FLAGS "-g -Wall -Werror -fvisibility=hidden -Os ${CMAKE_CXX_FLAGS}")
++  set(CMAKE_CXX_FLAGS "-g -Wall -Werror -fvisibility=hidden -O2 ${CMAKE_CXX_FLAGS}")
+ endif()
+ ### Subdirectories
index 6c0b7a50c63c8bcbb78ad92b561ab39fbdf470ba..ffa06f636a333f60bd5a64b15d0a76d38511c71b 100644 (file)
@@ -9,16 +9,17 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=7d7044444a7b1b116e8783edcdb44ff4 \
 
 DEPENDS = "virtual/libx11 xmu gconf-dbus"
 
-SRC_URI = "http://libproxy.googlecode.com/files/libproxy-${PV}.tar.gz"
+SRC_URI = "http://libproxy.googlecode.com/files/libproxy-${PV}.tar.gz \
+           file://disable_Os_option.patch"
 
-PR = "r1"
+PR = "r2"
 
 inherit cmake pkgconfig
 
 EXTRA_OECMAKE = "-DWITH_WEBKIT=no -DWITH_GNOME=yes -DWITH_KDE4=no \
              -DWITH_PYTHON=no -DWITH_PERL=no -DWITH_MOZJS=no -DWITH_NM=no"
 
-FILES_${PN}-dbg += "${libdir}/libproxy/0.4.2/plugins/"
+FILES_${PN}-dbg += "${libdir}/libproxy/${PV}/plugins/"
 
 do_configure_prepend() {
        export HOST_SYS=${HOST_SYS}