Merge "Error out early on nonstandard JDK directory layouts"
diff --git a/core/Makefile b/core/Makefile
index 7e7dd77..db568d0 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1588,7 +1588,7 @@
$(hide) echo "use_set_metadata=1" >> $(zip_root)/META/misc_info.txt
$(hide) echo "multistage_support=1" >> $(zip_root)/META/misc_info.txt
$(hide) echo "update_rename_support=1" >> $(zip_root)/META/misc_info.txt
- $(hide) echo "blockimgdiff_versions=1,2,3" >> $(zip_root)/META/misc_info.txt
+ $(hide) echo "blockimgdiff_versions=1,2,3,4" >> $(zip_root)/META/misc_info.txt
ifneq ($(OEM_THUMBPRINT_PROPERTIES),)
# OTA scripts are only interested in fingerprint related properties
$(hide) echo "oem_fingerprint_properties=$(OEM_THUMBPRINT_PROPERTIES)" >> $(zip_root)/META/misc_info.txt
@@ -1608,7 +1608,7 @@
ifeq ($(AB_OTA_UPDATER),true)
@# When using the A/B updater, include the updater config files in the zip.
$(hide) $(ACP) $(TOPDIR)system/update_engine/update_engine.conf $(zip_root)/META/update_engine_config.txt
- $(hide) for part in $(UPDATE_AB_PARTITIONS); do \
+ $(hide) for part in $(AB_OTA_PARTITIONS); do \
echo "$${part}" >> $(zip_root)/META/ab_partitions.txt; \
done
ifdef OSRELEASED_DIRECTORY
diff --git a/core/binary.mk b/core/binary.mk
index 28aa882..e9b2265 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -203,6 +203,14 @@
endif
my_cpp_std_version := -std=gnu++14
+
+ifneq ($(my_clang),true)
+ # GCC uses an invalid C++14 ABI (emits calls to
+ # __cxa_throw_bad_array_length, which is not a valid C++ RT ABI).
+ # http://b/25022512
+ my_cpp_std_version := -std=gnu++11
+endif
+
ifdef LOCAL_SDK_VERSION
# The NDK handles this itself.
my_cpp_std_version :=
diff --git a/core/config.mk b/core/config.mk
index 423cb9f..680a169 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -550,6 +550,8 @@
MD5SUM:=md5sum
endif
+NORMALIZE_PATH := build/tools/normalize_path.py
+
APICHECK_CLASSPATH := $(HOST_JDK_TOOLS_JAR)
APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX)
diff --git a/core/configure_local_jack.mk b/core/configure_local_jack.mk
index d903ed9..2270c88 100644
--- a/core/configure_local_jack.mk
+++ b/core/configure_local_jack.mk
@@ -19,6 +19,7 @@
endif
LOCAL_JACK_ENABLED := $(strip $(LOCAL_JACK_ENABLED))
+LOCAL_MODULE := $(strip $(LOCAL_MODULE))
ifneq ($(LOCAL_JACK_ENABLED),full)
ifneq ($(LOCAL_JACK_ENABLED),incremental)
diff --git a/core/definitions.mk b/core/definitions.mk
index a036a25..ecc7253 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1804,7 +1804,7 @@
find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name '*.java' -and -not -name '.*' >> $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list; \
fi
$(hide) tr ' ' '\n' < $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list \
- | sort -u > $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq
+ | $(NORMALIZE_PATH) | sort -u > $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq
$(hide) if [ -s $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then \
$(1) -encoding UTF-8 \
$(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \
@@ -1867,7 +1867,7 @@
find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name '*.java' >> $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list; \
fi
$(hide) tr ' ' '\n' < $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list \
- | sort -u > $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq
+ | $(NORMALIZE_PATH) | sort -u > $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq
$(if $(PRIVATE_JACK_PROGUARD_FLAGS), \
$(hide) echo -basedirectory $(CURDIR) > $@.flags; \
echo $(PRIVATE_JACK_PROGUARD_FLAGS) >> $@.flags; \
@@ -1946,7 +1946,7 @@
find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name '*.java' >> $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list; \
fi
$(hide) tr ' ' '\n' < $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list \
- | sort -u > $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq
+ | $(NORMALIZE_PATH) | sort -u > $(PRIVATE_JACK_INTERMEDIATES_DIR)/java-source-list-uniq
$(if $(PRIVATE_JACK_PROGUARD_FLAGS), \
$(hide) echo -basedirectory $(CURDIR) > $@.flags; \
echo $(PRIVATE_JACK_PROGUARD_FLAGS) >> $@.flags; \
diff --git a/core/main.mk b/core/main.mk
index e20128b..15b3c27 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -504,6 +504,7 @@
# A helper goal printing out install paths
.PHONY: GET-INSTALL-PATH
GET-INSTALL-PATH:
+ @echo "Install paths for modules in $(ONE_SHOT_MAKEFILE):"
@$(foreach m, $(ALL_MODULES), $(if $(ALL_MODULES.$(m).INSTALLED), \
echo 'INSTALL-PATH: $(m) $(ALL_MODULES.$(m).INSTALLED)';))
diff --git a/core/package_internal.mk b/core/package_internal.mk
index 1f98cdc..a2cbe31 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -241,7 +241,7 @@
$(R_file_stamp): PRIVATE_PROGUARD_OPTIONS_FILE := $(proguard_options_file)
$(R_file_stamp): $(all_res_assets) $(full_android_manifest) $(RenderScript_file_stamp) $(AAPT) | $(ACP)
@echo "target R.java/Manifest.java: $(PRIVATE_MODULE) ($@)"
- @rm -f $@
+ @rm -rf $@ && mkdir -p $(dir $@)
$(create-resource-java-files)
$(hide) for GENERATED_MANIFEST_FILE in `find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) \
-name Manifest.java 2> /dev/null`; do \
@@ -256,7 +256,10 @@
$(ACP) -fp $$GENERATED_R_FILE $(TARGET_COMMON_OUT_ROOT)/R/$$dir \
|| exit 31; \
$(ACP) -fp $$GENERATED_R_FILE $@ || exit 32; \
- done; \
+ done;
+ @# Ensure that the target file is always created, i.e. also in case we did not
+ @# enter the GENERATED_R_FILE-loop above. This avoids unnecessary rebuilding.
+ $(hide) touch $@
$(proguard_options_file): $(R_file_stamp)
diff --git a/tools/normalize_path.py b/tools/normalize_path.py
new file mode 100755
index 0000000..1b3d42e
--- /dev/null
+++ b/tools/normalize_path.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2015 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.
+"""
+Normalize and output paths read from stdin.
+"""
+
+import os.path
+import sys
+
+for line in sys.stdin:
+ print os.path.normpath(line.strip())
diff --git a/tools/releasetools/blockimgdiff.py b/tools/releasetools/blockimgdiff.py
index 882cc87..1a5b93d 100644
--- a/tools/releasetools/blockimgdiff.py
+++ b/tools/releasetools/blockimgdiff.py
@@ -241,7 +241,7 @@
# original image.
class BlockImageDiff(object):
- def __init__(self, tgt, src=None, threads=None, version=3):
+ def __init__(self, tgt, src=None, threads=None, version=4):
if threads is None:
threads = multiprocessing.cpu_count() // 2
if threads == 0:
@@ -252,7 +252,7 @@
self.src_basenames = {}
self.src_numpatterns = {}
- assert version in (1, 2, 3)
+ assert version in (1, 2, 3, 4)
self.tgt = tgt
if src is None: