OSDN Git Service

Merge "Force Thumb for CFI targets."
authorEvgenii Stepanov <eugenis@google.com>
Tue, 24 Jan 2017 20:52:25 +0000 (20:52 +0000)
committerGerrit Code Review <noreply-gerritcodereview@google.com>
Tue, 24 Jan 2017 20:52:26 +0000 (20:52 +0000)
1  2 
core/config_sanitizers.mk

@@@ -143,9 -143,12 +143,13 @@@ ifneq ($(my_sanitize),
  endif
  
  ifneq ($(filter cfi,$(my_sanitize)),)
+   # __cfi_check needs to be built as Thumb (see the code in linker_cfi.cpp).
+   # LLVM is not set up to do this on a function basis, so force Thumb on the
+   # entire module.
+   LOCAL_ARM_MODE := thumb
    my_cflags += -flto -fsanitize-cfi-cross-dso -fvisibility=default
    my_ldflags += -flto -fsanitize-cfi-cross-dso -fsanitize=cfi -Wl,-plugin-opt,O1 -Wl,-export-dynamic-symbol=__cfi_check
 +  my_arflags += --plugin $(LLVM_PREBUILTS_PATH)/../lib64/LLVMgold.so
  endif
  
  # If local or global modules need ASAN, add linker flags.