Merge "Fix typo in build_rro_package.mk" into oc-dev
diff --git a/CleanSpec.mk b/CleanSpec.mk
index acd5273..791439b 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -410,6 +410,10 @@
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/lib*)
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/vendor/lib*)
+# Sanitized libraries now live in a different location.
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/lib*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/vendor/lib*)
+
# ************************************************
# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
# ************************************************
diff --git a/core/Makefile b/core/Makefile
index 87be27a..2a031ea 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1250,6 +1250,15 @@
FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS)
+
+# ASAN libraries in the system image - add dependency.
+ASAN_IN_SYSTEM_INSTALLED := $(TARGET_OUT)/asan.tar.bz2
+ifneq (,$(SANITIZE_TARGET))
+ ifeq (true,$(SANITIZE_TARGET_SYSTEM))
+ FULL_SYSTEMIMAGE_DEPS += $(ASAN_IN_SYSTEM_INSTALLED)
+ endif
+endif
+
# -----------------------------------------------------------------
# installed file list
# Depending on anything that $(BUILT_SYSTEMIMAGE) depends on.
@@ -1257,11 +1266,11 @@
# so that we can get the size stat even if the build fails due to too large
# system image.
INSTALLED_FILES_FILE := $(PRODUCT_OUT)/installed-files.txt
-$(INSTALLED_FILES_FILE): $(FULL_SYSTEMIMAGE_DEPS)
+$(INSTALLED_FILES_FILE): $(FULL_SYSTEMIMAGE_DEPS) $(FILESLIST)
@echo Installed file list: $@
@mkdir -p $(dir $@)
@rm -f $@
- $(hide) build/tools/fileslist.py $(TARGET_OUT) > $(@:.txt=.json)
+ $(hide) $(FILESLIST) $(TARGET_OUT) > $(@:.txt=.json)
$(hide) build/tools/fileslist_util.py -c $(@:.txt=.json) > $@
.PHONY: installed-file-list
@@ -1526,9 +1535,11 @@
# We just build this directly to the install location.
INSTALLED_USERDATAIMAGE_TARGET := $(BUILT_USERDATAIMAGE_TARGET)
-$(INSTALLED_USERDATAIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) \
- $(INTERNAL_USERDATAIMAGE_FILES) \
- $(BUILD_IMAGE_SRCS)
+INSTALLED_USERDATAIMAGE_TARGET_DEPS := \
+ $(INTERNAL_USERIMAGES_DEPS) \
+ $(INTERNAL_USERDATAIMAGE_FILES) \
+ $(BUILD_IMAGE_SRCS)
+$(INSTALLED_USERDATAIMAGE_TARGET): $(INSTALLED_USERDATAIMAGE_TARGET_DEPS)
$(build-userdataimage-target)
.PHONY: userdataimage-nodeps
@@ -1538,6 +1549,19 @@
endif # not skip_userdata.img
skip_userdata.img :=
+# ASAN libraries in the system image - build rule.
+ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL := $(sort $(patsubst $(PRODUCT_OUT)/%,%,\
+ $(TARGET_OUT_SHARED_LIBRARIES) \
+ $(2ND_TARGET_OUT_SHARED_LIBRARIES) \
+ $(TARGET_OUT_VENDOR_SHARED_LIBRARIES) \
+ $(2ND_TARGET_OUT_VENDOR_SHARED_LIBRARIES)))
+# Extra options: Enforce the system user for the files to avoid having to change ownership.
+ASAN_SYSTEM_INSTALL_OPTIONS := --owner=1000 --group=1000
+# Note: experimentally, it seems not worth it to try to get "best" compression. We don't save
+# enough space.
+$(ASAN_IN_SYSTEM_INSTALLED): $(INSTALLED_USERDATAIMAGE_TARGET_DEPS)
+ tar cfj $(ASAN_IN_SYSTEM_INSTALLED) $(ASAN_SYSTEM_INSTALL_OPTIONS) -C $(TARGET_OUT_DATA)/.. $(ASAN_OUT_DIRS_FOR_SYSTEM_INSTALL) >/dev/null
+
#######
## data partition tarball
define build-userdatatarball-target
@@ -1704,11 +1728,11 @@
$(ALL_PDK_FUSION_FILES))
INSTALLED_FILES_FILE_SYSTEMOTHER := $(PRODUCT_OUT)/installed-files-system-other.txt
-$(INSTALLED_FILES_FILE_SYSTEMOTHER) : $(INTERNAL_SYSTEMOTHERIMAGE_FILES)
+$(INSTALLED_FILES_FILE_SYSTEMOTHER) : $(INTERNAL_SYSTEMOTHERIMAGE_FILES) $(FILESLIST)
@echo Installed file list: $@
@mkdir -p $(dir $@)
@rm -f $@
- $(hide) build/tools/fileslist.py $(TARGET_OUT_SYSTEM_OTHER) > $(@:.txt=.json)
+ $(hide) $(FILESLIST) $(TARGET_OUT_SYSTEM_OTHER) > $(@:.txt=.json)
$(hide) build/tools/fileslist_util.py -c $(@:.txt=.json) > $@
systemotherimage_intermediates := \
@@ -1751,11 +1775,11 @@
$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_VENDORIMAGE_FILES)
INSTALLED_FILES_FILE_VENDOR := $(PRODUCT_OUT)/installed-files-vendor.txt
-$(INSTALLED_FILES_FILE_VENDOR) : $(INTERNAL_VENDORIMAGE_FILES)
+$(INSTALLED_FILES_FILE_VENDOR) : $(INTERNAL_VENDORIMAGE_FILES) $(FILESLIST)
@echo Installed file list: $@
@mkdir -p $(dir $@)
@rm -f $@
- $(hide) build/tools/fileslist.py $(TARGET_OUT_VENDOR) > $(@:.txt=.json)
+ $(hide) $(FILESLIST) $(TARGET_OUT_VENDOR) > $(@:.txt=.json)
$(hide) build/tools/fileslist_util.py -c $(@:.txt=.json) > $@
vendorimage_intermediates := \
diff --git a/core/clang/versions.mk b/core/clang/versions.mk
index abed69b..c5cc690 100644
--- a/core/clang/versions.mk
+++ b/core/clang/versions.mk
@@ -1,4 +1,4 @@
## Clang/LLVM release versions.
-LLVM_PREBUILTS_VERSION ?= clang-3688880
+LLVM_PREBUILTS_VERSION ?= clang-3859424
LLVM_PREBUILTS_BASE ?= prebuilts/clang/host
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 2e305f7..0067c9f 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -2,7 +2,8 @@
## Clear out values of all variables used by rule templates.
###########################################################
-LOCAL_32_BIT_ONLY:= # '',true
+# '',true
+LOCAL_32_BIT_ONLY:=
LOCAL_AAPT_FLAGS:=
LOCAL_AAPT_INCLUDE_ALL_RESOURCES:=
LOCAL_ADDITIONAL_CERTIFICATES:=
@@ -100,7 +101,8 @@
LOCAL_JACK_CLASSPATH:=
LOCAL_JACK_COVERAGE_EXCLUDE_FILTER:=
LOCAL_JACK_COVERAGE_INCLUDE_FILTER:=
-LOCAL_JACK_ENABLED:=$(DEFAULT_JACK_ENABLED) # '' (ie disabled), disabled, full, incremental
+# '' (ie disabled), disabled, full, incremental
+LOCAL_JACK_ENABLED:=$(DEFAULT_JACK_ENABLED)
LOCAL_JACK_FLAGS:=
LOCAL_JACK_PLUGIN:=
LOCAL_JACK_PLUGIN_PATH:=
@@ -179,12 +181,14 @@
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES:=
LOCAL_PREBUILT_STRIP_COMMENTS:=
LOCAL_PRIVILEGED_MODULE:=
-LOCAL_PROGUARD_ENABLED:= # '',full,custom,nosystem,disabled,obfuscation,optimization
+# '',full,custom,nosystem,disabled,obfuscation,optimization
+LOCAL_PROGUARD_ENABLED:=
LOCAL_PROGUARD_FLAG_FILES:=
LOCAL_PROGUARD_FLAGS:=
LOCAL_PROPRIETARY_MODULE:=
LOCAL_PROTOC_FLAGS:=
-LOCAL_PROTOC_OPTIMIZE_TYPE:= # lite(default),micro,nano,stream,full,nanopb-c,nanopb-c-enable_malloc
+# lite(default),micro,nano,stream,full,nanopb-c,nanopb-c-enable_malloc
+LOCAL_PROTOC_OPTIMIZE_TYPE:=
LOCAL_PROTO_JAVA_OUTPUT_PARAMS:=
LOCAL_RECORDED_MODULE_TYPE:=
LOCAL_RENDERSCRIPT_CC:=
@@ -209,7 +213,8 @@
LOCAL_SDK_VERSION:=
LOCAL_SHARED_ANDROID_LIBRARIES:=
LOCAL_SHARED_LIBRARIES:=
-LOCAL_SOURCE_FILES_ALL_GENERATED:= # '',true
+# '',true
+LOCAL_SOURCE_FILES_ALL_GENERATED:=
LOCAL_SRC_FILES:=
LOCAL_SRC_FILES_EXCLUDE:=
LOCAL_STATIC_ANDROID_LIBRARIES:=
diff --git a/core/config.mk b/core/config.mk
index 319a069..9c93240 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -497,6 +497,7 @@
SOONG_ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/soong_zip
ZIP2ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/zip2zip
+FILESLIST := $(SOONG_HOST_OUT_EXECUTABLES)/fileslist
JAVAC_FILTER := $(SOONG_HOST_OUT_EXECUTABLES)/soong_javac_filter
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index b107ded..f940c72 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -23,6 +23,9 @@
# being used). To bundle everything one should set this to '%'
SYSTEM_OTHER_ODEX_FILTER ?= app/% priv-app/%
+# Method returning whether the install path $(1) should be for system_other.
+install-on-system-other = $(filter-out $(PRODUCT_SYSTEM_SERVER_APPS),$(basename $(notdir $(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(1)))))
+
# The default values for pre-opting: always preopt PIC.
# Conditional to building on linux, as dex2oat currently does not work on darwin.
ifeq ($(HOST_OS),linux)
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index ffb888c..8ee800b 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -61,7 +61,7 @@
# $(2): the full install path (including file name) of the corresponding .apk.
ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true)
define get-odex-installed-file-path
-$(if $(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(2)),
+$(if $(call install-on-system-other, $(2)),
$(call get-odex-file-path,$(1),$(patsubst $(TARGET_OUT)/%,$(TARGET_OUT_SYSTEM_OTHER)/%,$(2))),
$(call get-odex-file-path,$(1),$(2)))
endef
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 68c46f5..4d8e2d2 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -42,7 +42,7 @@
# if installing into system, and odex are being installed into system_other, don't strip
ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true)
ifeq ($(LOCAL_DEX_PREOPT),true)
-ifneq ($(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(my_module_path)),)
+ifneq ($(call install-on-system-other, $(my_module_path)),)
LOCAL_DEX_PREOPT := nostripping
endif
endif
@@ -151,6 +151,13 @@
LOCAL_DEX_PREOPT_FLAGS := $(PRODUCT_DEX_PREOPT_DEFAULT_FLAGS)
endif
endif
+
+# Jars of system server, and apps loaded into system server should be
+# compiled with the 'speed' compiler filter.
+ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE)))
+ LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed
+endif
+
$(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS)
$(built_vdex): $(built_odex)
$(built_art): $(built_odex)
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 456b0db..eadd316 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -112,6 +112,7 @@
TARGET_COPY_OUT_SYSTEM := system
TARGET_COPY_OUT_SYSTEM_OTHER := system_other
TARGET_COPY_OUT_DATA := data
+TARGET_COPY_OUT_ASAN := $(TARGET_COPY_OUT_DATA)/asan
TARGET_COPY_OUT_OEM := oem
TARGET_COPY_OUT_ODM := odm
TARGET_COPY_OUT_ROOT := root
@@ -335,7 +336,7 @@
TARGET_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_SYSTEM)
ifneq ($(filter address,$(SANITIZE_TARGET)),)
-target_out_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)
+target_out_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/system
else
target_out_shared_libraries_base := $(TARGET_OUT)
endif
@@ -415,7 +416,7 @@
TARGET_OUT_VENDOR := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_VENDOR)
ifneq ($(filter address,$(SANITIZE_TARGET)),)
-target_out_vendor_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)/vendor
+target_out_vendor_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/vendor
else
target_out_vendor_shared_libraries_base := $(TARGET_OUT_VENDOR)
endif
diff --git a/core/product.mk b/core/product.mk
index fffd7c8..eeaf700 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -111,6 +111,7 @@
PRODUCT_SUPPORTS_VERITY_FEC \
PRODUCT_OEM_PROPERTIES \
PRODUCT_SYSTEM_PROPERTY_BLACKLIST \
+ PRODUCT_SYSTEM_SERVER_APPS \
PRODUCT_SYSTEM_SERVER_JARS \
PRODUCT_VBOOT_SIGNING_KEY \
PRODUCT_VBOOT_SIGNING_SUBKEY \
diff --git a/core/product_config.mk b/core/product_config.mk
index 7a2d9cb..5675f2f 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -268,6 +268,7 @@
# A list of module names of BOOTCLASSPATH (jar files)
PRODUCT_BOOT_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_BOOT_JARS))
PRODUCT_SYSTEM_SERVER_JARS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_JARS))
+PRODUCT_SYSTEM_SERVER_APPS := $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_SERVER_APPS))
# Find the device that this product maps to.
TARGET_DEVICE := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE)
diff --git a/target/board/generic_arm64_ab/BoardConfig.mk b/target/board/generic_arm64_ab/BoardConfig.mk
index 13f2820..4c57f31 100644
--- a/target/board/generic_arm64_ab/BoardConfig.mk
+++ b/target/board/generic_arm64_ab/BoardConfig.mk
@@ -85,10 +85,8 @@
BOARD_NAND_SPARE_SIZE := 0
BOARD_FLASH_BLOCK_SIZE := 512
-###############################################################################
-# Below are sailfish/marlin specific configs.
-# Must be moved after early-mount is supported.
-###############################################################################
-BOARD_SEPOLICY_DIRS += device/google/marlin/sepolicy
-
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
+
+# TODO(b/36764215): remove this setting when the generic system image
+# no longer has QCOM-specific directories under /.
+BOARD_SEPOLICY_DIRS += build/target/board/generic_arm64_ab/sepolicy
diff --git a/target/board/generic_arm64_ab/sepolicy/file.te b/target/board/generic_arm64_ab/sepolicy/file.te
new file mode 100644
index 0000000..4645533
--- /dev/null
+++ b/target/board/generic_arm64_ab/sepolicy/file.te
@@ -0,0 +1,7 @@
+# TODO(b/36764215): remove this file when the generic system image
+# no longer has these directories
+type bt_firmware_file, file_type;
+type persist_file, file_type;
+
+# Default type for anything under /firmware.
+type firmware_file, fs_type, contextmount_type;
diff --git a/target/board/generic_arm64_ab/sepolicy/file_contexts b/target/board/generic_arm64_ab/sepolicy/file_contexts
new file mode 100644
index 0000000..92a4ff8
--- /dev/null
+++ b/target/board/generic_arm64_ab/sepolicy/file_contexts
@@ -0,0 +1,13 @@
+# TODO(b/36764215): remove this file when the generic system image
+# no longer has these directories. They are specific to QCOM.
+
+# /
+/bt_firmware(/.*)? u:object_r:bt_firmware_file:s0
+/tombstones u:object_r:rootfs:s0
+/dsp u:object_r:rootfs:s0
+
+# /persist
+/persist(/.*)? u:object_r:persist_file:s0
+
+# files in firmware
+/firmware(/.*)? u:object_r:firmware_file:s0
diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk
index e12b563..6448d9a 100644
--- a/target/product/aosp_arm64_ab.mk
+++ b/target/product/aosp_arm64_ab.mk
@@ -34,6 +34,10 @@
PRODUCT_COPY_FILES += \
vendor/google/products/marlin/bootanimation-1440-256col.zip:system/media/bootanimation.zip
+# TODO(jiyong): remove this marlin-specific overlay when b/35742444 is fixed.
+PRODUCT_PACKAGE_OVERLAYS := \
+ device/google/marlin/overlay
+
#split selinux policy
PRODUCT_FULL_TREBLE_OVERRIDE := true
diff --git a/target/product/core.mk b/target/product/core.mk
index c4c7cab..e563634 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -59,6 +59,14 @@
Telecom \
TeleService \
VpnDialogs \
+ vr \
MmsService
+# The set of packages whose code can be loaded by the system server.
+PRODUCT_SYSTEM_SERVER_APPS += \
+ FusedLocation \
+ InputDevices \
+ KeyChain \
+ Telecom \
+
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_base.mk)
diff --git a/target/product/core_minimal.mk b/target/product/core_minimal.mk
index 893aa4e..0f09eaf 100644
--- a/target/product/core_minimal.mk
+++ b/target/product/core_minimal.mk
@@ -112,6 +112,11 @@
ethernet-service \
wifi-service
+# The set of packages whose code can be loaded by the system server.
+PRODUCT_SYSTEM_SERVER_APPS += \
+ SettingsProvider \
+ WallpaperBackup
+
# Adoptable external storage supports both ext4 and f2fs
PRODUCT_PACKAGES += \
e2fsck \
diff --git a/target/product/core_tiny.mk b/target/product/core_tiny.mk
index b6b064d..3692cf1 100644
--- a/target/product/core_tiny.mk
+++ b/target/product/core_tiny.mk
@@ -105,6 +105,13 @@
services \
wifi-service
+# The set of packages whose code can be loaded by the system server.
+PRODUCT_SYSTEM_SERVER_APPS += \
+ FusedLocation \
+ InputDevices \
+ SettingsProvider \
+ WallpaperBackup \
+
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
ro.zygote=zygote32
PRODUCT_COPY_FILES += \
diff --git a/target/product/sdk_base.mk b/target/product/sdk_base.mk
index 30beb9b..0cdb05d 100644
--- a/target/product/sdk_base.mk
+++ b/target/product/sdk_base.mk
@@ -47,6 +47,7 @@
sqlite3 \
SystemUI \
EasterEgg \
+ WallpaperPicker \
WidgetPreview
# Define the host tools and libs that are parts of the SDK.
diff --git a/tools/fileslist.py b/tools/fileslist.py
deleted file mode 100755
index b9e7350..0000000
--- a/tools/fileslist.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2009 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.
-#
-
-import json, hashlib, operator, os, sys
-
-def get_file_size(path):
- st = os.lstat(path)
- return st.st_size;
-
-def get_file_digest(path):
- if os.path.isfile(path) == False:
- return "----------------------------------------------------------------"
- digest = hashlib.sha256()
- with open(path, 'rb') as f:
- while True:
- buf = f.read(1024*1024)
- if not buf:
- break
- digest.update(buf)
- return digest.hexdigest();
-
-def main(argv):
- output = []
- roots = argv[1:]
- for root in roots:
- base = len(root[:root.rfind(os.path.sep)])
- for dir, dirs, files in os.walk(root):
- relative = dir[base:]
- for f in files:
- try:
- path = os.path.sep.join((dir, f))
- row = {
- "Size": get_file_size(path),
- "Name": os.path.sep.join((relative, f)),
- "SHA256": get_file_digest(path),
- }
- output.append(row)
- except os.error:
- pass
- output.sort(key=operator.itemgetter("Size", "Name"), reverse=True)
- print json.dumps(output, indent=2, separators=(',',': '))
-
-if __name__ == '__main__':
- main(sys.argv)