Reconcile with jb-mr1-release - do not merge
Change-Id: If22290df508e894617f0acd115fe0661069dcd41
diff --git a/core/Makefile b/core/Makefile
index 2a214c6..4dde9f4 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1287,12 +1287,16 @@
# A zip of emma code coverage meta files. Generated for fully emma
# instrumented build.
#
+ifeq (true,$(EMMA_INSTRUMENT))
EMMA_META_ZIP := $(PRODUCT_OUT)/emma_meta.zip
-$(EMMA_META_ZIP): $(INSTALLED_SYSTEMIMAGE)
+# the dependency will be set up later in build/core/main.mk.
+$(EMMA_META_ZIP) :
@echo "Collecting Emma coverage meta files."
$(hide) find $(TARGET_COMMON_OUT_ROOT) -name "coverage.em" | \
zip -@ -q $@
+endif # EMMA_INSTRUMENT=true
+
# -----------------------------------------------------------------
# dalvik something
.PHONY: dalvikfiles
diff --git a/core/binary.mk b/core/binary.mk
index e17efa4..e10ec9c 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -161,31 +161,29 @@
###########################################################
## Define PRIVATE_ variables from global vars
###########################################################
-ifeq ($(strip $(LOCAL_CLANG)),true)
-my_target_global_cflags := $(TARGET_GLOBAL_CLANG_FLAGS)
-else
-my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS)
-endif
-
ifdef LOCAL_SDK_VERSION
my_target_project_includes :=
my_target_c_includes := $(my_ndk_stl_include_path) $(my_ndk_version_root)/usr/include
-# TODO: more reliable way to remove platform stuff.
-my_target_global_cflags := $(filter-out -include -I system/%, $(my_target_global_cflags))
-my_target_global_cppflags := $(filter-out -include -I system/%, $(TARGET_GLOBAL_CPPFLAGS))
+
+# filter out including of AndroidConfig.h in system/core.
+TARGET_GLOBAL_CFLAGS_NO_ANDCONF ?= $(subst $(TARGET_ANDROID_CONFIG_CFLAGS),,\
+ $(TARGET_GLOBAL_CFLAGS))
+my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS_NO_ANDCONF)
else
my_target_project_includes := $(TARGET_PROJECT_INCLUDES)
my_target_c_includes := $(TARGET_C_INCLUDES)
-my_target_global_cflags := $(my_target_global_cflags)
-my_target_global_cppflags := $(TARGET_GLOBAL_CPPFLAGS)
ifeq ($(strip $(LOCAL_CLANG)),true)
- my_target_c_includes += $(CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES)
-endif
-endif
+my_target_c_includes += $(CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES)
+my_target_global_cflags := $(TARGET_GLOBAL_CLANG_FLAGS)
+else
+my_target_global_cflags := $(TARGET_GLOBAL_CFLAGS)
+endif # LOCAL_CLANG
+endif # LOCAL_SDK_VERSION
+
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_PROJECT_INCLUDES := $(my_target_project_includes)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_C_INCLUDES := $(my_target_c_includes)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CFLAGS := $(my_target_global_cflags)
-$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CPPFLAGS := $(my_target_global_cppflags)
+$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_TARGET_GLOBAL_CPPFLAGS := $(TARGET_GLOBAL_CPPFLAGS)
###########################################################
## Define PRIVATE_ variables used by multiple module types
diff --git a/core/build_id.mk b/core/build_id.mk
index 2cbc365..40bb35d 100644
--- a/core/build_id.mk
+++ b/core/build_id.mk
@@ -1,4 +1,3 @@
-
#
# Copyright (C) 2008 The Android Open Source Project
#
@@ -14,9 +13,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
+#
+# Defines branch-specific values.
+#
+
# BUILD_ID is usually used to specify the branch name
# (like "MAIN") or a branch name and a release candidate
-# (like "CRB01"). It must be a single word, and is
+# (like "TC1-RC5"). It must be a single word, and is
# capitalized by convention.
+#
+BUILD_ID := MASTER
-export BUILD_ID=JOO47B
+# DISPLAY_BUILD_NUMBER should only be set for development branches,
+# If set, the BUILD_NUMBER (cl) is appended to the BUILD_ID for
+# a more descriptive BUILD_ID_DISPLAY, otherwise BUILD_ID_DISPLAY
+# is the same as BUILD_ID
+DISPLAY_BUILD_NUMBER := true
diff --git a/core/combo/HOST_darwin-x86.mk b/core/combo/HOST_darwin-x86.mk
index d263869..9e14b51 100644
--- a/core/combo/HOST_darwin-x86.mk
+++ b/core/combo/HOST_darwin-x86.mk
@@ -64,8 +64,10 @@
HOST_SHLIB_SUFFIX := .dylib
HOST_JNILIB_SUFFIX := .jnilib
+ifeq (,$(TARGET_BUILD_APPS))
HOST_GLOBAL_CFLAGS += \
-include $(call select-android-config-h,darwin-x86)
+endif
ifneq ($(filter 10.7 10.7.% 10.8 10.8.%, $(build_mac_version)),)
HOST_RUN_RANLIB_AFTER_COPYING := false
else
diff --git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk
index b369199..cb5f004 100644
--- a/core/combo/HOST_linux-x86.mk
+++ b/core/combo/HOST_linux-x86.mk
@@ -58,8 +58,10 @@
endif # BUILD_HOST_static
HOST_GLOBAL_CFLAGS += -fPIC
+ifeq (,$(TARGET_BUILD_APPS))
HOST_GLOBAL_CFLAGS += \
-include $(call select-android-config-h,linux-x86)
+endif
# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index 71f2d5a..d47f95f 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -60,7 +60,7 @@
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@
else
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@ && \
- $(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@
+ $(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@
endif
endif
@@ -98,9 +98,6 @@
TARGET_thumb_CFLAGS += -marm -fno-omit-frame-pointer
endif
-android_config_h := $(call select-android-config-h,linux-arm)
-arch_include_dir := $(dir $(android_config_h))
-
TARGET_GLOBAL_CFLAGS += \
-msoft-float -fpic -fPIE \
-ffunction-sections \
@@ -111,9 +108,11 @@
-Werror=format-security \
-D_FORTIFY_SOURCE=1 \
-fno-short-enums \
- $(arch_variant_cflags) \
- -include $(android_config_h) \
- -I $(arch_include_dir)
+ $(arch_variant_cflags)
+
+android_config_h := $(call select-android-config-h,linux-arm)
+TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h))
+TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS)
# This warning causes dalvik not to build with gcc 4.6.x and -Werror.
# We cannot turn it off blindly since the option is not available
@@ -147,9 +146,9 @@
# since sometimes thumb-interwork appears to be default), we
# specifically disable when thumb support is unavailable.
ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true)
-TARGET_GLOBAL_CFLAGS += -mthumb-interwork
+TARGET_GLOBAL_CFLAGS += -mthumb-interwork
else
-TARGET_GLOBAL_CFLAGS += -mno-thumb-interwork
+TARGET_GLOBAL_CFLAGS += -mno-thumb-interwork
endif
TARGET_GLOBAL_CPPFLAGS += -fvisibility-inlines-hidden
@@ -274,7 +273,7 @@
define transform-o-to-executable-inner
$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -fPIE -pie \
-Wl,-dynamic-linker,/system/bin/linker \
- -Wl,--gc-sections \
+ -Wl,--gc-sections \
-Wl,-z,nocopyreloc \
-o $@ \
$(TARGET_GLOBAL_LD_DIRS) \
@@ -297,7 +296,7 @@
define transform-o-to-static-executable-inner
$(hide) $(PRIVATE_CXX) -nostdlib -Bstatic \
- -Wl,--gc-sections \
+ -Wl,--gc-sections \
-o $@ \
$(TARGET_GLOBAL_LD_DIRS) \
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_STATIC_O)) \
diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk
index f89873e..0cf7964 100644
--- a/core/combo/TARGET_linux-mips.mk
+++ b/core/combo/TARGET_linux-mips.mk
@@ -60,7 +60,7 @@
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@
else
TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@ && \
- $(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@
+ $(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@
endif
endif
@@ -78,9 +78,6 @@
TARGET_mips_CFLAGS += -fno-omit-frame-pointer
endif
-android_config_h := $(call select-android-config-h,linux-mips)
-arch_include_dir := $(dir $(android_config_h))
-
TARGET_GLOBAL_CFLAGS += \
$(TARGET_mips_CFLAGS) \
-Ulinux -U__unix -U__unix__ -Umips \
@@ -89,9 +86,11 @@
-fdata-sections \
-funwind-tables \
-Werror=format-security \
- $(arch_variant_cflags) \
- -include $(android_config_h) \
- -I $(arch_include_dir)
+ $(arch_variant_cflags)
+
+android_config_h := $(call select-android-config-h,linux-mips)
+TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h))
+TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS)
# This warning causes dalvik not to build with gcc 4.6.x and -Werror.
# We cannot turn it off blindly since the option is not available
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index bf6daf8..396bc3a 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -93,8 +93,11 @@
-fno-short-enums \
-fstrict-aliasing \
-funswitch-loops \
- -funwind-tables \
- -include $(call select-android-config-h,target_linux-x86)
+ -funwind-tables
+
+android_config_h := $(call select-android-config-h,target_linux-x86)
+TARGET_ANDROID_CONFIG_CFLAGS := -include $(android_config_h) -I $(dir $(android_config_h))
+TARGET_GLOBAL_CFLAGS += $(TARGET_ANDROID_CONFIG_CFLAGS)
# XXX: Not sure this is still needed. Must check with our toolchains.
TARGET_GLOBAL_CPPFLAGS += \
diff --git a/core/combo/select.mk b/core/combo/select.mk
index 803cfc0..e485d00 100644
--- a/core/combo/select.mk
+++ b/core/combo/select.mk
@@ -60,6 +60,23 @@
include $(BUILD_COMBOS)/$(combo_target)$(combo_os_arch).mk
ifneq ($(USE_CCACHE),)
+ # The default check uses size and modification time, causing false misses
+ # since the mtime depends when the repo was checked out
+ export CCACHE_COMPILERCHECK := content
+
+ # See man page, optimizations to get more cache hits
+ # implies that __DATE__ and __TIME__ are not critical for functionality.
+ # Ignore include file modification time since it will depend on when
+ # the repo was checked out
+ export CCACHE_SLOPPINESS := time_macros,include_file_mtime,file_macro
+
+ # Turn all preprocessor absolute paths into relative paths.
+ # Fixes absolute paths in preprocessed source due to use of -g.
+ # We don't really use system headers much so the rootdir is
+ # fine; ensures these paths are relative for all Android trees
+ # on a workstation.
+ export CCACHE_BASEDIR := /
+
CCACHE_HOST_TAG := $(HOST_PREBUILT_TAG)
# If we are cross-compiling Windows binaries on Linux
# then use the linux ccache binary instead.
diff --git a/core/main.mk b/core/main.mk
index 64be9ff..49367ec 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -780,10 +780,6 @@
# dist_files only for putting your library into the dist directory with a full build.
.PHONY: dist_files
-ifeq ($(EMMA_INSTRUMENT),true)
- $(call dist-for-goals, dist_files, $(EMMA_META_ZIP))
-endif
-
# Dist for droid if droid is among the cmd goals, or no cmd goal is given.
ifneq ($(filter droid,$(MAKECMDGOALS))$(filter ||,|$(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))|),)
@@ -798,10 +794,15 @@
unbundled_build_modules := $(TARGET_BUILD_APPS)
endif
+ apps_only_installed_files := $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED))
# dist the unbundled app.
- $(call dist-for-goals,apps_only, \
- $(foreach m,$(unbundled_build_modules),$(ALL_MODULES.$(m).INSTALLED)) \
- )
+ $(call dist-for-goals,apps_only, $(apps_only_installed_files))
+
+ ifeq ($(EMMA_INSTRUMENT),true)
+ $(EMMA_META_ZIP) : $(apps_only_installed_files)
+
+ $(call dist-for-goals,apps_only, $(EMMA_META_ZIP))
+ endif
.PHONY: apps_only
apps_only: $(unbundled_build_modules)
@@ -830,6 +831,12 @@
)
endif
+ ifeq ($(EMMA_INSTRUMENT),true)
+ $(EMMA_META_ZIP) : $(INSTALLED_SYSTEMIMAGE)
+
+ $(call dist-for-goals, dist_files, $(EMMA_META_ZIP))
+ endif
+
# Building a full system-- the default is to build droidcore
droid: droidcore dist_files