Enable using clang to build __cxa_thread_atexit_impl.

Remove previous workaround as we no longer use
__thread in __cxa_thread_atexit_impl.cpp.

Change-Id: Ic1062995db488859b341acdda0b5f6635e10d7e8
diff --git a/libc/Android.bp b/libc/Android.bp
index 513da1b..74fd22b 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -831,8 +831,9 @@
 cc_library_static {
     defaults: ["libc_defaults"],
     srcs: [
-        // The fork implementation depends on pthread data, so we can't include
-        // it in libc_ndk.a.
+        // The following implementations depend on pthread data, so we can't
+        // include them in libc_ndk.a.
+        "bionic/__cxa_thread_atexit_impl.cpp",
         "bionic/fork.cpp",
 
         // The data that backs getauxval is initialized in the libc init
@@ -1454,22 +1455,6 @@
     name: "libc_bionic_ndk",
 }
 
-cc_library_static {
-    name: "libc_thread_atexit_impl",
-    defaults: ["libc_defaults"],
-    srcs: ["bionic/__cxa_thread_atexit_impl.cpp"],
-    cflags: ["-Wframe-larger-than=2048"],
-    cppflags: ["-Wold-style-cast"],
-    include_dirs: ["bionic/libstdc++/include"],
-
-    arch: {
-        arm64: {
-            // b/25662915, clang compiled __cxa_thread_atexit_impl.cpp still failed.
-            clang: false,
-        },
-    },
-}
-
 // ========================================================
 // libc_pthread.a - pthreads parts that previously lived in
 // libc_bionic.a. Relocated to their own library because
@@ -1665,7 +1650,6 @@
         "libc_pthread",
         "libc_stack_protector",
         "libc_syscalls",
-        "libc_thread_atexit_impl",
         "libc_tzcode",
     ],
 
diff --git a/libc/Android.mk b/libc/Android.mk
index 0248c5e..4182505 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -243,9 +243,11 @@
 
 libc_bionic_src_files :=
 
-# The fork implementation depends on pthread data, so we can't include it in
-# libc_ndk.a.
-libc_bionic_src_files += bionic/fork.cpp
+# The following implementations depend on pthread data, so we can't include
+# them in libc_ndk.a.
+libc_bionic_src_files += \
+    bionic/__cxa_thread_atexit_impl.cpp \
+    bionic/fork.cpp \
 
 # The data that backs getauxval is initialized in the libc init functions which
 # are invoked by the linker. If this file is included in libc_ndk.a, only one of
@@ -586,9 +588,6 @@
     bionic/pthread_sigmask.cpp \
     bionic/pthread_spinlock.cpp \
 
-libc_thread_atexit_impl_src_files := \
-    bionic/__cxa_thread_atexit_impl.cpp \
-
 libc_arch_static_src_files := \
     bionic/dl_iterate_phdr_static.cpp \
 
@@ -1045,25 +1044,6 @@
 $(eval $(call patch-up-arch-specific-flags,LOCAL_SRC_FILES,libc_bionic_ndk_src_files))
 include $(BUILD_STATIC_LIBRARY)
 
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(libc_thread_atexit_impl_src_files)
-LOCAL_CFLAGS := $(libc_common_cflags) -Wframe-larger-than=2048
-
-LOCAL_CONLYFLAGS := $(libc_common_conlyflags)
-LOCAL_CPPFLAGS := $(libc_common_cppflags) -Wold-style-cast
-LOCAL_C_INCLUDES := $(libc_common_c_includes)
-LOCAL_MODULE := libc_thread_atexit_impl
-LOCAL_CLANG := $(use_clang)
-LOCAL_ADDITIONAL_DEPENDENCIES := $(libc_common_additional_dependencies)
-LOCAL_CXX_STL := none
-LOCAL_SYSTEM_SHARED_LIBRARIES :=
-LOCAL_SANITIZE := never
-LOCAL_NATIVE_COVERAGE := $(bionic_coverage)
-
-# b/25662915, clang compiled __cxa_thread_atexit_impl.cpp still failed.
-LOCAL_CLANG_arm64 := false
-
-include $(BUILD_STATIC_LIBRARY)
 
 # ========================================================
 # libc_pthread.a - pthreads parts that previously lived in
@@ -1261,7 +1241,6 @@
     libc_pthread \
     libc_stack_protector \
     libc_syscalls \
-    libc_thread_atexit_impl \
     libc_tzcode \
 
 LOCAL_WHOLE_STATIC_LIBRARIES_arm := libc_aeabi