Merge "Convert liboemaids to oemaids_headers as a headers only library"
diff --git a/core/Makefile b/core/Makefile
index 06573fb..8c88d0a 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1278,11 +1278,15 @@
# (BOARD_USES_RECOVERY_AS_BOOT = true);
# c) We build the root into system image - not needing the resource file as we do bsdiff
# (BOARD_BUILD_SYSTEM_ROOT_IMAGE = true).
+# d) We include the recovery DTBO image within recovery - not needing the resource file as we
+# do bsdiff because boot and recovery will contain different number of entries
+# (BOARD_INCLUDE_RECOVERY_DTBO = true).
# Note that condition b) implies condition c), because of the earlier check in this file:
# "BOARD_USES_RECOVERY_AS_BOOT = true must have BOARD_BUILD_SYSTEM_ROOT_IMAGE = true" (not vice
# versa though).
-ifeq (,$(filter true, $(BOARD_USES_FULL_RECOVERY_IMAGE) $(BOARD_BUILD_SYSTEM_ROOT_IMAGE)))
+ifeq (,$(filter true, $(BOARD_USES_FULL_RECOVERY_IMAGE) $(BOARD_BUILD_SYSTEM_ROOT_IMAGE) \
+ $(BOARD_INCLUDE_RECOVERY_DTBO)))
# Named '.dat' so we don't attempt to use imgdiff for patching it.
RECOVERY_RESOURCE_ZIP := $(TARGET_OUT)/etc/recovery-resource.dat
else
@@ -1304,6 +1308,9 @@
ifdef BOARD_KERNEL_PAGESIZE
INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE)
endif
+ifdef BOARD_INCLUDE_RECOVERY_DTBO
+ INTERNAL_RECOVERYIMAGE_ARGS += --recovery_dtbo $(BOARD_PREBUILT_DTBOIMAGE)
+endif
# Keys authorized to sign OTA packages this build will accept. The
# build always uses dev-keys for this; release packaging tools will
@@ -1569,7 +1576,7 @@
# image size check calculation.
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
ifneq ($(BOARD_USES_FULL_RECOVERY_IMAGE),true)
-ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
+ifneq (,$(filter true, $(BOARD_BUILD_SYSTEM_ROOT_IMAGE) $(BOARD_INCLUDE_RECOVERY_DTBO)))
diff_tool := $(HOST_OUT_EXECUTABLES)/bsdiff
else
diff_tool := $(HOST_OUT_EXECUTABLES)/imgdiff
@@ -2550,6 +2557,9 @@
ifdef INSTALLED_2NDBOOTLOADER_TARGET
$(hide) cp $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/second
endif
+ifdef BOARD_INCLUDE_RECOVERY_DTBO
+ $(hide) cp $(INSTALLED_DTBOIMAGE_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/recovery_dtbo
+endif
ifdef INTERNAL_KERNEL_CMDLINE
$(hide) echo "$(INTERNAL_KERNEL_CMDLINE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/cmdline
endif
@@ -2641,6 +2651,9 @@
ifeq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
$(hide) echo "no_recovery=true" >> $(zip_root)/META/misc_info.txt
endif
+ifdef BOARD_INCLUDE_RECOVERY_DTBO
+ $(hide) echo "include_recovery_dtbo=true" >> $(zip_root)/META/misc_info.txt
+endif
ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE
$(hide) echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
endif
diff --git a/core/binary.mk b/core/binary.mk
index 97429c3..954df1f 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -1330,6 +1330,15 @@
endif
endif
+# Platform can use vendor public libraries. If a required shared lib is one of
+# the vendor public libraries, the lib is switched to the stub version of the lib.
+ifeq ($(LOCAL_USE_VNDK),)
+ ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
+ my_shared_libraries := $(foreach l,$(my_shared_libraries),\
+ $(if $(filter $(l),$(VENDOR_PUBLIC_LIBRARIES)),$(l).vendorpublic,$(l)))
+ endif
+endif
+
##########################################################
## Set up installed module dependency
## We cannot compute the full path of the LOCAL_SHARED_LIBRARIES for
diff --git a/core/config.mk b/core/config.mk
index 9e04eea..b3a204b 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -879,11 +879,13 @@
ifneq ($(sepolicy_major_vers), $(PLATFORM_SDK_VERSION))
$(error sepolicy_major_version does not match PLATFORM_SDK_VERSION, please update.)
endif
+
+TOT_SEPOLICY_VERSION := 10000.0
ifneq (REL,$(PLATFORM_VERSION_CODENAME))
- sepolicy_major_vers := 10000
- sepolicy_minor_vers := 0
+ PLATFORM_SEPOLICY_VERSION := $(TOT_SEPOLICY_VERSION)
+else
+ PLATFORM_SEPOLICY_VERSION := $(join $(addsuffix .,$(sepolicy_major_vers)), $(sepolicy_minor_vers))
endif
-PLATFORM_SEPOLICY_VERSION := $(join $(addsuffix .,$(sepolicy_major_vers)), $(sepolicy_minor_vers))
sepolicy_major_vers :=
sepolicy_minor_vers :=
@@ -892,6 +894,11 @@
26.0 \
27.0
+.KATI_READONLY := \
+ PLATFORM_SEPOLICY_COMPAT_VERSIONS \
+ PLATFORM_SEPOLICY_VERSION \
+ TOT_SEPOLICY_VERSION \
+
# ###############################################################
# Set up final options.
# ###############################################################
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index 9ea1ff4..aa591ec 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -34,6 +34,16 @@
endif
endif
+# Global integer sanitization doesn't support static modules.
+ifeq ($(filter SHARED_LIBRARIES EXECUTABLES,$(LOCAL_MODULE_CLASS)),)
+ my_global_sanitize := $(filter-out integer_overflow,$(my_global_sanitize))
+ my_global_sanitize_diag := $(filter-out integer_overflow,$(my_global_sanitize_diag))
+endif
+ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
+ my_global_sanitize := $(filter-out integer_overflow,$(my_global_sanitize))
+ my_global_sanitize_diag := $(filter-out integer_overflow,$(my_global_sanitize_diag))
+endif
+
# Disable global CFI in excluded paths
ifneq ($(filter cfi, $(my_global_sanitize)),)
combined_exclude_paths := $(CFI_EXCLUDE_PATHS) \
@@ -132,10 +142,12 @@
my_sanitize_diag := $(filter-out cfi,$(my_sanitize_diag))
endif
-# Disable CFI for host targets
+# Disable sanitizers which need the UBSan runtime for host targets.
ifdef LOCAL_IS_HOST_MODULE
my_sanitize := $(filter-out cfi,$(my_sanitize))
my_sanitize_diag := $(filter-out cfi,$(my_sanitize_diag))
+ my_sanitize := $(filter-out signed-integer-overflow unsigned-integer-overflow integer_overflow,$(my_sanitize))
+ my_sanitize_diag := $(filter-out signed-integer-overflow unsigned-integer-overflow integer_overflow,$(my_sanitize_diag))
endif
# Support for local sanitize blacklist paths.
@@ -212,23 +224,26 @@
endif
ifneq ($(filter integer_overflow,$(my_sanitize)),)
- ifneq ($(filter SHARED_LIBRARIES EXECUTABLES,$(LOCAL_MODULE_CLASS)),)
- ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
+ # Respect LOCAL_NOSANITIZE for integer-overflow flags.
+ ifeq ($(filter signed-integer-overflow, $(strip $(LOCAL_NOSANITIZE))),)
+ my_sanitize += signed-integer-overflow
+ endif
+ ifeq ($(filter unsigned-integer-overflow, $(strip $(LOCAL_NOSANITIZE))),)
+ my_sanitize += unsigned-integer-overflow
+ endif
+ my_cflags += $(INTEGER_OVERFLOW_EXTRA_CFLAGS)
- # Respect LOCAL_NOSANITIZE for integer-overflow flags.
- ifeq ($(filter signed-integer-overflow, $(strip $(LOCAL_NOSANITIZE))),)
- my_sanitize += signed-integer-overflow
- endif
- ifeq ($(filter unsigned-integer-overflow, $(strip $(LOCAL_NOSANITIZE))),)
- my_sanitize += unsigned-integer-overflow
- endif
- my_cflags += $(INTEGER_OVERFLOW_EXTRA_CFLAGS)
-
- # Check for diagnostics mode (on by default).
- ifneq ($(filter integer_overflow,$(my_sanitize_diag)),)
+ # Check for diagnostics mode.
+ ifneq ($(filter integer_overflow,$(my_sanitize_diag)),)
+ ifneq ($(filter SHARED_LIBRARIES EXECUTABLES,$(LOCAL_MODULE_CLASS)),)
+ ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
my_sanitize_diag += signed-integer-overflow
my_sanitize_diag += unsigned-integer-overflow
+ else
+ $(call pretty-error,Make cannot apply integer overflow diagnostics to static binary.)
endif
+ else
+ $(call pretty-error,Make cannot apply integer overflow diagnostics to static library.)
endif
endif
my_sanitize := $(filter-out integer_overflow,$(my_sanitize))
diff --git a/core/definitions.mk b/core/definitions.mk
index e259e19..4dbe33d 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -471,8 +471,8 @@
###########################################################
## Find test data in a form required by LOCAL_TEST_DATA
## $(1): the base dir, relative to the root of the source tree.
-## $(3): the file name pattern to be passed to find as "-name"
-## $(2): a list of subdirs of the base dir
+## $(2): the file name pattern to be passed to find as "-name"
+## $(3): a list of subdirs of the base dir
###########################################################
define find-test-data-in-subdirs
@@ -1849,6 +1849,7 @@
$(PRIVATE_NM) -D $< --format=posix --defined-only | awk '{ print $$1 }' | sort >$@.dynsyms && \
$(PRIVATE_NM) $< --format=posix --defined-only | awk '{ if ($$2 == "T" || $$2 == "t" || $$2 == "D") print $$1 }' | sort >$@.funcsyms && \
comm -13 $@.dynsyms $@.funcsyms >$@.keep_symbols && \
+ echo >>$@.keep_symbols && \
$(PRIVATE_OBJCOPY) --rename-section .debug_frame=saved_debug_frame $@.debug $@.mini_debuginfo && \
$(PRIVATE_OBJCOPY) -S --remove-section .gdb_index --remove-section .comment --keep-symbols=$@.keep_symbols $@.mini_debuginfo && \
$(PRIVATE_OBJCOPY) --rename-section saved_debug_frame=.debug_frame $@.mini_debuginfo && \
diff --git a/core/main.mk b/core/main.mk
index da88613..4f59076 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -319,6 +319,15 @@
endif
endif
+## asan ##
+
+# Install some additional tools on ASAN builds IFF we are also installing debug tools
+ifneq ($(filter address,$(SANITIZE_TARGET)),)
+ifneq (,$(filter debug,$(tags_to_install)))
+ tags_to_install += asan
+endif
+endif
+
## sdk ##
ifdef is_sdk_build
@@ -346,10 +355,6 @@
ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android
-# Sets the location that the runtime dumps stack traces to when signalled
-# with SIGQUIT. Stack trace dumping is turned on for all android builds.
-ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-dir=/data/anr
-
# ------------------------------------------------------------
# Define a function that, given a list of module tags, returns
# non-empty if that module should be installed in /system.
@@ -936,6 +941,9 @@
$(call get-tagged-modules,tests) \
$(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS)) \
)
+asan_MODULES := $(sort \
+ $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG_ASAN)) \
+ )
# TODO: Remove the 3 places in the tree that use ALL_DEFAULT_INSTALLED_MODULES
# and get rid of it from this list.
diff --git a/core/product.mk b/core/product.mk
index 8e1fb95..ae05bf5 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -81,6 +81,7 @@
PRODUCT_AAPT_PREBUILT_DPI \
PRODUCT_PACKAGES \
PRODUCT_PACKAGES_DEBUG \
+ PRODUCT_PACKAGES_DEBUG_ASAN \
PRODUCT_PACKAGES_ENG \
PRODUCT_PACKAGES_TESTS \
PRODUCT_DEVICE \
diff --git a/envsetup.sh b/envsetup.sh
index cf61950..906f5e5 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -350,13 +350,12 @@
return
fi
- dir="sdk/bash_completion"
- if [ -d ${dir} ]; then
- for f in `/bin/ls ${dir}/[a-z]*.bash 2> /dev/null`; do
+ for f in system/core/adb/adb.bash system/core/fastboot/fastboot.bash; do
+ if [ -f $f ]; then
echo "including $f"
. $f
- done
- fi
+ fi
+ done
complete -C "bit --tab" bit
}
diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk
index 9ed5284..820e392 100644
--- a/target/product/aosp_arm.mk
+++ b/target/product/aosp_arm.mk
@@ -23,8 +23,7 @@
PRODUCT_COPY_FILES += \
development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \
prebuilts/qemu-kernel/arm/3.18/kernel-qemu2:kernel-ranchu \
- device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \
- device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early
+ device/generic/goldfish/fstab.ranchu.arm:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ranchu
include $(SRC_TARGET_DIR)/product/full.mk
diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk
index 18d613b..1231609 100644
--- a/target/product/aosp_arm64.mk
+++ b/target/product/aosp_arm64.mk
@@ -28,8 +28,7 @@
PRODUCT_COPY_FILES += \
development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \
prebuilts/qemu-kernel/arm64/3.18/kernel-qemu2:kernel-ranchu \
- device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \
- device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early
+ device/generic/goldfish/fstab.ranchu.arm:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ranchu
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
diff --git a/target/product/base.mk b/target/product/base.mk
index 14ff1c2..76a8c40 100644
--- a/target/product/base.mk
+++ b/target/product/base.mk
@@ -156,6 +156,9 @@
sqlite3 \
strace
+# Packages included only for eng/userdebug builds, when building with SANITIZE_TARGET=address
+PRODUCT_PACKAGES_DEBUG_ASAN :=
+
PRODUCT_COPY_FILES := $(call add-to-product-copy-files-if-exists,\
frameworks/base/config/preloaded-classes:system/etc/preloaded-classes)
diff --git a/target/product/cfi-common.mk b/target/product/cfi-common.mk
new file mode 100644
index 0000000..7a53bc1
--- /dev/null
+++ b/target/product/cfi-common.mk
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# 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 \
diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk
index 2aa688b..56eb8c7 100644
--- a/target/product/sdk_phone_arm64.mk
+++ b/target/product/sdk_phone_arm64.mk
@@ -28,8 +28,7 @@
PRODUCT_COPY_FILES += \
development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \
prebuilts/qemu-kernel/arm64/3.18/kernel-qemu2:kernel-ranchu \
- device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \
- device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early
+ device/generic/goldfish/fstab.ranchu.arm:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ranchu
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
diff --git a/target/product/sdk_phone_armv7.mk b/target/product/sdk_phone_armv7.mk
index e99f0f5..09e5c75 100644
--- a/target/product/sdk_phone_armv7.mk
+++ b/target/product/sdk_phone_armv7.mk
@@ -23,8 +23,7 @@
PRODUCT_COPY_FILES += \
development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \
prebuilts/qemu-kernel/arm/3.18/kernel-qemu2:kernel-ranchu \
- device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \
- device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early
+ device/generic/goldfish/fstab.ranchu.arm:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ranchu
$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk)
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index b5f69a5..fd8a130 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -461,6 +461,11 @@
# "boot" or "recovery", without extension.
partition_name = os.path.basename(sourcedir).lower()
+ if (partition_name == "recovery" and
+ info_dict.get("include_recovery_dtbo") == "true"):
+ fn = os.path.join(sourcedir, "recovery_dtbo")
+ cmd.extend(["--recovery_dtbo", fn])
+
p = Run(cmd, stdout=subprocess.PIPE)
p.communicate()
assert p.returncode == 0, "mkbootimg of %s image failed" % (partition_name,)