diff --git a/tests/Android.mk b/tests/Android.mk index 8f2d3cf04..e2fae5247 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -313,15 +313,6 @@ bionic-unit-tests_shared_libraries_target := \ libdl_preempt_test_1 \ libdl_preempt_test_2 -# Clang/llvm has incompatible long double (fp128) for x86_64. -# https://llvm.org/bugs/show_bug.cgi?id=23897 -# This affects most of math_test.cpp. -# For arm and arm64 target, b/25643775: -# external/libcxx/include/sstream:859: warning: relocation refers to discarded section -ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86_64 arm arm64)) -bionic-unit-tests_clang_target := false -endif - bionic-unit-tests_shared_libraries_target += libdl_test_df_1_global module := bionic-unit-tests diff --git a/tests/atexit_test.cpp b/tests/atexit_test.cpp index e92889d1c..67fbfd2be 100644 --- a/tests/atexit_test.cpp +++ b/tests/atexit_test.cpp @@ -14,7 +14,17 @@ * limitations under the License. */ +// To work around b/25643775, we disable clang optimization so that +// VTT for std::__1::basic_stringstream, +// std::__1::allocator > +// will be correctly kept for other module's references. +#if defined(__clang__) && (defined(__arm__) || defined(__aarch64__)) +#pragma clang optimize off +#endif #include +#if defined(__clang__) && (defined(__arm__) || defined(__aarch64__)) +#pragma clang optimize on +#endif #include #include