Change PRODUCT_CFI_INCLUDE_PATHS to opt-out (Make)

This CL changes PRODUCT_CFI_INCLUDE_PATHS to be included in all
product configs by default. To maintain the status quo, the sanitizer
logic has been modified to only respect this product config for Arm64
devices (where this was previously enabled).

Bug: 63926619
Test: m -j60 # the device still has CFI enabled thanks to the default
opt-in

Change-Id: I22788d92be881d3290568488f5458c85e02ee8c7
This commit is contained in:
Vishwath Mohan 2018-03-28 19:23:01 -07:00
parent df2a21794c
commit f03a265786
2 changed files with 34 additions and 6 deletions

View File

@ -98,13 +98,17 @@ endif
# Enable CFI in included paths.
ifeq ($(filter cfi, $(my_sanitize)),)
combined_include_paths := $(CFI_INCLUDE_PATHS) \
$(PRODUCT_CFI_INCLUDE_PATHS)
# Do not rely on include paths for anything other than ARM64.
# TODO: Relax this constraint for 2019.
ifneq ($(filter arm64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)),)
combined_include_paths := $(CFI_INCLUDE_PATHS) \
$(PRODUCT_CFI_INCLUDE_PATHS)
ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_include_paths)),\
$(filter $(dir)%,$(LOCAL_PATH)))),)
my_sanitize := cfi $(my_sanitize)
my_sanitize_diag := cfi $(my_sanitize_diag)
ifneq ($(strip $(foreach dir,$(subst $(comma),$(space),$(combined_include_paths)),\
$(filter $(dir)%,$(LOCAL_PATH)))),)
my_sanitize := cfi $(my_sanitize)
my_sanitize_diag := cfi $(my_sanitize_diag)
endif
endif
endif

View File

@ -121,3 +121,27 @@ PRODUCT_COPY_FILES += \
system/core/rootdir/init.usb.configfs.rc:root/init.usb.configfs.rc \
system/core/rootdir/ueventd.rc:root/ueventd.rc \
system/core/rootdir/etc/hosts:system/etc/hosts
# This is a set of common components to enable CFI for (across
# compatible product configs)
PRODUCT_CFI_INCLUDE_PATHS := \
device/google/cuttlefish_common/guest/libs/wpa_supplicant_8_lib \
device/google/wahoo/wifi_offload \
external/tinyxml2 \
external/wpa_supplicant_8 \
frameworks/av/camera \
frameworks/av/media \
frameworks/av/services \
frameworks/minikin \
hardware/broadcom/wlan/bcmdhd/wpa_supplicant_8_lib \
hardware/interfaces/nfc \
hardware/qcom/wlan/qcwcn/wpa_supplicant_8_lib \
harware/interfaces/keymaster \
system/bt \
system/chre \
system/core/libnetutils \
system/core/libziparchive \
system/gatekeeper \
system/keymaster \
system/nfc \
system/security \