[libcxx-commits] [PATCH] D139147: [libc++][Android] Enable libc++ testing using adb on an x86-64 emulator

Ryan Prichard via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 1 16:39:10 PST 2022


rprichard added inline comments.


================
Comment at: libcxx/cmake/caches/AndroidNDK.cmake:21
+# symbol conflicts on older versions of Android.
+set(LIBCXX_ABI_NAMESPACE __ndk1 CACHE STRING "")
+set(LIBCXX_ABI_VERSION 1 CACHE STRING "")
----------------
philnik wrote:
> Does Android actually use a different ABI namespace, or is this just to avoid name clashes when testing? If it's just fur testing purposes I'd suggest to rename it to something like `__test`.
Android has a few different builds of libc++. In the "platform libc++" (`/system/lib[64]/libc++.so`), the namespace is the ordinary `__1`. Apps aren't supposed to use the platform libc++, though, and instead they redistribute a `libc++_shared.so` from the Android NDK. `libc++_shared.so` uses an `__ndk1` namespace. Both the filename and the namespace are supposed to help isolate the NDK libc++ from the platform STL.

With recent Android versions, there are also "APEX modules" that have a copy of libc++.so in them. This copy is very similar to the platform libc++.so, but typically built against an older API level.

Naming it `__test` for this test configuration seems reasonable.



================
Comment at: libcxx/cmake/caches/AndroidNDK.cmake:31
+set(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY ON CACHE BOOL "")
+set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "")
+set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
----------------
philnik wrote:
> This flag isn't honoured anymore. The experimental library will always be built.
I'll remove this line then. It should be fine to build the library, even though I think the experimental library isn't available in the platform or the NDK currently.



================
Comment at: libcxx/utils/ci/run-buildbot-container-android:1
+#!/usr/bin/env bash
+#===----------------------------------------------------------------------===##
----------------
philnik wrote:
> IIUC this allows anybody to run the Android test suite in a docker container? If that's the case, it's //really// nice.
Yes, it should become really easy for others to run the libc++ tests on Android.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139147/new/

https://reviews.llvm.org/D139147



More information about the libcxx-commits mailing list