summaryrefslogtreecommitdiffstats
path: root/scripts/devtool
AgeCommit message (Expand)Author
2017-11-10devtool: stop always moving workspace to end of BBLAYERSPaul Eggleton
2017-11-10devtool: fix handling of oe-local-files when source is in a subdirectoryPaul Eggleton
2017-09-18devtool: ensure recipes devtool is working on are unlocked within the eSDKPaul Eggleton
2017-01-23devtool: check locale and refuse to start if it isn't UTF-8Paul Eggleton
2016-12-16scripts: remove True option to getVar callsJoshua Lock
2016-12-14devtool: prevent BBHandledException from showing traceback<
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>

Index: gcc-4.6.0/gcc/config.in
===================================================================
--- gcc-4.6.0.orig/gcc/config.in
+++ gcc-4.6.0/gcc/config.in
@@ -150,6 +150,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. */
Index: gcc-4.6.0/gcc/configure
===================================================================
--- gcc-4.6.0.orig/gcc/configure
+++ gcc-4.6.0/gcc/configure
@@ -26434,6 +26434,13 @@ $as_echo "#define ENABLE_LIBQUADMATH_SUP
 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)
 
Index: gcc-4.6.0/gcc/configure.ac
===================================================================
--- gcc-4.6.0.orig/gcc/configure.ac
+++ gcc-4.6.0/gcc/configure.ac
@@ -4907,6 +4907,11 @@ if test "${ENABLE_LIBQUADMATH_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)
 
Index: gcc-4.6.0/gcc/opts.c
===================================================================
--- gcc-4.6.0.orig/gcc/opts.c
+++ gcc-4.6.0/gcc/opts.c
@@ -605,6 +605,10 @@ default_options_optimization (struct gcc
     maybe_set_param_value (PARAM_MIN_CROSSJUMP_INSNS,
 			   default_param_value (PARAM_MIN_CROSSJUMP_INSNS),
 			   opts->x_param_values, opts_set->x_param_values);
+#ifndef ENABLE_TARGET_OPTSPACE
+  if (optimize_size == 1)
+    error ("Do not use -Os option if --enable-target-optspace is not set.");
+#endif
 
   /* Allow default optimizations to be specified on a per-machine basis.  */
   maybe_default_options (opts, opts_set,
leton 2015-08-01devtool: add --bbpath argumentChristopher Larson 2015-07-31devtool: use tinfoil shutdown methodPaul Eggleton 2015-07-27devtool: also load plugins from BBPATHChristopher Larson 2015-06-18devtool: use DevtoolError for error handlingMarkus Lehtonen 2015-06-18devtool: remove some unused return valuesMarkus Lehtonen 2015-05-15devtool: if workspace layer exists, still ensure it's in bblayers.confPaul Eggleton 2015-04-27devtool: handle . in recipe namePaul Eggleton 2015-02-07devtool: improve command-line helpPaul Eggleton 2014-12-21scripts/devtool: add development helper toolPaul Eggleton