Skip to content

Commit 4ad2fc7

Browse files
tynasello-googletomtor
authored andcommitted
[libc++] Expand Android libc++ test config files (llvm#142846)
Parameterize (and rename) existing libc++/libc++abi test configuration files for the Android NDK to work for both the NDK and platform. Android LLVM downstream seeks to test libc++ for both the NDK and platform build (currently only testing the NDK), which will use almost identical test configuration files. The only difference is the name of the libc++ shared object used. Because of this we parameterize the current test files (for both libc++ and libc++abi) with the existing LIBCXX_SHARED_OUTPUT_NAME cmake variable, and rename the file accordingly.
1 parent 01593f4 commit 4ad2fc7

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

libcxx/cmake/caches/AndroidNDK.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ set(CMAKE_CXX_COMPILER_WORKS ON CACHE BOOL "")
3333

3434
# Use adb to push tests to a locally-connected device (e.g. emulator) and run
3535
# them.
36-
set(LIBCXX_TEST_CONFIG "llvm-libc++-android-ndk.cfg.in" CACHE STRING "")
37-
set(LIBCXXABI_TEST_CONFIG "llvm-libc++abi-android-ndk.cfg.in" CACHE STRING "")
36+
set(LIBCXX_TEST_CONFIG "llvm-libc++-android.cfg.in" CACHE STRING "")
37+
set(LIBCXXABI_TEST_CONFIG "llvm-libc++abi-android.cfg.in" CACHE STRING "")

libcxx/test/configs/llvm-libc++-android-ndk.cfg.in renamed to libcxx/test/configs/llvm-libc++-android.cfg.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This testing configuration handles running the test suite against LLVM's
2-
# libc++ using adb and a libc++_shared.so library on Android.
2+
# libc++ using adb on Android.
33

44
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
55

@@ -27,11 +27,11 @@ if re.match(r'i686-linux-android(21|22|23)$', config.target_triple):
2727
compile_flags += ' -mstackrealign'
2828
config.substitutions.append(('%{compile_flags}', compile_flags))
2929

30-
# The NDK library is called "libc++_shared.so". Use LD_LIBRARY_PATH to find
31-
# libc++_shared.so because older Bionic dynamic loaders don't support rpath
32-
# lookup.
30+
# The platform library is called "libc++.so" and the NDK library is called "libc++_shared.so".
31+
# Use LD_LIBRARY_PATH to find the libcxx shared object because older Bionic dynamic loaders
32+
# don't support rpath lookup.
3333
config.substitutions.append(('%{link_flags}',
34-
'-nostdlib++ -L %{lib-dir} -lc++_shared'
34+
'-nostdlib++ -L %{lib-dir} -l@LIBCXX_SHARED_OUTPUT_NAME@'
3535
))
3636
config.substitutions.append(('%{exec}',
3737
'%{executor}' +

libcxxabi/test/configs/llvm-libc++abi-android-ndk.cfg.in renamed to libcxxabi/test/configs/llvm-libc++abi-android.cfg.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This testing configuration handles running the test suite against LLVM's
2-
# libc++abi using adb and a libc++_shared.so library on Android.
2+
# libc++abi using adb on Android.
33

44
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
55

@@ -19,12 +19,12 @@ config.substitutions.append(('%{compile_flags}',
1919
'-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -I %{libcxx}/test/support -I %{libcxx}/src -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS'
2020
))
2121

22-
# The NDK library is called "libc++_shared.so". Use LD_LIBRARY_PATH to find
23-
# libc++_shared.so because older Bionic dynamic loaders don't support rpath
24-
# lookup. The Android libc++ shared library exports libc++abi, so we don't need
25-
# to link with -lc++abi.
22+
# The platform library is called "libc++.so" and the NDK library is called "libc++_shared.so".
23+
# Use LD_LIBRARY_PATH to find the libcxx shared object because older Bionic dynamic loaders
24+
# don't support rpath lookup. The Android libc++ shared library exports libc++abi, so we
25+
# don't need to link with -lc++abi.
2626
config.substitutions.append(('%{link_flags}',
27-
'-nostdlib++ -L %{lib} -lc++_shared'
27+
'-nostdlib++ -L %{lib} -l@LIBCXX_SHARED_OUTPUT_NAME@'
2828
))
2929
config.substitutions.append(('%{exec}',
3030
'%{executor}' +

0 commit comments

Comments
 (0)