Merge "Fix Java detection on some Linux distributions"
diff --git a/core/binary.mk b/core/binary.mk
index f620af5..efb0db0 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -166,67 +166,7 @@
my_cflags := $(filter-out $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)GLOBAL_UNSUPPORTED_CFLAGS),$(my_cflags))
-# Only around for development purposes. Will be removed soon.
-my_libcxx_is_default := false
-
-# Select the appropriate C++ STL
-ifeq ($(strip $(LOCAL_CXX_STL)),default)
- ifndef LOCAL_SDK_VERSION
- ifeq ($(strip $(my_libcxx_is_default)),true)
- # Platform code. Select the appropriate STL.
- my_cxx_stl := libc++
- else
- my_cxx_stl := bionic
- endif
- else
- my_cxx_stl := ndk
- endif
-else
- my_cxx_stl := $(strip $(LOCAL_CXX_STL))
-endif
-
-ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
- my_cflags += -D_USING_LIBCXX
- my_c_includes += external/libcxx/include
- ifeq ($(my_cxx_stl),libc++)
- my_shared_libraries += libc++
- else
- my_static_libraries += libc++_static
- endif
-
- ifdef LOCAL_IS_HOST_MODULE
- my_cppflags += -nostdinc++
- my_ldflags += -nodefaultlibs
- my_ldlibs += -lc -lm
- endif
-else ifneq ($(filter $(my_cxx_stl),stlport stlport_static),)
- my_c_includes += external/stlport/stlport bionic/libstdc++/include bionic
- ifeq ($(my_cxx_stl),stlport)
- my_shared_libraries += libstdc++ libstlport
- else
- my_static_libraries += libstdc++ libstlport_static
- endif
-else ifeq ($(my_cxx_stl),ndk)
- # Using an NDK STL. Handled farther up in this file.
- ifndef LOCAL_IS_HOST_MODULE
- my_system_shared_libraries += libstdc++
- endif
-else ifeq ($(my_cxx_stl),bionic)
- # Using bionic's basic libstdc++. Not actually an STL. Only around until the
- # tree is in good enough shape to not need it.
- ifndef LOCAL_IS_HOST_MODULE
- my_c_includes += bionic/libstdc++/include
- my_system_shared_libraries += libstdc++
- endif
- # Host builds will use GNU libstdc++.
-else ifeq ($(my_cxx_stl),none)
- ifdef LOCAL_IS_HOST_MODULE
- my_cppflags += -nostdinc++
- my_ldflags += -nodefaultlibs -lc -lm
- endif
-else
- $(error $(my_cxx_stl) is not a supported STL.)
-endif
+include $(BUILD_SYSTEM)/cxx_stl_setup.mk
# Add static HAL libraries
ifdef LOCAL_HAL_STATIC_LIBRARIES
@@ -254,8 +194,6 @@
my_static_libraries += $(COMPILER_RT_CONFIG_EXTRA_STATIC_LIBRARIES)
endif
-my_compiler_dependencies :=
-
####################################################
## Add FDO flags if FDO is turned on and supported
####################################################
@@ -321,8 +259,10 @@
my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LDFLAGS)
endif # my_clang
-# If the global flag NATIVE_COVERAGE is set, my_native_coverage will be true
-# unless the module explicitly sets my_native_coverage := false.
+# To enable coverage for a given module, set LOCAL_NATIVE_COVERAGE=true and
+# build with NATIVE_COVERAGE=true in your enviornment. Note that the build
+# system is not sensitive to changes to NATIVE_COVERAGE, so you should do a
+# clean build of your module after toggling it.
ifeq ($(NATIVE_COVERAGE),true)
ifeq ($(my_native_coverage),true)
# We can't currently generate coverage for clang binaries for two
@@ -338,8 +278,8 @@
# -no-integrated-as. Since most of the assembly in our tree is
# incompatible with clang's assembler, we can't turn off this flag.
ifneq ($(my_clang),true)
- my_target_global_cflags += --coverage
- my_target_global_ldflags += --coverage
+ my_cflags += --coverage -O0
+ my_ldflags += --coverage
endif
endif
else
@@ -704,8 +644,7 @@
$(cpp_objects): $(intermediates)/%.o: \
$(TOPDIR)$(LOCAL_PATH)/%$(LOCAL_CPP_EXTENSION) \
$(yacc_cpps) $(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
- | $(my_compiler_dependencies)
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-$(PRIVATE_HOST)cpp-to-o)
-include $(cpp_objects:%.o=%.P)
endif
@@ -725,8 +664,7 @@
$(gen_cpp_objects): $(intermediates)/%.o: \
$(intermediates)/%$(LOCAL_CPP_EXTENSION) $(yacc_cpps) \
$(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
- | $(my_compiler_dependencies)
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-$(PRIVATE_HOST)cpp-to-o)
-include $(gen_cpp_objects:%.o=%.P)
endif
@@ -740,8 +678,7 @@
ifneq ($(strip $(gen_S_sources)),)
$(gen_S_objects): $(intermediates)/%.o: $(intermediates)/%.S \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
- | $(my_compiler_dependencies)
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-$(PRIVATE_HOST)s-to-o)
-include $(gen_S_objects:%.o=%.P)
endif
@@ -751,8 +688,7 @@
ifneq ($(strip $(gen_s_objects)),)
$(gen_s_objects): $(intermediates)/%.o: $(intermediates)/%.s \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
- | $(my_compiler_dependencies)
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-$(PRIVATE_HOST)s-to-o-no-deps)
-include $(gen_s_objects:%.o=%.P)
endif
@@ -784,8 +720,7 @@
ifneq ($(strip $(c_objects)),)
$(c_objects): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.c $(yacc_cpps) $(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
- | $(my_compiler_dependencies)
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-$(PRIVATE_HOST)c-to-o)
-include $(c_objects:%.o=%.P)
endif
@@ -803,8 +738,7 @@
$(gen_c_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
$(gen_c_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
$(gen_c_objects): $(intermediates)/%.o: $(intermediates)/%.c $(yacc_cpps) $(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
- | $(my_compiler_dependencies)
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-$(PRIVATE_HOST)c-to-o)
-include $(gen_c_objects:%.o=%.P)
endif
@@ -818,8 +752,7 @@
ifneq ($(strip $(objc_objects)),)
$(objc_objects): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.m $(yacc_cpps) $(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
- | $(my_compiler_dependencies)
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-$(PRIVATE_HOST)m-to-o)
-include $(objc_objects:%.o=%.P)
endif
@@ -833,8 +766,7 @@
ifneq ($(strip $(asm_objects_S)),)
$(asm_objects_S): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.S \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
- | $(my_compiler_dependencies)
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-$(PRIVATE_HOST)s-to-o)
-include $(asm_objects_S:%.o=%.P)
endif
@@ -844,8 +776,7 @@
ifneq ($(strip $(asm_objects_s)),)
$(asm_objects_s): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.s \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
- | $(my_compiler_dependencies)
+ $(LOCAL_ADDITIONAL_DEPENDENCIES)
$(transform-$(PRIVATE_HOST)s-to-o-no-deps)
-include $(asm_objects_s:%.o=%.P)
endif
diff --git a/core/clang/TARGET_mips.mk b/core/clang/TARGET_mips.mk
index 91067f5..b7e40e3 100644
--- a/core/clang/TARGET_mips.mk
+++ b/core/clang/TARGET_mips.mk
@@ -9,6 +9,7 @@
$(CLANG_CONFIG_EXTRA_ASFLAGS) \
$(CLANG_CONFIG_TARGET_EXTRA_ASFLAGS) \
$(CLANG_CONFIG_mips_EXTRA_ASFLAGS) \
+ -fPIC \
-target $(CLANG_CONFIG_mips_TARGET_TRIPLE) \
-B$(CLANG_CONFIG_mips_TARGET_TOOLCHAIN_PREFIX)
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 64aabda..02b189f 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -124,6 +124,7 @@
LOCAL_RENDERSCRIPT_TARGET_API:=
LOCAL_DEX_PREOPT:= # '',true,false,nostripping
LOCAL_DEX_PREOPT_IMAGE_LOCATION:=
+LOCAL_DEX_PREOPT_FLAGS:=
LOCAL_PROTOC_OPTIMIZE_TYPE:= # lite(default),micro,nano,full
LOCAL_PROTOC_FLAGS:=
LOCAL_PROTO_JAVA_OUTPUT_PARAMS:=
diff --git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk
index 78a9f8e..09cf271 100644
--- a/core/combo/HOST_linux-x86.mk
+++ b/core/combo/HOST_linux-x86.mk
@@ -28,7 +28,7 @@
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/
# We expect SSE3 floating point math.
-$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 -Wa,--noexecstack -march=prescott
+$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -msse3 -mfpmath=sse -m32 -Wa,--noexecstack -march=prescott
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32 -Wl,-z,noexecstack
ifneq ($(strip $(BUILD_HOST_static)),)
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index 2d7faae..d159d94 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -259,13 +259,14 @@
-Wl,--whole-archive \
$(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
-Wl,--no-whole-archive \
- $(call normalize-target-libraries,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES)))) \
+ $(call normalize-target-libraries,$(filter-out %libcompiler_rt.a,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))))) \
-Wl,--start-group \
$(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \
+ $(call normalize-target-libraries,$(filter %libcompiler_rt.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk
index f0fab7b..9bd0b90 100644
--- a/core/combo/TARGET_linux-arm64.mk
+++ b/core/combo/TARGET_linux-arm64.mk
@@ -225,13 +225,14 @@
-Wl,--whole-archive \
$(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
-Wl,--no-whole-archive \
- $(call normalize-target-libraries,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES)))) \
+ $(call normalize-target-libraries,$(filter-out %libcompiler_rt.a,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))))) \
-Wl,--start-group \
$(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \
+ $(call normalize-target-libraries,$(filter %libcompiler_rt.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk
index b260073..427fa66 100644
--- a/core/combo/TARGET_linux-mips.mk
+++ b/core/combo/TARGET_linux-mips.mk
@@ -231,13 +231,14 @@
-Wl,--whole-archive \
$(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
-Wl,--no-whole-archive \
- $(call normalize-target-libraries,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES)))) \
+ $(call normalize-target-libraries,$(filter-out %libcompiler_rt.a,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))))) \
-Wl,--start-group \
$(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \
+ $(call normalize-target-libraries,$(filter %libcompiler_rt.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk
index ef66a73..db72d0f 100644
--- a/core/combo/TARGET_linux-mips64.mk
+++ b/core/combo/TARGET_linux-mips64.mk
@@ -235,13 +235,14 @@
-Wl,--whole-archive \
$(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
-Wl,--no-whole-archive \
- $(call normalize-target-libraries,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES)))) \
+ $(call normalize-target-libraries,$(filter-out %libcompiler_rt.a,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))))) \
-Wl,--start-group \
$(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \
+ $(call normalize-target-libraries,$(filter %libcompiler_rt.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index ef37de0..063f525 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -212,10 +212,13 @@
$(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
-Wl,--no-whole-archive \
-Wl,--start-group \
- $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ $(call normalize-target-libraries,$(filter-out %libcompiler_rt.a,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))))) \
$(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
+ $(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
+ $(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \
+ $(call normalize-target-libraries,$(filter %libcompiler_rt.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk
index c7a53a6..a6fa795 100644
--- a/core/combo/TARGET_linux-x86_64.mk
+++ b/core/combo/TARGET_linux-x86_64.mk
@@ -213,13 +213,15 @@
$(PRIVATE_LDFLAGS) \
$(PRIVATE_ALL_OBJECTS) \
-Wl,--whole-archive \
- $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
+ $(call normalize-target-libraries,$(filter-out %libcompiler_rt.a,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))))) \
-Wl,--no-whole-archive \
-Wl,--start-group \
- $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+ $(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
+ $(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBATOMIC) \
$(if $(filter true,$(NATIVE_COVERAGE)),$(PRIVATE_TARGET_LIBGCOV)) \
+ $(call normalize-target-libraries,$(filter %libcompiler_rt.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
$(if $(PRIVATE_LIBCXX),,$(PRIVATE_TARGET_LIBGCC)) \
-Wl,--end-group \
$(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \
diff --git a/core/combo/arch/arm/armv7-a-neon.mk b/core/combo/arch/arm/armv7-a-neon.mk
index c6603db..3f4c391 100644
--- a/core/combo/arch/arm/armv7-a-neon.mk
+++ b/core/combo/arch/arm/armv7-a-neon.mk
@@ -7,7 +7,14 @@
ARCH_ARM_HAVE_NEON := true
ifneq (,$(filter cortex-a15 krait denver,$(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)))
+ # TODO: krait is not a cortex-a15, we set the variant to cortex-a15 so that
+ # hardware divide operations are generated. This should be removed and a
+ # krait CPU variant added to GCC/clang.
arch_variant_cflags := -mcpu=cortex-a15
+
+ # Fake an ARM compiler flag as these processors support LPAE which GCC/clang
+ # don't advertise.
+ arch_variant_cflags += -D__ARM_FEATURE_LPAE=1
else
ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)CPU_VARIANT)),cortex-a8)
arch_variant_cflags := -mcpu=cortex-a8
diff --git a/core/combo/arch/x86/haswell.mk b/core/combo/arch/x86/haswell.mk
index 0b16b80..b3922c0 100644
--- a/core/combo/arch/x86/haswell.mk
+++ b/core/combo/arch/x86/haswell.mk
@@ -13,6 +13,5 @@
# CFLAGS for this arch
arch_variant_cflags := \
-march=core-avx2 \
- -mstackrealign \
-mfpmath=sse \
diff --git a/core/combo/arch/x86/ivybridge.mk b/core/combo/arch/x86/ivybridge.mk
index a8e66f3..c9fc33b 100644
--- a/core/combo/arch/x86/ivybridge.mk
+++ b/core/combo/arch/x86/ivybridge.mk
@@ -13,6 +13,5 @@
# CFLAGS for this arch
arch_variant_cflags := \
-march=core-avx-i \
- -mstackrealign \
-mfpmath=sse \
diff --git a/core/combo/arch/x86/sandybridge.mk b/core/combo/arch/x86/sandybridge.mk
index 8e474a5..bca5953 100644
--- a/core/combo/arch/x86/sandybridge.mk
+++ b/core/combo/arch/x86/sandybridge.mk
@@ -13,6 +13,5 @@
# CFLAGS for this arch
arch_variant_cflags := \
-march=corei7-avx \
- -mstackrealign \
-mfpmath=sse \
diff --git a/core/combo/arch/x86/silvermont.mk b/core/combo/arch/x86/silvermont.mk
index 3a8718d..d064b1d 100644
--- a/core/combo/arch/x86/silvermont.mk
+++ b/core/combo/arch/x86/silvermont.mk
@@ -15,6 +15,5 @@
# CFLAGS for this arch
arch_variant_cflags := \
-march=slm \
- -mstackrealign \
-mfpmath=sse \
diff --git a/core/combo/arch/x86/x86-atom.mk b/core/combo/arch/x86/x86-atom.mk
index 508a0af..3800350 100644
--- a/core/combo/arch/x86/x86-atom.mk
+++ b/core/combo/arch/x86/x86-atom.mk
@@ -11,6 +11,5 @@
# CFLAGS for this arch
arch_variant_cflags := \
-march=atom \
- -mstackrealign \
-mfpmath=sse \
diff --git a/core/combo/include/arch/darwin-x86/AndroidConfig.h b/core/combo/include/arch/darwin-x86/AndroidConfig.h
index eeda5d0..eb5609c 100644
--- a/core/combo/include/arch/darwin-x86/AndroidConfig.h
+++ b/core/combo/include/arch/darwin-x86/AndroidConfig.h
@@ -84,21 +84,6 @@
#define HAVE_LOCALTIME_R 1
/*
- * Define this if we have gethostbyname_r().
- */
-/* #define HAVE_GETHOSTBYNAME_R */
-
-/*
- * Define this if we want to use WinSock.
- */
-/* #define HAVE_WINSOCK */
-
-/*
- * Define this if have clock_gettime() and friends
- */
-/* #define HAVE_POSIX_CLOCKS */
-
-/*
* Endianness of the target machine. Choose one:
*
* HAVE_ENDIAN_H -- have endian.h header we can include.
@@ -232,14 +217,4 @@
*/
#define HAVE_PRINTF_ZD 1
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype.
- */
-#define HAVE_BSD_QSORT_R 1
-
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype.
- */
-#define HAVE_GNU_QSORT_R 0
-
#endif /*_ANDROID_CONFIG_H*/
diff --git a/core/combo/include/arch/linux-arm/AndroidConfig.h b/core/combo/include/arch/linux-arm/AndroidConfig.h
index 1ca244c..4a9ec62 100644
--- a/core/combo/include/arch/linux-arm/AndroidConfig.h
+++ b/core/combo/include/arch/linux-arm/AndroidConfig.h
@@ -79,21 +79,6 @@
#define HAVE_SYMLINKS
/*
- * Define this if we have localtime_r().
- */
-/* #define HAVE_LOCALTIME_R 1 */
-
-/*
- * Define this if we have gethostbyname_r().
- */
-/* #define HAVE_GETHOSTBYNAME_R */
-
-/*
- * Define this if we want to use WinSock.
- */
-/* #define HAVE_WINSOCK */
-
-/*
* Define this if have clock_gettime() and friends
*/
#define HAVE_POSIX_CLOCKS
@@ -109,14 +94,6 @@
#define HAVE_LITTLE_ENDIAN
/*
- * We need to choose between 32-bit and 64-bit off_t. All of our code should
- * agree on the same size. For desktop systems, use 64-bit values,
- * because some of our libraries (e.g. wxWidgets) expect to be built that way.
- */
-/* #define _FILE_OFFSET_BITS 64 */
-/* #define _LARGEFILE_SOURCE 1 */
-
-/*
* Defined if we have the backtrace() call for retrieving a stack trace.
* Needed for CallStack to operate; if not defined, CallStack is
* non-functional.
@@ -176,22 +153,11 @@
#define HAVE_LIBC_SYSTEM_PROPERTIES 1
/*
- * Define if system provides a system property server (should be
- * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
- */
-/* #define HAVE_SYSTEM_PROPERTY_SERVER */
-
-/*
* What CPU architecture does this platform use?
*/
#define ARCH_ARM
/*
- * Define if the size of enums is as short as possible,
- */
-/* #define HAVE_SHORT_ENUMS */
-
-/*
* sprintf() format string for shared library naming.
*/
#define OS_SHARED_LIB_FORMAT_STR "lib%s.so"
@@ -261,14 +227,4 @@
*/
#define HAVE_PRINTF_ZD 1
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype.
- */
-#define HAVE_BSD_QSORT_R 0
-
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype.
- */
-#define HAVE_GNU_QSORT_R 0
-
#endif /* _ANDROID_CONFIG_H */
diff --git a/core/combo/include/arch/linux-arm64/AndroidConfig.h b/core/combo/include/arch/linux-arm64/AndroidConfig.h
index 8cf6c79..c3ad5da 100644
--- a/core/combo/include/arch/linux-arm64/AndroidConfig.h
+++ b/core/combo/include/arch/linux-arm64/AndroidConfig.h
@@ -63,11 +63,6 @@
#define HAVE_TERMIO_H 1
/*
- * Define this if you build against MSVCRT.DLL
- */
-/* #define HAVE_MS_C_RUNTIME */
-
-/*
* Define this if you have sys/uio.h
*/
#define HAVE_SYS_UIO_H 1
@@ -79,21 +74,6 @@
#define HAVE_SYMLINKS
/*
- * Define this if we have localtime_r().
- */
-/* #define HAVE_LOCALTIME_R 1 */
-
-/*
- * Define this if we have gethostbyname_r().
- */
-/* #define HAVE_GETHOSTBYNAME_R */
-
-/*
- * Define this if we want to use WinSock.
- */
-/* #define HAVE_WINSOCK */
-
-/*
* Define this if have clock_gettime() and friends
*/
#define HAVE_POSIX_CLOCKS
@@ -171,22 +151,11 @@
#define HAVE_LIBC_SYSTEM_PROPERTIES 1
/*
- * Define if system provides a system property server (should be
- * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
- */
-/* #define HAVE_SYSTEM_PROPERTY_SERVER */
-
-/*
* What CPU architecture does this platform use?
*/
#define ARCH_AARCH64
/*
- * Define if the size of enums is as short as possible,
- */
-/* #define HAVE_SHORT_ENUMS */
-
-/*
* sprintf() format string for shared library naming.
*/
#define OS_SHARED_LIB_FORMAT_STR "lib%s.so"
@@ -256,14 +225,4 @@
*/
#define HAVE_PRINTF_ZD 1
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype.
- */
-#define HAVE_BSD_QSORT_R 0
-
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype.
- */
-#define HAVE_GNU_QSORT_R 0
-
#endif /* _ANDROID_CONFIG_H */
diff --git a/core/combo/include/arch/linux-x86/AndroidConfig.h b/core/combo/include/arch/linux-x86/AndroidConfig.h
index 1f2d9ab..e3bffec 100644
--- a/core/combo/include/arch/linux-x86/AndroidConfig.h
+++ b/core/combo/include/arch/linux-x86/AndroidConfig.h
@@ -63,11 +63,6 @@
#define HAVE_TERMIO_H 1
/*
- * Define this if you build against MSVCRT.DLL
- */
-/* #define HAVE_MS_C_RUNTIME */
-
-/*
* Define this if you have sys/uio.h
*/
#define HAVE_SYS_UIO_H 1
@@ -89,11 +84,6 @@
#define HAVE_GETHOSTBYNAME_R
/*
- * Define this if we want to use WinSock.
- */
-/* #define HAVE_WINSOCK */
-
-/*
* Define this if have clock_gettime() and friends
*/
#define HAVE_POSIX_CLOCKS
@@ -129,29 +119,15 @@
#define HAVE_SCHED_SETSCHEDULER
/*
- * Add any extra platform-specific defines here.
- */
-
-/*
* Define if we have <malloc.h> header
*/
#define HAVE_MALLOC_H
/*
- * Define if we have Linux-style non-filesystem Unix Domain Sockets
- */
-
-/*
* What CPU architecture does this platform use?
*/
#define ARCH_X86
-
-/*
- * Define if we have Linux's inotify in <sys/inotify.h>.
- */
-/*#define HAVE_INOTIFY 1*/
-
/*
* Define if we have madvise() in <sys/mman.h>
*/
@@ -168,11 +144,6 @@
#define HAVE_DIRENT_D_TYPE 1
/*
- * Define if libc includes Android system properties implementation.
- */
-/* #define HAVE_LIBC_SYSTEM_PROPERTIES */
-
-/*
* Define if system provides a system property server (should be
* mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
*/
@@ -199,16 +170,6 @@
#define HAVE_SYS_SOCKET_H 1
/*
- * Define if the strlcpy() function exists on the system.
- */
-/* #define HAVE_STRLCPY 1 */
-
-/*
- * Define if the BSD funopen() function exists on the system.
- */
-/* #define HAVE_FUNOPEN 1 */
-
-/*
* Define if prctl() exists
*/
#define HAVE_PRCTL 1
@@ -248,18 +209,4 @@
*/
#define HAVE_PRINTF_ZD 1
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype.
- */
-#define HAVE_BSD_QSORT_R 0
-
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype.
- */
-#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8))
-#define HAVE_GNU_QSORT_R 1
-#else
-#define HAVE_GNU_QSORT_R 0
-#endif
-
#endif /*_ANDROID_CONFIG_H*/
diff --git a/core/combo/include/arch/target_linux-x86/AndroidConfig.h b/core/combo/include/arch/target_linux-x86/AndroidConfig.h
index 260f518..216bb9ed 100644
--- a/core/combo/include/arch/target_linux-x86/AndroidConfig.h
+++ b/core/combo/include/arch/target_linux-x86/AndroidConfig.h
@@ -49,11 +49,6 @@
#define HAVE_TERMIO_H 1
/*
- * Define this if you build against have Microsoft C runtime (MSVCRT.DLL)
- */
-/* #define HAVE_MS_C_RUNTIME */
-
-/*
* Define this if you have sys/uio.h
*/
#define HAVE_SYS_UIO_H 1
@@ -65,21 +60,6 @@
#define HAVE_SYMLINKS 1
/*
- * Define this if we have localtime_r().
- */
-/* #define HAVE_LOCALTIME_R 1 */
-
-/*
- * Define this if we have gethostbyname_r().
- */
-/* #define HAVE_GETHOSTBYNAME_R */
-
-/*
- * Define this if we want to use WinSock.
- */
-/* #define HAVE_WINSOCK */
-
-/*
* Define this if have clock_gettime() and friends
*
*/
@@ -112,7 +92,7 @@
*/
#define HAVE_BACKTRACE 0
-/*
+/*
* Defined if we have the sched_setscheduler() call
*/
#define HAVE_SCHED_SETSCHEDULER
@@ -150,11 +130,6 @@
#define HAVE_MADVISE 1
/*
- * Define if we have Linux's dbus
- */
-/* #define HAVE_DBUS 1 */
-
-/*
* Define if tm struct has tm_gmtoff field
*/
#define HAVE_TM_GMTOFF 1
@@ -170,12 +145,6 @@
#define HAVE_LIBC_SYSTEM_PROPERTIES 1
/*
- * Define if system provides a system property server (should be
- * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
- */
-/* #define HAVE_SYSTEM_PROPERTY_SERVER */
-
-/*
* What CPU architecture does this platform use?
*/
#define ARCH_X86
@@ -250,14 +219,4 @@
*/
#define HAVE_PRINTF_ZD 1
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype.
- */
-#define HAVE_BSD_QSORT_R 0
-
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype.
- */
-#define HAVE_GNU_QSORT_R 0
-
#endif /* _ANDROID_CONFIG_H */
diff --git a/core/combo/include/arch/windows/AndroidConfig.h b/core/combo/include/arch/windows/AndroidConfig.h
index c80c201..786f95e 100644
--- a/core/combo/include/arch/windows/AndroidConfig.h
+++ b/core/combo/include/arch/windows/AndroidConfig.h
@@ -111,17 +111,6 @@
#define HAVE_SYS_UIO_H
#endif
-
-/*
- * Define this if we have localtime_r().
- */
-/* #define HAVE_LOCALTIME_R 1 */
-
-/*
- * Define this if we have gethostbyname_r().
- */
-/* #define HAVE_GETHOSTBYNAME_R */
-
/*
* Define this if we want to use WinSock.
*/
@@ -130,17 +119,6 @@
#endif
/*
- * Define this if your platforms implements symbolic links
- * in its filesystems
- */
-/* #define HAVE_SYMLINKS */
-
-/*
- * Define this if have clock_gettime() and friends
- */
-/* #define HAVE_POSIX_CLOCKS */
-
-/*
* Endianness of the target machine. Choose one:
*
* HAVE_ENDIAN_H -- have endian.h header we can include.
@@ -169,32 +147,6 @@
#define HAVE_BACKTRACE 0
/*
- * Define if tm struct has tm_gmtoff field
- */
-/* #define HAVE_TM_GMTOFF 1 */
-
-/*
- * Define if dirent struct has d_type field
- */
-/* #define HAVE_DIRENT_D_TYPE 1 */
-
-/*
- * Define if libc includes Android system properties implementation.
- */
-/* #define HAVE_LIBC_SYSTEM_PROPERTIES */
-
-/*
- * Define if system provides a system property server (should be
- * mutually exclusive with HAVE_LIBC_SYSTEM_PROPERTIES).
- */
-/* #define HAVE_SYSTEM_PROPERTY_SERVER */
-
-/*
- * Define if we have madvise() in <sys/mman.h>
- */
-/*#define HAVE_MADVISE 1*/
-
-/*
* Add any extra platform-specific defines here.
*/
#define WIN32 1 /* stock Cygwin doesn't define these */
@@ -219,11 +171,6 @@
#define OS_PATH_SEPARATOR '\\'
/*
- * Is the filesystem case sensitive?
- */
-/* #define OS_CASE_SENSITIVE */
-
-/*
* Define if <sys/socket.h> exists.
* Cygwin has it, but not MinGW.
*/
@@ -234,16 +181,6 @@
#endif
/*
- * Define if the strlcpy() function exists on the system.
- */
-/* #define HAVE_STRLCPY 1 */
-
-/*
- * Define if the BSD funopen() function exists on the system.
- */
-/* #define HAVE_FUNOPEN 1 */
-
-/*
* Define if <winsock2.h> exists.
* Only MinGW has it.
*/
@@ -261,48 +198,8 @@
#endif
/*
- * Define if writev() exists.
- */
-/* #define HAVE_WRITEV */
-
-/*
- * Define if <stdint.h> exists.
- */
-/* #define HAVE_STDINT_H */
-
-/*
* Define if <stdbool.h> exists.
*/
#define HAVE_STDBOOL_H
-/*
- * Define if <sched.h> exists.
- */
-/* #define HAVE_SCHED_H */
-
-/*
- * Define if pread() exists
- */
-/* #define HAVE_PREAD 1 */
-
-/*
- * Define if we have st_mtim in struct stat
- */
-/* #define HAVE_STAT_ST_MTIM 1 */
-
-/*
- * Define if printf() supports %zd for size_t arguments
- */
-/* #define HAVE_PRINTF_ZD 1 */
-
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a BSD style function prototype.
- */
-#define HAVE_BSD_QSORT_R 0
-
-/*
- * Define to 1 if <stdlib.h> provides qsort_r() with a GNU style function prototype.
- */
-#define HAVE_GNU_QSORT_R 0
-
#endif /*_ANDROID_CONFIG_H*/
diff --git a/core/combo/select.mk b/core/combo/select.mk
index d495c6f..00c1558 100644
--- a/core/combo/select.mk
+++ b/core/combo/select.mk
@@ -106,6 +106,11 @@
endif
endif
+# Stash the original values of CC and CXX so we can still use the non-wrapped
+# values later.
+$(combo_2nd_arch_prefix)CC_BARE := $($(combo_var_prefix)CC)
+$(combo_2nd_arch_prefix)CXX_BARE := $($(combo_var_prefix)CXX)
+
# The C/C++ compiler can be wrapped by setting the CC/CXX_WRAPPER vars.
ifdef CC_WRAPPER
ifneq ($(CC_WRAPPER),$(firstword $($(combo_var_prefix)CC)))
diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk
new file mode 100644
index 0000000..02a41e5
--- /dev/null
+++ b/core/cxx_stl_setup.mk
@@ -0,0 +1,70 @@
+#############################################################
+## Set up flags based on LOCAL_CXX_STL.
+## Input variables: LOCAL_CXX_STL
+## Output variables: My_cflags, my_c_includes, my_shared_libraries, etc.
+#############################################################
+
+# Only around for development purposes. Will be removed soon.
+my_libcxx_is_default := false
+
+# Select the appropriate C++ STL
+ifeq ($(strip $(LOCAL_CXX_STL)),default)
+ ifndef LOCAL_SDK_VERSION
+ ifeq ($(strip $(my_libcxx_is_default)),true)
+ # Platform code. Select the appropriate STL.
+ my_cxx_stl := libc++
+ else
+ my_cxx_stl := bionic
+ endif
+ else
+ my_cxx_stl := ndk
+ endif
+else
+ my_cxx_stl := $(strip $(LOCAL_CXX_STL))
+endif
+
+ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
+ my_cflags += -D_USING_LIBCXX
+ my_c_includes += external/libcxx/include
+ ifeq ($(my_cxx_stl),libc++)
+ my_shared_libraries += libc++
+ else
+ my_static_libraries += libc++_static
+ endif
+
+ ifdef LOCAL_IS_HOST_MODULE
+ my_cppflags += -nostdinc++
+ my_ldflags += -nodefaultlibs
+ my_ldlibs += -lc -lm
+ endif
+else ifneq ($(filter $(my_cxx_stl),stlport stlport_static),)
+ ifndef LOCAL_IS_HOST_MODULE
+ my_c_includes += external/stlport/stlport bionic/libstdc++/include \
+ bionic
+ ifeq ($(my_cxx_stl),stlport)
+ my_shared_libraries += libstdc++ libstlport
+ else
+ my_static_libraries += libstdc++ libstlport_static
+ endif
+ endif
+else ifeq ($(my_cxx_stl),ndk)
+ # Using an NDK STL. Handled farther up in this file.
+ ifndef LOCAL_IS_HOST_MODULE
+ my_system_shared_libraries += libstdc++
+ endif
+else ifeq ($(my_cxx_stl),bionic)
+ # Using bionic's basic libstdc++. Not actually an STL. Only around until the
+ # tree is in good enough shape to not need it.
+ ifndef LOCAL_IS_HOST_MODULE
+ my_c_includes += bionic/libstdc++/include
+ my_system_shared_libraries += libstdc++
+ endif
+ # Host builds will use GNU libstdc++.
+else ifeq ($(my_cxx_stl),none)
+ ifdef LOCAL_IS_HOST_MODULE
+ my_cppflags += -nostdinc++
+ my_ldflags += -nodefaultlibs -lc -lm
+ endif
+else
+ $(error $(my_cxx_stl) is not a supported STL.)
+endif
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 76fc130..02e812d 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -67,7 +67,7 @@
$(call dex2oat-one-file,$(1),$(2))
endef
-DEXPREOPT_ONE_FILE_DEPENDENCY_TOOLS := $(DEX2OATD_DEPENDENCY)
+DEXPREOPT_ONE_FILE_DEPENDENCY_TOOLS := $(DEX2OAT_DEPENDENCY)
DEXPREOPT_ONE_FILE_DEPENDENCY_BUILT_BOOT_PREOPT := $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME)
ifdef TARGET_2ND_ARCH
$(TARGET_2ND_ARCH_VAR_PREFIX)DEXPREOPT_ONE_FILE_DEPENDENCY_BUILT_BOOT_PREOPT := $($(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME)
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index 5af2be2..b61b180 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -18,6 +18,13 @@
PRELOADED_CLASSES := frameworks/base/preloaded-classes
+# Default to debug version to help find bugs.
+# Set USE_DEX2OAT_DEBUG to false for only building non-debug versions.
+ifneq ($(USE_DEX2OAT_DEBUG), false)
+DEX2OAT = $(DEX2OATD)
+DEX2OAT_DEPENDENCY = $(DEX2OATD_DEPENDENCY)
+endif
+
# start of image reserved address space
LIBART_IMG_HOST_BASE_ADDRESS := 0x60000000
LIBART_IMG_TARGET_BASE_ADDRESS := 0x70000000
@@ -82,7 +89,7 @@
define dex2oat-one-file
$(hide) rm -f $(2)
$(hide) mkdir -p $(dir $(2))
-$(hide) $(DEX2OATD) \
+$(hide) $(DEX2OAT) \
--runtime-arg -Xms$(DEX2OAT_XMS) --runtime-arg -Xmx$(DEX2OAT_XMX) \
--boot-image=$(PRIVATE_DEX_PREOPT_IMAGE_LOCATION) \
--dex-file=$(1) \
@@ -91,5 +98,6 @@
--android-root=$(PRODUCT_OUT)/system \
--instruction-set=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) \
--instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \
- --include-patch-information --runtime-arg -Xnorelocate --no-include-debug-symbols
+ --include-patch-information --runtime-arg -Xnorelocate --no-include-debug-symbols \
+ $(PRIVATE_DEX_PREOPT_FLAGS)
endef
diff --git a/core/dex_preopt_libart_boot.mk b/core/dex_preopt_libart_boot.mk
index fe4c5a4..90a3b5a 100644
--- a/core/dex_preopt_libart_boot.mk
+++ b/core/dex_preopt_libart_boot.mk
@@ -39,11 +39,11 @@
$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_2ND_ARCH_VAR_PREFIX := $(my_2nd_arch_prefix)
# Use dex2oat debug version for better error reporting
-$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(DEX2OATD_DEPENDENCY)
+$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(DEX2OAT_DEPENDENCY)
@echo "target dex2oat: $@ ($?)"
@mkdir -p $(dir $@)
@mkdir -p $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))
- $(hide) $(DEX2OATD) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \
+ $(hide) $(DEX2OAT) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \
--image-classes=$(PRELOADED_CLASSES) \
$(addprefix --dex-file=,$(LIBART_TARGET_BOOT_DEX_FILES)) \
$(addprefix --dex-location=,$(LIBART_TARGET_BOOT_DEX_LOCATIONS)) \
@@ -53,4 +53,5 @@
--image=$@ --base=$(LIBART_IMG_TARGET_BASE_ADDRESS) \
--instruction-set=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) \
--instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \
- --android-root=$(PRODUCT_OUT)/system --include-patch-information --runtime-arg -Xnorelocate --no-include-debug-symbols
+ --android-root=$(PRODUCT_OUT)/system --include-patch-information --runtime-arg -Xnorelocate --no-include-debug-symbols \
+ $(PRODUCT_DEX_PREOPT_BOOT_FLAGS)
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 28282ec..d4484ca 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -11,7 +11,12 @@
ifndef LOCAL_DEX_PREOPT # LOCAL_DEX_PREOPT undefined
ifneq ($(filter $(TARGET_OUT)/%,$(my_module_path)),) # Installed to system.img.
ifeq (,$(LOCAL_APK_LIBRARIES)) # LOCAL_APK_LIBRARIES empty
- LOCAL_DEX_PREOPT := $(DEX_PREOPT_DEFAULT)
+ # If we have product-specific config for this module?
+ ifeq (disable,$(DEXPREOPT.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG))
+ LOCAL_DEX_PREOPT := false
+ else
+ LOCAL_DEX_PREOPT := $(DEX_PREOPT_DEFAULT)
+ endif
else # LOCAL_APK_LIBRARIES not empty
LOCAL_DEX_PREOPT := nostripping
endif # LOCAL_APK_LIBRARIES not empty
@@ -94,6 +99,14 @@
endif # boot jar
ifdef built_odex
+ifndef LOCAL_DEX_PREOPT_FLAGS
+LOCAL_DEX_PREOPT_FLAGS := $(DEXPREOPT.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG)
+ifndef LOCAL_DEX_PREOPT_FLAGS
+LOCAL_DEX_PREOPT_FLAGS := $(PRODUCT_DEX_PREOPT_DEFAULT_FLAGS)
+endif
+endif
+$(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS)
+
# Use pattern rule - we may have multiple installed odex files.
# Ugly syntax - See the definition get-odex-file-path.
$(installed_odex) : $(dir $(LOCAL_INSTALLED_MODULE))%$(notdir $(word 1,$(installed_odex))) \
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index b5e5189..d852541 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -91,16 +91,19 @@
# of the shared libraries are determined.
ifdef LOCAL_INSTALLED_MODULE
ifdef LOCAL_SHARED_LIBRARIES
+my_shared_libraries := $(LOCAL_SHARED_LIBRARIES)
+# Extra shared libraries introduced by LOCAL_CXX_STL.
+include $(BUILD_SYSTEM)/cxx_stl_setup.mk
$(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)DEPENDENCIES_ON_SHARED_LIBRARIES += \
- $(my_register_name):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(LOCAL_SHARED_LIBRARIES))
+ $(my_register_name):$(LOCAL_INSTALLED_MODULE):$(subst $(space),$(comma),$(my_shared_libraries))
# We also need the LOCAL_BUILT_MODULE dependency,
# since we use -rpath-link which points to the built module's path.
-built_shared_libraries := \
+my_built_shared_libraries := \
$(addprefix $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \
$(addsuffix $($(my_prefix)SHLIB_SUFFIX), \
- $(LOCAL_SHARED_LIBRARIES)))
-$(LOCAL_BUILT_MODULE) : $(built_shared_libraries)
+ $(my_shared_libraries)))
+$(LOCAL_BUILT_MODULE) : $(my_built_shared_libraries)
endif
endif
diff --git a/core/product.mk b/core/product.mk
index dbf49b5..7146b33 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -99,6 +99,10 @@
PRODUCT_RUNTIMES \
PRODUCT_BOOT_JARS \
PRODUCT_DEX_PREOPT_IMAGE_IN_DATA \
+ PRODUCT_DEX_PREOPT_MODULE_CONFIGS \
+ PRODUCT_DEX_PREOPT_DEFAULT_FLAGS \
+ PRODUCT_DEX_PREOPT_BOOT_FLAGS \
+
define dump-product
$(info ==== $(1) ====)\
@@ -287,3 +291,14 @@
define add-to-product-copy-files-if-exists
$(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1))
endef
+
+# whitespace placeholder when we record module's dex-preopt config.
+_PDPMC_SP_PLACE_HOLDER := |@SP@|
+# Set up dex-preopt config for a module.
+# $(1) list of module names
+# $(2) the modules' dex-preopt config
+define add-product-dex-preopt-module-config
+$(eval _c := $(subst $(space),$(_PDPMC_SP_PLACE_HOLDER),$(strip $(2))))\
+$(eval PRODUCT_DEX_PREOPT_MODULE_CONFIGS += \
+ $(foreach m,$(1),$(m)=$(_c)))
+endef
diff --git a/core/product_config.mk b/core/product_config.mk
index 9468362..e9c6d32 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -413,3 +413,21 @@
# If there is no room in /system for the image, place it in /data
PRODUCT_DEX_PREOPT_IMAGE_IN_DATA := \
$(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_IMAGE_IN_DATA))
+
+PRODUCT_DEX_PREOPT_DEFAULT_FLAGS := \
+ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_DEFAULT_FLAGS))
+PRODUCT_DEX_PREOPT_BOOT_FLAGS := \
+ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_BOOT_FLAGS))
+# Resolve and setup per-module dex-preopot configs.
+PRODUCT_DEX_PREOPT_MODULE_CONFIGS := \
+ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEX_PREOPT_MODULE_CONFIGS))
+# If a module has multiple setups, the first takes precedence.
+_pdpmc_modules :=
+$(foreach c,$(PRODUCT_DEX_PREOPT_MODULE_CONFIGS),\
+ $(eval m := $(firstword $(subst =,$(space),$(c))))\
+ $(if $(filter $(_pdpmc_modules),$(m)),,\
+ $(eval _pdpmc_modules += $(m))\
+ $(eval cf := $(patsubst $(m)=%,%,$(c)))\
+ $(eval cf := $(subst $(_PDPMC_SP_PLACE_HOLDER),$(space),$(cf)))\
+ $(eval DEXPREOPT.$(TARGET_PRODUCT).$(m).CONFIG := $(cf))))
+_pdpmc_modules :=
diff --git a/tools/droiddoc/templates-sac/assets/css/default.css b/tools/droiddoc/templates-sac/assets/css/default.css
index 0d9e601..c1a0c19 100644
--- a/tools/droiddoc/templates-sac/assets/css/default.css
+++ b/tools/droiddoc/templates-sac/assets/css/default.css
@@ -1016,12 +1016,13 @@
}
h1 {
color:#333;
- font-size: 22px;
- margin: 20px 0 20px;
+ font-size: 34px;
+ margin: 36px 0 27px;
padding:0 0 10px;
+ font-weight:300;
}
h1, h2 {
- line-height: 32px;
+ line-height: 30px;
}
h1.short {
margin-right:320px;
@@ -1030,35 +1031,41 @@
margin-right:320px;
}
h1.super {
- font-size: 37px;
+ font-size: 37px;
}
h2 {
color:#333;
- font-size: 20px;
- margin: 20px 0 20px;
+ font-size: 26px;
+ margin: 32px 0 20px;
padding:0;
+ font-weight:300;
}
h3 {
color:#333;
- font-size: 18px;
+ font-size: 21px;
+ font-weight:400;
+ margin:21px 0 14px 0;
}
h3, h4 {
- color:#333;
- line-height: 20px;
- margin: 10px 0;
+ line-height: 21px;
}
h4 {
- font-size: 16px;
+ font-size: 18px;
+ margin: 12px 0;
+ font-weight:500;
}
h5 {
- font-size: 14px;
+ font-size: 14px;
}
h5, h6 {
margin: 5px 0;
}
h6 {
- font-size: 12px;
+ font-size: 12px;
}
+
+
+
hr { /* applied to the bottom of h2 elements */
height: 1px;
margin: 5px 0 20px;