Merge "Force Thumb for CFI targets." am: 34eb9f7f60 am: 9e8e3de9d8

am: 682a87a7f5

Change-Id: I9a586f57a8988bdb8d772705acef8f5f8b967e8d
This commit is contained in:
Evgenii Stepanov 2017-01-24 20:58:55 +00:00 committed by android-build-merger
commit 999ea7f160
1 changed files with 4 additions and 0 deletions

View File

@ -143,6 +143,10 @@ 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