Merge "Recognize new clang-tidy and Java warnings."
diff --git a/core/Makefile b/core/Makefile
index f9de658..4ed8947 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2058,7 +2058,7 @@
$(hide) rm -rf $@ $(PRIVATE_LIST_FILE)
$(hide) mkdir -p $(dir $@) $(TARGET_OUT_UNSTRIPPED) $(dir $(PRIVATE_LIST_FILE))
$(hide) find $(TARGET_OUT_UNSTRIPPED) | sort >$(PRIVATE_LIST_FILE)
- $(hide) $(SOONG_ZIP) -d -o $@ -C $(TARGET_OUT_UNSTRIPPED) -l $(PRIVATE_LIST_FILE)
+ $(hide) $(SOONG_ZIP) -d -o $@ -C . -l $(PRIVATE_LIST_FILE)
# -----------------------------------------------------------------
# A zip of the Android Apps. Not keeping full path so that we don't
diff --git a/core/clang/config.mk b/core/clang/config.mk
index 7113892..c2a0bf4 100644
--- a/core/clang/config.mk
+++ b/core/clang/config.mk
@@ -138,11 +138,6 @@
# provides to Clang (for supporting features like -ftrapv).
COMPILER_RT_CONFIG_EXTRA_STATIC_LIBRARIES := libcompiler_rt-extras
-ifeq ($(HOST_PREFER_32_BIT),true)
-# We don't have 32-bit prebuilt libLLVM/libclang, so force to build them from source.
-FORCE_BUILD_LLVM_COMPONENTS := true
-endif
-
# A list of projects that are allowed to set LOCAL_CLANG to false.
# INTERNAL_LOCAL_CLANG_EXCEPTION_PROJECTS is defined later in other config.mk.
LOCAL_CLANG_EXCEPTION_PROJECTS = \
diff --git a/core/combo/arch/mips64/mips64r6.mk b/core/combo/arch/mips64/mips64r6.mk
index 9d9068c..42d6c9e 100644
--- a/core/combo/arch/mips64/mips64r6.mk
+++ b/core/combo/arch/mips64/mips64r6.mk
@@ -1,3 +1,3 @@
# Configuration for Android on mips64r6.
-ARCH_MIPS_REV6 := true
+ARCH_MIPS64_REV6 := true
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 3ecd219..a221fb9 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -298,11 +298,7 @@
# The default host library path.
# It always points to the path where we build libraries in the default bitness.
-ifeq ($(HOST_PREFER_32_BIT),true)
-HOST_LIBRARY_PATH := $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)
-else
HOST_LIBRARY_PATH := $(HOST_OUT_SHARED_LIBRARIES)
-endif
# Out for HOST_CROSS_2ND_ARCH
HOST_CROSS_2ND_ARCH_VAR_PREFIX := 2ND_
diff --git a/core/executable_prefer_symlink.mk b/core/executable_prefer_symlink.mk
index e59e8c2..9b9814e 100644
--- a/core/executable_prefer_symlink.mk
+++ b/core/executable_prefer_symlink.mk
@@ -33,11 +33,7 @@
endif
else
my_symlink := $(addprefix $(HOST_OUT)/bin/, $(LOCAL_MODULE))
- ifneq ($(HOST_PREFER_32_BIT),true)
- my_src_binary_name := $(LOCAL_MODULE_STEM_64)
- else
- my_src_binary_name := $(LOCAL_MODULE_STEM_32)
- endif
+ my_src_binary_name := $(LOCAL_MODULE_STEM_64)
endif
$(call symlink-file,$(my_module_path)/$(my_src_binary_name),$(my_src_binary_name),$(my_symlink))
diff --git a/core/fuzz_test.mk b/core/fuzz_test.mk
index c31e2e7..f6d6e9a 100644
--- a/core/fuzz_test.mk
+++ b/core/fuzz_test.mk
@@ -23,8 +23,8 @@
$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_64 when building test $(LOCAL_MODULE))
endif
-LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
-LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
+LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(LOCAL_MODULE)
+LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(LOCAL_MODULE)
ifndef LOCAL_MULTILIB
ifndef LOCAL_32_BIT_ONLY
diff --git a/core/host_executable.mk b/core/host_executable.mk
index 78223eb..1480c2c 100644
--- a/core/host_executable.mk
+++ b/core/host_executable.mk
@@ -6,14 +6,10 @@
ifndef LOCAL_MODULE_HOST_ARCH
ifndef my_module_multilib
-ifeq ($(HOST_PREFER_32_BIT),true)
-my_module_multilib := 32
-else
# By default we only build host module for the first arch.
my_module_multilib := first
endif
endif
-endif
ifeq ($(LOCAL_NO_FPIE),)
LOCAL_LDFLAGS += $(HOST_FPIE_FLAGS)
diff --git a/core/host_shared_library.mk b/core/host_shared_library.mk
index df24b63..5da7913 100644
--- a/core/host_shared_library.mk
+++ b/core/host_shared_library.mk
@@ -6,14 +6,10 @@
ifndef LOCAL_MODULE_HOST_ARCH
ifndef my_module_multilib
-ifeq ($(HOST_PREFER_32_BIT),true)
-my_module_multilib := 32
-else
# libraries default to building for both architecturess
my_module_multilib := both
endif
endif
-endif
LOCAL_2ND_ARCH_VAR_PREFIX :=
include $(BUILD_SYSTEM)/module_arch_supported.mk
diff --git a/core/host_static_library.mk b/core/host_static_library.mk
index 61f5569..aa0421e 100644
--- a/core/host_static_library.mk
+++ b/core/host_static_library.mk
@@ -6,14 +6,10 @@
ifndef LOCAL_MODULE_HOST_ARCH
ifndef my_module_multilib
-ifeq ($(HOST_PREFER_32_BIT),true)
-my_module_multilib := 32
-else
# libraries default to building for both architecturess
my_module_multilib := both
endif
endif
-endif
LOCAL_2ND_ARCH_VAR_PREFIX :=
include $(BUILD_SYSTEM)/module_arch_supported.mk
diff --git a/core/soong.mk b/core/soong.mk
index 29a91e2..50831ba 100644
--- a/core/soong.mk
+++ b/core/soong.mk
@@ -53,7 +53,6 @@
echo ' "Schedboost": $(if $(strip $(ENABLE_SCHEDBOOST)),true,false),'; \
echo ' "Binder32bit": $(if $(BINDER32BIT),true,false),'; \
echo ' "DevicePrefer32BitExecutables": $(if $(filter true,$(TARGET_PREFER_32_BIT_EXECUTABLES)),true,false),'; \
- echo ' "HostPrefer32BitExecutables": $(if $(filter true,$(HOST_PREFER_32_BIT)),true,false),'; \
echo ' "UseGoma": $(if $(filter-out false,$(USE_GOMA)),true,false),'; \
echo ''; \
echo ' "DeviceName": "$(TARGET_DEVICE)",'; \
diff --git a/envsetup.sh b/envsetup.sh
index ea2446c..e919891 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -886,8 +886,10 @@
echo "Couldn't locate the top of the tree. Try setting TOP."
return 1
fi
- local MY_PWD=`PWD= /bin/pwd|sed 's:'$T'/::'`
- local MODULES_IN_PATHS=MODULES-IN-$MY_PWD
+ local M=$(findmakefile)
+ # Remove the path to top as the makefilepath needs to be relative
+ local M=`echo $M|sed 's:'$T'/::'`
+ local MODULES_IN_PATHS=MODULES-IN-$(dirname ${M})
# Convert "/" to "-".
MODULES_IN_PATHS=${MODULES_IN_PATHS//\//-}
$DRV make -C $T -f build/core/main.mk $@ $MODULES_IN_PATHS
diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk
index ebc1675..ed9c9b3 100644
--- a/target/board/generic_mips64/BoardConfig.mk
+++ b/target/board/generic_mips64/BoardConfig.mk
@@ -31,7 +31,10 @@
TARGET_2ND_ARCH := mips
ifeq (,$(TARGET_2ND_ARCH_VARIANT))
ifeq ($(TARGET_ARCH_VARIANT),mips64r6)
-TARGET_2ND_ARCH_VARIANT := mips32r6
+# Imgtec builds use 32r6 arch variant with Imgtec-maintained prebuilts/ndk library:
+# TARGET_2ND_ARCH_VARIANT := mips32r6
+# Aosp builds lack full set of mips32r6 NDK prebuilts, so use 32r2 abi:
+TARGET_2ND_ARCH_VARIANT := mips32r2-fp
else
TARGET_2ND_ARCH_VARIANT := mips32r2-fp
endif
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index 9ee472b..a7b3fdd 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -109,7 +109,8 @@
Args:
partition_size: the size of the partition to be verified.
Returns:
- The size of the partition adjusted for verity metadata.
+ A tuple of the size of the partition adjusted for verity metadata, and
+ the size of verity metadata.
"""
key = "%d %d" % (partition_size, fec_supported)
if key in AdjustPartitionSizeForVerity.results:
@@ -121,27 +122,31 @@
# verity tree and fec sizes depend on the partition size, which
# means this estimate is always going to be unnecessarily small
- lo = partition_size - GetVeritySize(hi, fec_supported)
+ verity_size = GetVeritySize(hi, fec_supported)
+ lo = partition_size - verity_size
result = lo
# do a binary search for the optimal size
while lo < hi:
i = ((lo + hi) // (2 * BLOCK_SIZE)) * BLOCK_SIZE
- size = i + GetVeritySize(i, fec_supported)
- if size <= partition_size:
+ v = GetVeritySize(i, fec_supported)
+ if i + v <= partition_size:
if result < i:
result = i
+ verity_size = v
lo = i + BLOCK_SIZE
else:
hi = i
- AdjustPartitionSizeForVerity.results[key] = result
- return result
+ AdjustPartitionSizeForVerity.results[key] = (result, verity_size)
+ return (result, verity_size)
AdjustPartitionSizeForVerity.results = {}
-def BuildVerityFEC(sparse_image_path, verity_path, verity_fec_path):
- cmd = "fec -e %s %s %s" % (sparse_image_path, verity_path, verity_fec_path)
+def BuildVerityFEC(sparse_image_path, verity_path, verity_fec_path,
+ padding_size):
+ cmd = "fec -e -p %d %s %s %s" % (padding_size, sparse_image_path,
+ verity_path, verity_fec_path)
print cmd
status, output = commands.getstatusoutput(cmd)
if status:
@@ -204,7 +209,7 @@
def BuildVerifiedImage(data_image_path, verity_image_path,
verity_metadata_path, verity_fec_path,
- fec_supported):
+ padding_size, fec_supported):
if not Append(verity_image_path, verity_metadata_path,
"Could not append verity metadata!"):
return False
@@ -212,7 +217,7 @@
if fec_supported:
# build FEC for the entire partition, including metadata
if not BuildVerityFEC(data_image_path, verity_image_path,
- verity_fec_path):
+ verity_fec_path, padding_size):
return False
if not Append(verity_image_path, verity_fec_path, "Could not append FEC!"):
@@ -250,7 +255,7 @@
True on success, False otherwise.
"""
# get properties
- image_size = prop_dict["partition_size"]
+ image_size = int(prop_dict["partition_size"])
block_dev = prop_dict["verity_block_device"]
signer_key = prop_dict["verity_key"] + ".pk8"
if OPTIONS.verity_signer_path is not None:
@@ -281,10 +286,17 @@
return False
# build the full verified image
+ target_size = int(prop_dict["original_partition_size"])
+ verity_size = int(prop_dict["verity_size"])
+
+ padding_size = target_size - image_size - verity_size
+ assert padding_size >= 0
+
if not BuildVerifiedImage(out_file,
verity_image_path,
verity_metadata_path,
verity_fec_path,
+ padding_size,
fec_supported):
shutil.rmtree(tempdir_name, ignore_errors=True)
return False
@@ -355,12 +367,13 @@
# verified.
if verity_supported and is_verity_partition:
partition_size = int(prop_dict.get("partition_size"))
- adjusted_size = AdjustPartitionSizeForVerity(partition_size,
- verity_fec_supported)
+ (adjusted_size, verity_size) = AdjustPartitionSizeForVerity(partition_size,
+ verity_fec_supported)
if not adjusted_size:
return False
prop_dict["partition_size"] = str(adjusted_size)
prop_dict["original_partition_size"] = str(partition_size)
+ prop_dict["verity_size"] = str(verity_size)
if fs_type.startswith("ext"):
build_command = ["mkuserimg.sh"]