summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-05-08 14:20:04 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-05-08 14:22:00 +0200
commiteae3f52f94f2ce3633539ad782d5c1e768c52089 (patch)
treeda3cc146f5eea6c83179a88ed8125605041349ec /configure.ac
parent6d14a2c264506e8d5272e87e99f140b1f976b6ef (diff)
New --disable-runtime-optimizations
...to better serve the needs of tools like -fsanitize=address Change-Id: Ic2f2b981b2f5c1bc95ff91bc7a8d21fbb695dc8d
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac33
1 files changed, 33 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 682aee6b211a..4811cd300437 100644
--- a/configure.ac
+++ b/configure.ac
@@ -967,6 +967,15 @@ AC_ARG_ENABLE(symbols,
This enables -g compiler flag for GCC or equivalent,
without changing anything else compared to productive code.]))
+AC_ARG_ENABLE(runtime-optimizations,
+ AS_HELP_STRING([--disable-runtime-optimizations],
+ [Statically disable certain runtime optimizations (like rtl/alloc.h or
+ JVM JIT) that are known to interact badly with certain dynamic analysis
+ tools (like -fsanitize=address or Valgrind). By default, disabled iff
+ CC contains "-fsanitize=address". (For Valgrind, those runtime
+ optimizations are typcially disabled dynamically via
+ RUNNING_ON_VALGRIND.)]))
+
AC_ARG_ENABLE(compiler-plugins,
AS_HELP_STRING([--enable-compiler-plugins],
[Enable compiler plugins that will perform additional checks during
@@ -5625,6 +5634,30 @@ AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
dnl ===================================================================
+dnl Check whether to enable runtime optimizations
+dnl ===================================================================
+ENABLE_RUNTIME_OPTIMIZATIONS=
+AC_MSG_CHECKING([whether to enable runtime optimizations])
+if test -z "$enable_runtime_optimizations"; then
+ for i in $CC; do
+ case $i in
+ -fsanitize=address)
+ enable_runtime_optimizations=no
+ break
+ ;;
+ esac
+ done
+fi
+if test "$enable_runtime_optimizations" != no; then
+ ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
+ AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
+
+dnl ===================================================================
dnl Check if valgrind headers are available
dnl ===================================================================
ENABLE_VALGRIND=