am db2e0247: Merge "Hide C++ stuff in libc. Put it back in libstdc++."

* commit 'db2e0247ed67dfdf6e16eb47348db81dc8ccd04d':
  Hide C++ stuff in libc. Put it back in libstdc++.
This commit is contained in:
Dan Albert 2014-08-18 20:14:48 +00:00 committed by Android Git Automerger
commit 2b91cf32e6
4 changed files with 58 additions and 39 deletions

View File

@ -102,8 +102,6 @@ libc_bionic_src_files := \
bionic/__cmsg_nxthdr.cpp \ bionic/__cmsg_nxthdr.cpp \
bionic/connect.cpp \ bionic/connect.cpp \
bionic/ctype.cpp \ bionic/ctype.cpp \
bionic/__cxa_guard.cpp \
bionic/__cxa_pure_virtual.cpp \
bionic/dirent.cpp \ bionic/dirent.cpp \
bionic/dup2.cpp \ bionic/dup2.cpp \
bionic/epoll_create.cpp \ bionic/epoll_create.cpp \
@ -142,7 +140,6 @@ libc_bionic_src_files := \
bionic/mknod.cpp \ bionic/mknod.cpp \
bionic/mntent.cpp \ bionic/mntent.cpp \
bionic/NetdClientDispatch.cpp \ bionic/NetdClientDispatch.cpp \
bionic/new.cpp \
bionic/open.cpp \ bionic/open.cpp \
bionic/pause.cpp \ bionic/pause.cpp \
bionic/pipe.cpp \ bionic/pipe.cpp \
@ -230,6 +227,11 @@ libc_bionic_src_files := \
bionic/wchar.cpp \ bionic/wchar.cpp \
bionic/wctype.cpp \ bionic/wctype.cpp \
libc_cxa_src_files := \
bionic/__cxa_guard.cpp \
bionic/__cxa_pure_virtual.cpp \
bionic/new.cpp \
libc_upstream_freebsd_src_files := \ libc_upstream_freebsd_src_files := \
upstream-freebsd/lib/libc/gen/ldexp.c \ upstream-freebsd/lib/libc/gen/ldexp.c \
upstream-freebsd/lib/libc/gen/sleep.c \ upstream-freebsd/lib/libc/gen/sleep.c \
@ -805,6 +807,27 @@ $(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_src_files
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
# ========================================================
# libc_cxa.a - Things traditionally in libstdc++
# ========================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(libc_cxa_src_files)
LOCAL_CFLAGS := $(libc_common_cflags) \
-fvisibility=hidden \
LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
LOCAL_CPPFLAGS := $(libc_common_cppflags)
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_cxa
LOCAL_CLANG := true # GCC refuses to hide new/delete
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY)
# ======================================================== # ========================================================
# libc_syscalls.a # libc_syscalls.a
# ======================================================== # ========================================================
@ -857,6 +880,7 @@ LOCAL_CLANG := $(use_clang)
LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies) LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
LOCAL_WHOLE_STATIC_LIBRARIES := \ LOCAL_WHOLE_STATIC_LIBRARIES := \
libc_bionic \ libc_bionic \
libc_cxa \
libc_dns \ libc_dns \
libc_freebsd \ libc_freebsd \
libc_gdtoa \ libc_gdtoa \
@ -1104,6 +1128,36 @@ include $(BUILD_SHARED_LIBRARY)
endif #!user endif #!user
# ========================================================
# libstdc++.so
# ========================================================
libstdcxx_common_src_files := \
bionic/__cxa_guard.cpp \
bionic/__cxa_pure_virtual.cpp \
bionic/new.cpp \
bionic/libc_logging.cpp \
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_CFLAGS := $(libc_common_cflags)
LOCAL_SRC_FILES := $(libstdcxx_common_src_files)
LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
include $(BUILD_SHARED_LIBRARY)
# ========================================================
# libstdc++.a
# ========================================================
include $(CLEAR_VARS)
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_CFLAGS := $(libc_common_cflags)
LOCAL_SRC_FILES := $(libstdcxx_common_src_files)
LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
include $(BUILD_STATIC_LIBRARY)
# ======================================================== # ========================================================
include $(call all-makefiles-under,$(LOCAL_PATH)) include $(call all-makefiles-under,$(LOCAL_PATH))

View File

@ -172,24 +172,6 @@ libresolv_stuff = set([
'dn_expand', 'dn_expand',
'nsdispatch', 'nsdispatch',
]) ])
# libstdc++ stuff we took over.
libstdcxx_stuff = set([
# new, delete, nothrow
'_ZSt7nothrow',
'_ZdaPv',
'_ZdaPvRKSt9nothrow_t',
'_ZdlPv',
'_ZdlPvRKSt9nothrow_t',
'_Znam',
'_ZnamRKSt9nothrow_t',
'_Znwm',
'_ZnwmRKSt9nothrow_t',
'__cxa_guard_abort',
'__cxa_guard_acquire',
'__cxa_guard_release',
'__cxa_pure_virtual',
])
# Implementation details we know we export (and can't get away from). # Implementation details we know we export (and can't get away from).
known = set([ known = set([
'_ctype_', '_ctype_',
@ -210,8 +192,7 @@ if not only_unwanted:
print 'in bionic but not glibc:' print 'in bionic but not glibc:'
allowed_stuff = (bsd_stuff | FORTIFY_stuff | linux_stuff | macro_stuff | allowed_stuff = (bsd_stuff | FORTIFY_stuff | linux_stuff | macro_stuff |
std_stuff | weird_stuff | libresolv_stuff | libstdcxx_stuff | std_stuff | weird_stuff | libresolv_stuff | known)
known)
for symbol in sorted((bionic - allowed_stuff).difference(glibc)): for symbol in sorted((bionic - allowed_stuff).difference(glibc)):
if symbol in ndk_ignored: if symbol in ndk_ignored:
symbol += '*' symbol += '*'

View File

@ -1,15 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := src/libstdc++.cpp
LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= src/libstdc++.cpp
LOCAL_MODULE:= libstdc++
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
include $(BUILD_STATIC_LIBRARY)

View File

@ -1 +0,0 @@
extern "C" void __this_library_is_now_part_of_libc() {}