Merge "Move 6 packages up from core_base.mk"
diff --git a/core/config.mk b/core/config.mk
index 3045929..5562fe3 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -710,9 +710,6 @@
PROFMAN := $(HOST_OUT_EXECUTABLES)/profman
HIDDENAPI := $(HOST_OUT_EXECUTABLES)/hiddenapi
-# relocation packer
-RELOCATION_PACKER := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/relocation_packer/relocation_packer
-
FINDBUGS_DIR := external/owasp/sanitizer/tools/findbugs/bin
FINDBUGS := $(FINDBUGS_DIR)/findbugs
diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk
index aeead06..e2ac03c 100644
--- a/core/config_sanitizers.mk
+++ b/core/config_sanitizers.mk
@@ -12,10 +12,12 @@
my_global_sanitize_diag :=
ifeq ($(my_clang),true)
ifdef LOCAL_IS_HOST_MODULE
- my_global_sanitize := $(strip $(SANITIZE_HOST))
+ ifneq ($(HOST_CROSS_OS),windows)
+ my_global_sanitize := $(strip $(SANITIZE_HOST))
- # SANITIZE_HOST=true is a deprecated way to say SANITIZE_HOST=address.
- my_global_sanitize := $(subst true,address,$(my_global_sanitize))
+ # SANITIZE_HOST=true is a deprecated way to say SANITIZE_HOST=address.
+ my_global_sanitize := $(subst true,address,$(my_global_sanitize))
+ endif
else
my_global_sanitize := $(strip $(SANITIZE_TARGET))
my_global_sanitize_diag := $(strip $(SANITIZE_TARGET_DIAG))
diff --git a/core/definitions.mk b/core/definitions.mk
index 2c5fc6a..873ec7f 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -105,6 +105,9 @@
# All tests that should be skipped in presubmit check.
ALL_DISABLED_PRESUBMIT_TESTS :=
+# CLANG_TIDY_UNKNOWN_CFLAGS is generated by build/soong.
+sanitize_tidy_cflags = $(filter-out $(CLANG_TIDY_UNKNOWN_CFLAGS),$1)
+
###########################################################
## Debugging; prints a variable list to stdout
###########################################################
@@ -1264,7 +1267,7 @@
define clang-tidy-cpp
$(hide) $(PATH_TO_CLANG_TIDY) $(PRIVATE_TIDY_FLAGS) \
-checks=$(PRIVATE_TIDY_CHECKS) \
- $< -- $(transform-cpp-to-o-compiler-args)
+ $< -- $(call sanitize_tidy_cflags,$(transform-cpp-to-o-compiler-args))
endef
ifneq (,$(filter 1 true,$(WITH_TIDY_ONLY)))
@@ -1312,7 +1315,7 @@
define clang-tidy-c
$(hide) $(PATH_TO_CLANG_TIDY) $(PRIVATE_TIDY_FLAGS) \
-checks=$(PRIVATE_TIDY_CHECKS) \
- $< -- $(transform-c-to-o-compiler-args)
+ $< -- $(call sanitize_tidy_cflags,$(transform-c-to-o-compiler-args))
endef
ifneq (,$(filter 1 true,$(WITH_TIDY_ONLY)))
@@ -1382,7 +1385,7 @@
define clang-tidy-host-cpp
$(hide) $(PATH_TO_CLANG_TIDY) $(PRIVATE_TIDY_FLAGS) \
-checks=$(PRIVATE_TIDY_CHECKS) \
- $< -- $(transform-host-cpp-to-o-compiler-args)
+ $< -- $(call sanitize_tidy_cflags,$(transform-host-cpp-to-o-compiler-args))
endef
ifneq (,$(filter 1 true,$(WITH_TIDY_ONLY)))
@@ -1434,7 +1437,7 @@
define clang-tidy-host-c
$(hide) $(PATH_TO_CLANG_TIDY) $(PRIVATE_TIDY_FLAGS) \
-checks=$(PRIVATE_TIDY_CHECKS) \
- $< -- $(transform-host-c-to-o-compiler-args)
+ $< -- $(call sanitize_tidy_cflags,$(transform-host-c-to-o-compiler-args))
endef
ifneq (,$(filter 1 true,$(WITH_TIDY_ONLY)))
@@ -1898,16 +1901,6 @@
endef
###########################################################
-## Commands for packing a target executable or library
-###########################################################
-
-define pack-elf-relocations
-@echo "$($(PRIVATE_PREFIX)DISPLAY) Pack Relocations: $(PRIVATE_MODULE) ($@)"
-$(copy-file-to-target)
-$(hide) $(RELOCATION_PACKER) $@
-endef
-
-###########################################################
## Commands for running gcc to link an executable
###########################################################
diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk
index 939af33..2f9c8ff 100644
--- a/core/dynamic_binary.mk
+++ b/core/dynamic_binary.mk
@@ -40,28 +40,6 @@
###################################
###########################################################
-## Pack relocation tables
-###########################################################
-relocation_packer_input := $(linked_module)
-relocation_packer_output := $(intermediates)/PACKED/$(my_built_module_stem)
-
-include $(BUILD_SYSTEM)/pack_dyn_relocs_setup.mk
-
-# Stand-alone relocation_packer does not work with LLD output,
-# but it can be replaced by lld's --pack-dyn-relocs=android.
-ifeq (true,$(my_pack_module_relocations))
-ifeq (false,$(my_use_clang_lld))
-# Pack relocations
-$(relocation_packer_output): $(relocation_packer_input)
- $(pack-elf-relocations)
-else
-relocation_packer_output := $(relocation_packer_input)
-endif # my_use_clang_lld
-else
-relocation_packer_output := $(relocation_packer_input)
-endif # my_pack_module_relocations
-
-###########################################################
## Store a copy with symbols for symbolic debugging
###########################################################
ifeq ($(LOCAL_UNSTRIPPED_PATH),)
@@ -69,7 +47,7 @@
else
my_unstripped_path := $(LOCAL_UNSTRIPPED_PATH)
endif
-symbolic_input := $(relocation_packer_output)
+symbolic_input := $(linked_module)
symbolic_output := $(my_unstripped_path)/$(my_installed_module_stem)
$(symbolic_output) : $(symbolic_input)
@echo "target Symbolic: $(PRIVATE_MODULE) ($@)"
@@ -81,7 +59,7 @@
ifeq ($(BREAKPAD_GENERATE_SYMBOLS),true)
my_breakpad_path := $(TARGET_OUT_BREAKPAD)/$(patsubst $(PRODUCT_OUT)/%,%,$(my_module_path))
-breakpad_input := $(relocation_packer_output)
+breakpad_input := $(linked_module)
breakpad_output := $(my_breakpad_path)/$(my_installed_module_stem).sym
$(breakpad_output) : $(breakpad_input) | $(BREAKPAD_DUMP_SYMS) $(PRIVATE_READELF)
@echo "target breakpad: $(PRIVATE_MODULE) ($@)"
diff --git a/core/pack_dyn_relocs_setup.mk b/core/pack_dyn_relocs_setup.mk
index 2147f44..c5564b1 100644
--- a/core/pack_dyn_relocs_setup.mk
+++ b/core/pack_dyn_relocs_setup.mk
@@ -5,6 +5,7 @@
## LOCAL_PACK_MODULE_RELOCATIONS*,
## *TARGET_PACK_MODULE_RELOCATIONS,
## LOCAL_MODULE_CLASS, HOST_OS
+## LOCAL_IS_HOST_MODULE
## Output variables:
## my_pack_module_relocations, if false skip relocation_packer
#############################################################
@@ -23,11 +24,11 @@
# Do not pack relocations for executables. Because packing results in
# non-zero p_vaddr which causes kernel to load executables to lower
# address (starting at 0x8000) http://b/20665974
-ifneq ($(filter EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
+ifeq ($(filter SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),)
my_pack_module_relocations := false
endif
-# TODO (dimitry): Relocation packer is not yet available for darwin
-ifneq ($(HOST_OS),linux)
+ifdef LOCAL_IS_HOST_MODULE
+ # Do not pack relocations on host modules
my_pack_module_relocations := false
endif
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index d5b7877..c635ca5 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -9,13 +9,13 @@
include $(BUILD_SYSTEM)/use_lld_setup.mk
ifneq ($(LOCAL_PREBUILT_LIBS),)
-$(error dont use LOCAL_PREBUILT_LIBS anymore LOCAL_PATH=$(LOCAL_PATH))
+$(call pretty-error,dont use LOCAL_PREBUILT_LIBS anymore)
endif
ifneq ($(LOCAL_PREBUILT_EXECUTABLES),)
-$(error dont use LOCAL_PREBUILT_EXECUTABLES anymore LOCAL_PATH=$(LOCAL_PATH))
+$(call pretty-error,dont use LOCAL_PREBUILT_EXECUTABLES anymore)
endif
ifneq ($(LOCAL_PREBUILT_JAVA_LIBRARIES),)
-$(error dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore LOCAL_PATH=$(LOCAL_PATH))
+$(call pretty-error,dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore)
endif
my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32)
@@ -42,9 +42,6 @@
my_strip_module := $(firstword \
$(LOCAL_STRIP_MODULE_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) \
$(LOCAL_STRIP_MODULE))
-my_pack_module_relocations := $(firstword \
- $(LOCAL_PACK_MODULE_RELOCATIONS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) \
- $(LOCAL_PACK_MODULE_RELOCATIONS))
ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS))
# LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES indicates that this prebuilt should be
@@ -63,21 +60,6 @@
# Strip but not try to add debuglink
my_strip_module := no_debuglink
endif
-
- ifeq ($(LOCAL_IS_HOST_MODULE)$(my_pack_module_relocations),)
- # Do not pack relocations by default
- my_pack_module_relocations := false
- endif
-
- ifeq ($(DISABLE_RELOCATION_PACKER),true)
- my_pack_module_relocations := false
- endif
-
- # Relocation packer does not work with LLD yet.
- # my_use_clang_lld might be used before being set up in binary.mk
- ifeq ($(my_use_clang_lld),true)
- my_pack_module_relocations := false
- endif
endif
ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),)
@@ -141,23 +123,22 @@
endif # LOCAL_COMPRESSED_MODULE
endif
-ifneq ($(filter true keep_symbols no_debuglink mini-debug-info,$(my_strip_module) $(my_pack_module_relocations)),)
+ifneq ($(filter true keep_symbols no_debuglink mini-debug-info,$(my_strip_module)),)
ifdef LOCAL_IS_HOST_MODULE
- $(error Cannot strip/pack host module LOCAL_PATH=$(LOCAL_PATH))
+ $(call pretty-error,Cannot strip/pack host module)
endif
ifeq ($(filter SHARED_LIBRARIES EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
- $(error Can strip/pack only shared libraries or executables LOCAL_PATH=$(LOCAL_PATH))
+ $(call pretty-error,Can strip/pack only shared libraries or executables)
endif
ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
- $(error Cannot strip/pack scripts LOCAL_PATH=$(LOCAL_PATH))
+ $(call pretty-error,Cannot strip/pack scripts)
endif
- # Set the arch-specific variables to set up the strip/pack rules.
+ # Set the arch-specific variables to set up the strip rules
LOCAL_STRIP_MODULE_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) := $(my_strip_module)
- LOCAL_PACK_MODULE_RELOCATIONS_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) := $(my_pack_module_relocations)
include $(BUILD_SYSTEM)/dynamic_binary.mk
built_module := $(linked_module)
-else # my_strip_module and my_pack_module_relocations not true
+else # my_strip_module not true
include $(BUILD_SYSTEM)/base_rules.mk
built_module := $(LOCAL_BUILT_MODULE)
diff --git a/core/use_lld_setup.mk b/core/use_lld_setup.mk
index d00a5d3..b0386d5 100644
--- a/core/use_lld_setup.mk
+++ b/core/use_lld_setup.mk
@@ -18,10 +18,14 @@
endif
endif
-# Do not use LLD for Darwin host executables or shared libraries.
-# See https://lld.llvm.org/AtomLLD.html for status of lld for Mach-O.
ifeq ($(LOCAL_IS_HOST_MODULE),true)
+ # Do not use LLD for Darwin host executables or shared libraries. See
+ # https://lld.llvm.org/AtomLLD.html for status of lld for Mach-O.
ifeq ($(HOST_OS),darwin)
my_use_clang_lld := false
endif
+ # http://b/110800681 - lld cannot link Android's Windows modules yet.
+ ifeq ($(HOST_CROSS_OS),windows)
+ my_use_clang_lld := false
+ endif
endif
diff --git a/target/board/go_defaults.prop b/target/board/go_defaults.prop
new file mode 100644
index 0000000..93071cd
--- /dev/null
+++ b/target/board/go_defaults.prop
@@ -0,0 +1,15 @@
+#
+# Copyright (C) 2017 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.
+#
diff --git a/target/board/go_defaults_512.prop b/target/board/go_defaults_512.prop
new file mode 100644
index 0000000..a8eea9c
--- /dev/null
+++ b/target/board/go_defaults_512.prop
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2017 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.
+#
+
+# 512MB specific properties.
+
+# lmkd can kill more now.
+ro.lmk.medium=700
+
+# madvise random in ART to reduce page cache thrashing.
+dalvik.vm.madvise-random=true
diff --git a/target/board/go_defaults_common.prop b/target/board/go_defaults_common.prop
new file mode 100644
index 0000000..c0c0ef6
--- /dev/null
+++ b/target/board/go_defaults_common.prop
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2017 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.
+#
+
+# Sets Android Go recommended default values for propreties.
+
+# Set lowram options
+ro.config.low_ram=true
+ro.lmk.critical_upgrade=true
+ro.lmk.upgrade_pressure=40
+ro.lmk.downgrade_pressure=60
+ro.lmk.kill_heaviest_task=false
+ro.statsd.enable=false
+
+# set threshold to filter unused apps
+pm.dexopt.downgrade_after_inactive_days=10
+
+# set the compiler filter for shared apks to quicken.
+# Rationale: speed has a lot of dex code expansion, it uses more ram and space
+# compared to quicken. Using quicken for shared APKs on Go devices may save RAM.
+# Note that this is a trade-off: here we trade clean pages for dirty pages,
+# extra cpu and battery. That's because the quicken files will be jit-ed in all
+# the processes that load of shared apk and the code cache is not shared.
+# Some notable apps that will be affected by this are gms and chrome.
+# b/65591595.
+pm.dexopt.shared=quicken
+
+# Default heap sizes. Allow up to 256m for large heaps to make sure a single app
+# doesn't take all of the RAM.
+dalvik.vm.heapgrowthlimit=128m
+dalvik.vm.heapsize=256m
diff --git a/target/product/go_defaults.mk b/target/product/go_defaults.mk
index faa1852..7bb6d91 100644
--- a/target/product/go_defaults.mk
+++ b/target/product/go_defaults.mk
@@ -17,3 +17,6 @@
# Inherit common Android Go defaults.
$(call inherit-product, build/target/product/go_defaults_common.mk)
+# Add the system properties.
+TARGET_SYSTEM_PROP += \
+ build/make/target/board/go_defaults.prop
diff --git a/target/product/go_defaults_512.mk b/target/product/go_defaults_512.mk
index 56ab29b..5542818 100644
--- a/target/product/go_defaults_512.mk
+++ b/target/product/go_defaults_512.mk
@@ -17,12 +17,6 @@
# Inherit common Android Go defaults.
$(call inherit-product, build/target/product/go_defaults_common.mk)
-# 512MB specific properties.
-
-# lmkd can kill more now.
-PRODUCT_PROPERTY_OVERRIDES += \
- ro.lmk.medium=700 \
-
-# madvise random in ART to reduce page cache thrashing.
-PRODUCT_PROPERTY_OVERRIDES += \
- dalvik.vm.madvise-random=true
+# Add the system properties.
+TARGET_SYSTEM_PROP += \
+ build/make/target/board/go_defaults_512.prop
diff --git a/target/product/go_defaults_common.mk b/target/product/go_defaults_common.mk
index fbb9567..7e71e26 100644
--- a/target/product/go_defaults_common.mk
+++ b/target/product/go_defaults_common.mk
@@ -14,18 +14,7 @@
# limitations under the License.
#
-# Sets Android Go recommended default values for propreties.
-
-# Set lowram options
-PRODUCT_PROPERTY_OVERRIDES += \
- ro.config.low_ram=true \
- ro.lmk.critical_upgrade=true \
- ro.lmk.upgrade_pressure=40
-
-# set threshold to filter unused apps
-PRODUCT_PROPERTY_OVERRIDES += \
- pm.dexopt.downgrade_after_inactive_days=10
-
+# Sets Android Go recommended default product options.
# Speed profile services and wifi-service to reduce RAM and storage.
PRODUCT_SYSTEM_SERVER_COMPILER_FILTER := speed-profile
@@ -39,19 +28,14 @@
PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE := true
PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION := frameworks/base/config/boot-image-profile.txt
-# set the compiler filter for shared apks to quicken.
-# Rationale: speed has a lot of dex code expansion, it uses more ram and space
-# compared to quicken. Using quicken for shared APKs on Go devices may save RAM.
-# Note that this is a trade-off: here we trade clean pages for dirty pages,
-# extra cpu and battery. That's because the quicken files will be jit-ed in all
-# the processes that load of shared apk and the code cache is not shared.
-# Some notable apps that will be affected by this are gms and chrome.
-# b/65591595.
-PRODUCT_PROPERTY_OVERRIDES += \
- pm.dexopt.shared=quicken
+# Do not generate libartd.
+PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false
-# Default heap sizes. Allow up to 256m for large heaps to make sure a single app
-# doesn't take all of the RAM.
-PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapgrowthlimit=128m
-PRODUCT_PROPERTY_OVERRIDES += dalvik.vm.heapsize=256m
+# Strip the local variable table and the local variable type table to reduce
+# the size of the system image. This has no bearing on stack traces, but will
+# leave less information available via JDWP.
+PRODUCT_MINIMIZE_JAVA_DEBUG_INFO := true
+# Add the system properties.
+TARGET_SYSTEM_PROP += \
+ build/make/target/board/go_defaults_common.prop