diff options
author | Dan Albert <danalbert@google.com> | 2015-04-01 16:26:54 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-04-01 16:31:57 -0700 |
commit | d6bf3d5e19f192dc1949b573d931d487c42730fa (patch) | |
tree | 6cf22de9eb63e28b7447f58b13b326f69dce4ca4 /libc/Android.mk | |
parent | b023799a6027924aad13b0f91c0b5b7f1b9cfe2d (diff) | |
download | android_bionic-d6bf3d5e19f192dc1949b573d931d487c42730fa.tar.gz android_bionic-d6bf3d5e19f192dc1949b573d931d487c42730fa.tar.bz2 android_bionic-d6bf3d5e19f192dc1949b573d931d487c42730fa.zip |
Don't export new/delete from libc shared libraries.
This used to be handled by -fvisibility=hidden on libc_cxa, but that
was broken by the resolution of https://llvm.org/PR22419 (introduced
to Android in today's clang update).
Now we just use a version script that prevents these from being
re-exported from our shared libraries.
Change-Id: Ib290e1d0d7426e09ad17a91178162fff6dbdcfa9
Diffstat (limited to 'libc/Android.mk')
-rw-r--r-- | libc/Android.mk | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/libc/Android.mk b/libc/Android.mk index e438552eb..0de0fb21c 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -1347,9 +1347,6 @@ LOCAL_CFLAGS := $(libc_common_cflags) LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) -# TODO: This is to work around b/19059885. Remove after root cause is fixed -LOCAL_LDFLAGS_arm := -Wl,--hash-style=sysv - LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_SRC_FILES := \ $(libc_arch_dynamic_src_files) \ @@ -1359,8 +1356,10 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libc LOCAL_CLANG := $(use_clang) -LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_REQUIRED_MODULES := tzdata +LOCAL_ADDITIONAL_DEPENDENCIES := \ + $(libc_common_additional_dependencies) \ + $(LOCAL_PATH)/version_script.txt \ # Leave the symbols in the shared library so that stack unwinders can produce # meaningful name resolution. @@ -1379,11 +1378,17 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_CXX_STL := none LOCAL_SYSTEM_SHARED_LIBRARIES := +# Don't re-export new/delete and friends, even if the compiler really wants to. +LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt + # We'd really like to do this for all architectures, but since this wasn't done # before, these symbols must continue to be exported on LP32 for binary # compatibility. LOCAL_LDFLAGS_64 := -Wl,--exclude-libs,libgcc.a +# TODO: This is to work around b/19059885. Remove after root cause is fixed +LOCAL_LDFLAGS_arm := -Wl,--hash-style=sysv + $(eval $(call patch-up-arch-specific-flags,LOCAL_CFLAGS,libc_common_cflags)) $(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_arch_dynamic_src_files)) # special for arm @@ -1431,7 +1436,9 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libc_malloc_debug_leak LOCAL_CLANG := $(use_clang) -LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) +LOCAL_ADDITIONAL_DEPENDENCIES := \ + $(libc_common_additional_dependencies) \ + $(LOCAL_PATH)/version_script.txt \ LOCAL_SHARED_LIBRARIES := libc libdl LOCAL_CXX_STL := none @@ -1442,6 +1449,9 @@ LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm LOCAL_STATIC_LIBRARIES += libc++abi LOCAL_ALLOW_UNDEFINED_SYMBOLS := true +# Don't re-export new/delete and friends, even if the compiler really wants to. +LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt + # Don't install on release build LOCAL_MODULE_TAGS := eng debug LOCAL_ADDRESS_SANITIZER := false @@ -1471,12 +1481,17 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libc_malloc_debug_qemu LOCAL_CLANG := $(use_clang) -LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) +LOCAL_ADDITIONAL_DEPENDENCIES := \ + $(libc_common_additional_dependencies) \ + $(LOCAL_PATH)/version_script.txt \ LOCAL_SHARED_LIBRARIES := libc libdl LOCAL_CXX_STL := none LOCAL_SYSTEM_SHARED_LIBRARIES := +# Don't re-export new/delete and friends, even if the compiler really wants to. +LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt + # Don't install on release build LOCAL_MODULE_TAGS := eng debug LOCAL_ADDRESS_SANITIZER := false |