Force Thumb for CFI targets.

Bug: 22033465
Test: bionic device tests
Change-Id: I66eb83bc7153cc34dde4fa1abfa861182a10f1fa
This commit is contained in:
Evgenii Stepanov 2017-01-20 14:12:08 -08:00
parent 2d7fb30207
commit 81bea1bd40
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
endif