Merge "Add -Wl,--hash-style=sysv flag to rs: transform-bc-to-so for compatibility lib."
diff --git a/core/binary.mk b/core/binary.mk
index 9f17fd5..5f64088 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -9,6 +9,46 @@
include $(BUILD_SYSTEM)/base_rules.mk
#######################################
+##################################################
+# Compute the dependency of the shared libraries
+##################################################
+# On the target, we compile with -nostdlib, so we must add in the
+# default system shared libraries, unless they have requested not
+# to by supplying a LOCAL_SYSTEM_SHARED_LIBRARIES value. One would
+# supply that, for example, when building libc itself.
+ifdef LOCAL_IS_HOST_MODULE
+ ifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)
+ my_system_shared_libraries :=
+ else
+ my_system_shared_libraries := $(LOCAL_SYSTEM_SHARED_LIBRARIES)
+ endif
+else
+ ifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)
+ my_system_shared_libraries := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES)
+ else
+ my_system_shared_libraries := $(LOCAL_SYSTEM_SHARED_LIBRARIES)
+ endif
+endif
+
+# The following LOCAL_ variables will be modified in this file.
+# Because the same LOCAL_ variables may be used to define modules for both 1st arch and 2nd arch,
+# we can't modify them in place.
+my_src_files := $(LOCAL_SRC_FILES)
+my_static_libraries := $(LOCAL_STATIC_LIBRARIES)
+my_whole_static_libraries := $(LOCAL_WHOLE_STATIC_LIBRARIES)
+my_shared_libraries := $(LOCAL_SHARED_LIBRARIES)
+my_cflags := $(LOCAL_CFLAGS)
+my_cppflags := $(LOCAL_CPPFLAGS)
+my_ldflags := $(LOCAL_LDFLAGS)
+my_ldlibs := $(LOCAL_LDLIBS)
+my_asflags := $(LOCAL_ASFLAGS)
+my_cc := $(LOCAL_CC)
+my_cxx := $(LOCAL_CXX)
+my_c_includes := $(LOCAL_C_INCLUDES)
+my_generated_sources := $(LOCAL_GENERATED_SOURCES)
+my_native_coverage := $(LOCAL_NATIVE_COVERAGE)
+my_additional_dependencies := $(LOCAL_MODULE_MAKEFILE) $(LOCAL_ADDITIONAL_DEPENDENCIES)
+
my_ndk_sysroot :=
my_ndk_sysroot_include :=
my_ndk_sysroot_lib :=
@@ -28,6 +68,12 @@
my_ndk_sysroot_lib := $(my_ndk_sysroot)/usr/lib
endif
+ # The bionic linker now has support for gnu style hashes (which are much
+ # faster!), but shipping to older devices requires the old style hash.
+ #ifeq ($(shell expr $(LOCAL_SDK_VERSION) >= FIRST_SUPPORTED_VERSION),0)
+ my_ldflags += -Wl,--hash-style=sysv
+ #endif
+
# Set up the NDK stl variant. Starting from NDK-r5 the c++ stl resides in a separate location.
# See ndk/docs/CPLUSPLUS-SUPPORT.html
my_ndk_stl_include_path :=
@@ -76,46 +122,6 @@
endif
endif
-##################################################
-# Compute the dependency of the shared libraries
-##################################################
-# On the target, we compile with -nostdlib, so we must add in the
-# default system shared libraries, unless they have requested not
-# to by supplying a LOCAL_SYSTEM_SHARED_LIBRARIES value. One would
-# supply that, for example, when building libc itself.
-ifdef LOCAL_IS_HOST_MODULE
- ifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)
- my_system_shared_libraries :=
- else
- my_system_shared_libraries := $(LOCAL_SYSTEM_SHARED_LIBRARIES)
- endif
-else
- ifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)
- my_system_shared_libraries := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES)
- else
- my_system_shared_libraries := $(LOCAL_SYSTEM_SHARED_LIBRARIES)
- endif
-endif
-
-# The following LOCAL_ variables will be modified in this file.
-# Because the same LOCAL_ variables may be used to define modules for both 1st arch and 2nd arch,
-# we can't modify them in place.
-my_src_files := $(LOCAL_SRC_FILES)
-my_static_libraries := $(LOCAL_STATIC_LIBRARIES)
-my_whole_static_libraries := $(LOCAL_WHOLE_STATIC_LIBRARIES)
-my_shared_libraries := $(LOCAL_SHARED_LIBRARIES)
-my_cflags := $(LOCAL_CFLAGS)
-my_cppflags := $(LOCAL_CPPFLAGS)
-my_ldflags := $(LOCAL_LDFLAGS)
-my_ldlibs := $(LOCAL_LDLIBS)
-my_asflags := $(LOCAL_ASFLAGS)
-my_cc := $(LOCAL_CC)
-my_cxx := $(LOCAL_CXX)
-my_c_includes := $(LOCAL_C_INCLUDES)
-my_generated_sources := $(LOCAL_GENERATED_SOURCES)
-my_native_coverage := $(LOCAL_NATIVE_COVERAGE)
-my_additional_dependencies := $(LOCAL_MODULE_MAKEFILE) $(LOCAL_ADDITIONAL_DEPENDENCIES)
-
# MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
# all code is position independent, and then those warnings get promoted to
# errors.
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index d064e8c..ae2c586 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -16,7 +16,9 @@
DEX2OATD_DEPENDENCY := $(DEX2OAT_DEPENDENCY)
DEX2OATD_DEPENDENCY += $(DEX2OATD)
-PRELOADED_CLASSES := frameworks/base/preloaded-classes
+# Use the first preloaded-classes file in PRODUCT_COPY_FILES.
+PRELOADED_CLASSES := $(call word-colon,1,$(firstword \
+ $(filter %system/etc/preloaded-classes,$(PRODUCT_COPY_FILES))))
# Default to debug version to help find bugs.
# Set USE_DEX2OAT_DEBUG to false for only building non-debug versions.
diff --git a/core/target_test_internal.mk b/core/target_test_internal.mk
index ed011d1..f8a9f04 100644
--- a/core/target_test_internal.mk
+++ b/core/target_test_internal.mk
@@ -6,25 +6,10 @@
LOCAL_C_INCLUDES += external/gtest/include
-my_test_libcxx := true
-ifdef LOCAL_SDK_VERSION
-my_test_libcxx := false
-endif
-ifneq ($(filter $(strip $(LOCAL_CXX_STL)),stlport stlport_static),)
-my_test_libcxx := false
-endif
-
-ifeq ($(my_test_libcxx),true)
-LOCAL_STATIC_LIBRARIES += libgtest_libc++ libgtest_main_libc++
-else
-LOCAL_STATIC_LIBRARIES += libgtest libgtest_main
-
ifndef LOCAL_SDK_VERSION
-LOCAL_C_INCLUDES += bionic \
- bionic/libstdc++/include \
- external/stlport/stlport
-LOCAL_SHARED_LIBRARIES += libstlport libstdc++
-endif
+LOCAL_STATIC_LIBRARIES += libgtest libgtest_main
+else
+LOCAL_STATIC_LIBRARIES += libgtest_ndk libgtest_main_ndk
endif
ifdef LOCAL_MODULE_PATH
diff --git a/envsetup.sh b/envsetup.sh
index d39a2f1..66f9136 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1638,9 +1638,17 @@
local secs=$(($tdiff % 60))
echo
if [ $ret -eq 0 ] ; then
- echo -n -e "#### make completed successfully "
+ if [ $(uname) != "Darwin" ]; then
+ echo -n -e "\e[0;32m#### make completed successfully "
+ else
+ echo -n -e "#### make completed successfully "
+ fi
else
- echo -n -e "#### make failed to build some targets "
+ if [ $(uname) != "Darwin" ]; then
+ echo -n -e "\e[0;31m#### make failed to build some targets "
+ else
+ echo -n -e "#### make failed to build some targets "
+ fi
fi
if [ $hours -gt 0 ] ; then
printf "(%02g:%02g:%02g (hh:mm:ss))" $hours $mins $secs
@@ -1649,13 +1657,13 @@
elif [ $secs -gt 0 ] ; then
printf "(%s seconds)" $secs
fi
- echo -e " ####"
+ if [ $(uname) != "Darwin" ]; then
+ echo -e " ####\e[00m"
+ fi
echo
return $ret
}
-
-
if [ "x$SHELL" != "x/bin/bash" ]; then
case `ps -o command -p $$` in
*bash*)
diff --git a/target/product/base.mk b/target/product/base.mk
index 9713330..6387fda 100644
--- a/target/product/base.mk
+++ b/target/product/base.mk
@@ -115,4 +115,8 @@
wm
+PRODUCT_COPY_FILES := $(call add-to-product-copy-files-if-exists,\
+ frameworks/base/preloaded-classes:system/etc/preloaded-classes)
+
+
$(call inherit-product, $(SRC_TARGET_DIR)/product/embedded.mk)