From e8119e96fc0810a6ec69670d391edeac70a21931 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 9 Nov 2015 16:32:11 -0800 Subject: [PATCH] Switch from clang 3.6 to new clang repository (with 3.8). This reverts commit f7dbab16ffe97f41f8f8161b64d015830ab075ae. Bug: 23396112 Switch from "-fsanitize-undefined-trap-on-error" to "-fsanitize-trap=all". The former ends up accidentally leaving unresolved calls to __ubsan* helper functions in the object file with clang 3.8. The latter is used when we don't include address sanitizer, and replaces any misbehavior with a direct call to abort(). --- core/clang/config.mk | 3 +-- core/config_sanitizers.mk | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/clang/config.mk b/core/clang/config.mk index 0c5e963793..03e8dd5b9f 100644 --- a/core/clang/config.mk +++ b/core/clang/config.mk @@ -1,7 +1,6 @@ ## Clang configurations. -LLVM_PREBUILTS_VERSION := 3.6 -FORCE_BUILD_SANITIZER_SHARED_OBJECTS := true +LLVM_PREBUILTS_VERSION := 3.8 LLVM_PREBUILTS_PATH := prebuilts/clang/host/$(BUILD_OS)-x86/$(LLVM_PREBUILTS_VERSION)/bin LLVM_RTLIB_PATH := $(LLVM_PREBUILTS_PATH)/../lib/clang/$(LLVM_PREBUILTS_VERSION)/lib/linux/ diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index 718933854c..df52e7204b 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -84,7 +84,7 @@ ifneq ($(filter coverage,$(my_sanitize)),) endif ifneq ($(my_sanitize),) - fsanitize_arg := $(subst $(space),$(comma),$(my_sanitize)), + fsanitize_arg := $(subst $(space),$(comma),$(my_sanitize)) my_cflags += -fsanitize=$(fsanitize_arg) ifdef LOCAL_IS_HOST_MODULE @@ -92,8 +92,10 @@ ifneq ($(my_sanitize),) my_ldflags += -fsanitize=$(fsanitize_arg) my_ldlibs += -lrt -ldl else - my_cflags += -fsanitize-undefined-trap-on-error - my_cflags += -ftrap-function=abort + ifeq ($(filter address,$(my_sanitize)),) + my_cflags += -fsanitize-trap=all + my_cflags += -ftrap-function=abort + endif my_shared_libraries += libdl endif endif