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

Commit 4111d480 authored by Dan Albert's avatar Dan Albert
Browse files

Add LOCAL_SANITIZE_RECOVER.

This is needed for projects that have known ubsan issues that we can't
fix right away (perhaps because it's an upstream project that we're
diligent about keeping in sync with upsteam).

Also make the normal ubsan use -fno-sanitize-recover=all by default.

Change-Id: I1b0f3309792f32dbd08c18816d7306e76c8d7c30
parent b6874440
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ LOCAL_NATIVE_COVERAGE :=
LOCAL_DPI_VARIANTS:=
LOCAL_DPI_FILE_STEM:=
LOCAL_SANITIZE:=
LOCAL_SANITIZE_RECOVER:=

# arch specific variables
LOCAL_SRC_FILES_$(TARGET_ARCH):=
+8 −0
Original line number Diff line number Diff line
@@ -86,9 +86,17 @@ ifneq ($(filter address,$(my_sanitize)),)
endif

ifneq ($(filter undefined,$(my_sanitize)),)
  my_cflags += -fno-sanitize-recover=all

  ifdef LOCAL_IS_HOST_MODULE
    my_ldlibs += -ldl
  else
    $(error ubsan is not yet supported on the target)
  endif
endif


ifeq ($(strip $(LOCAL_SANITIZE_RECOVER)),true)
  recover_arg := $(subst $(space),$(comma),$(my_sanitize)),
  my_cflags += -fsanitize-recover=$(recover_arg)
endif