Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b6f056c4 authored by Evgenii Stepanov's avatar Evgenii Stepanov Committed by android-build-merger
Browse files

Merge "Force Thumb for CFI targets." am: 34eb9f7f am: 9e8e3de9 am: 682a87a7

am: 999ea7f1

Change-Id: I84f7f7107c8166f93ffe3c47d2743b6c7e427e2f
parents a620b364 999ea7f1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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