diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-08-08 16:07:24 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-08-08 16:07:24 +0200 |
commit | 5ab1098d5fbc1ba092da73af2b92e5bcdd7a3f8d (patch) | |
tree | c4ea52b01613165a535056c00020f1b8538fcabe | |
parent | 2a6843cb6c44305ac62c9cd1098a3eec4abaeb7e (diff) |
Generalize -fsanitize=address checks
...that are at least also relevant for -fsanitize=undefined
Change-Id: I39044d2a73912a605af8e965eb1cdf8dfd4f0051
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | external/nss/UnpackedTarball_nss.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/JunitTest.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/linux.mk | 10 |
4 files changed, 17 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index dc9f86ab6191..38c2ea97b6f9 100644 --- a/configure.ac +++ b/configure.ac @@ -1021,9 +1021,8 @@ AC_ARG_ENABLE(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.)])) + CC contains "-fsanitize=*". (For Valgrind, those runtime optimizations + are typcially disabled dynamically via RUNNING_ON_VALGRIND.)])) AC_ARG_ENABLE(compiler-plugins, AS_HELP_STRING([--enable-compiler-plugins], @@ -5680,7 +5679,7 @@ 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) + -fsanitize=*) enable_runtime_optimizations=no break ;; @@ -6566,13 +6565,14 @@ _ACEOF if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then gccvisinlineshiddenok=no else - dnl At least Clang -fsanitize=address is known to not work with - dnl -z defs (unsetting which makes the test moot, though): + dnl At least Clang -fsanitize=address and -fsanitize=undefined are + dnl known to not work with -z defs (unsetting which makes the test + dnl moot, though): my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS if test "$COM_GCC_IS_CLANG" = TRUE; then for i in $CXX; do case $i in - -fsanitize=address) + -fsanitize=*) my_linkflagsnoundefs= break ;; diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk index 0f166c9f9cbe..94b50e9f50dd 100644 --- a/external/nss/UnpackedTarball_nss.mk +++ b/external/nss/UnpackedTarball_nss.mk @@ -33,10 +33,12 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\ )) endif -ifeq ($(COM_GCC_IS_CLANG)$(filter -fsanitize=address,$(CC)),TRUE-fsanitize=address) +ifeq ($(COM_GCC_IS_CLANG),TRUE) +ifneq ($(filter -fsanitize=%,$(CC)),) $(eval $(call gb_UnpackedTarball_add_patches,nss,\ external/nss/asan.patch.1 \ )) endif +endif # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk index 9801ed2c8ab1..cc355dfeba3c 100644 --- a/solenv/gbuild/JunitTest.mk +++ b/solenv/gbuild/JunitTest.mk @@ -54,7 +54,7 @@ $(call gb_JunitTest_get_target,%) : $(CLEAN_CMD) define gb_JunitTest_JunitTest -$(call gb_JunitTest_get_target,$(1)) : T_CP := $(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$$(gb_CLASSPATHSEP)$(INSTROOT)/$(LIBO_URE_LIB_FOLDER) +$(call gb_JunitTest_get_target,$(1)) : T_CP := $(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$$(gb_CLASSPATHSEP)$(subst /lo/,/lo-4.2/,$(INSTROOT))/$(LIBO_URE_LIB_FOLDER) $(call gb_JunitTest_get_target,$(1)) : CLASSES := $(eval $(call gb_JunitTest_JunitTest_platform,$(1))) diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk index 88216b6b3bfc..284e70c79f5e 100644 --- a/solenv/gbuild/platform/linux.mk +++ b/solenv/gbuild/platform/linux.mk @@ -7,11 +7,13 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -ifneq ($(COM_GCC_IS_CLANG)$(filter -fsanitize=address,$(CC)),TRUE-fsanitize=address) -gb_LinkTarget_LDFLAGS += \ - -Wl,-z,defs \ - +gb__LinkTarget_LDFLAGS_zdefs := -Wl,-z,defs +ifeq ($(COM_GCC_IS_CLANG),TRUE) +ifneq ($(filter -fsanitize=%,$(CC)),) +gb__LinkTarget_LDFLAGS_zdefs := +endif endif +gb_LinkTarget_LDFLAGS += $(gb__LinkTarget_LDFLAGS_zdefs) include $(GBUILDDIR)/platform/unxgcc.mk |