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

Commit ea38d8e9 authored by Andreas Gampe's avatar Andreas Gampe
Browse files

Build: Add option to restrict sanitization by owner

Add Make variable SANITIZE_NEVER_BY_OWNER to selectively
sanitize modules. By default, both are being sanitized. The
value of the variable is interpreted as a space or colon
separated list of owner names.

This can be used to create builds that lower the sanitization
burden by not sanitizing parts of the platform.

Bug: 29498013
Change-Id: Ib4412657fd38ff28a5c0863eddc2acde63c88ebb
parent 0290a416
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -30,6 +30,17 @@ ifeq ($(filter $(SANITIZE_ARCH),$(my_32_64_bit_suffix)),)
  my_sanitize :=
endif

# Add a filter point based on module owner (to lighten the burden). The format is a space- or
# colon-separated list of owner names.
ifneq (,$(SANITIZE_NEVER_BY_OWNER))
  ifneq (,$(LOCAL_MODULE_OWNER))
    ifneq (,$(filter $(LOCAL_MODULE_OWNER),$(subst :, ,$(SANITIZE_NEVER_BY_OWNER))))
      $(warning Not sanitizing $(LOCAL_MODULE) based on module owner.)
      my_sanitize :=
    endif
  endif
endif

# Don't apply sanitizers to NDK code.
ifdef LOCAL_SDK_VERSION
  my_sanitize :=