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

Commit 71faa199 authored by Evgenii Stepanov's avatar Evgenii Stepanov
Browse files

Apply SANITIZE_TARGET and LOCAL_SANITIZE when both are present.

The idea is that targets with LOCAL_SANITIZE = signed-integer-overflow
and SANITIZE_TARGET=safe-stack should get both sanitizers.
This should work just fine for SANITIZE_TARGET=address, too.

Bug: 27729263
Change-Id: Ifee350da4877008fb061bc7f6c700e7fade405bc
parent 9d73af09
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -19,9 +19,8 @@ ifeq ($(my_clang),true)
  endif
endif

# The sanitizer specified by the environment wins over the module.
ifneq ($(my_global_sanitize),)
  my_sanitize := $(my_global_sanitize)
  my_sanitize := $(my_global_sanitize) $(my_sanitize)
endif

# The sanitizer specified in the product configuration wins over the previous.
@@ -118,11 +117,10 @@ ifneq ($(my_sanitize),)
    my_ldflags += -fsanitize=$(fsanitize_arg)
    my_ldlibs += -lrt -ldl
  else
    ifeq ($(filter address,$(my_sanitize)),)
    my_cflags += -fsanitize-trap=all
    my_cflags += -ftrap-function=abort
    endif
    ifneq ($(filter address thread,$(my_sanitize)),)
      my_cflags += -fno-sanitize-trap=address,thread
      my_shared_libraries += libdl
    endif
  endif