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

Shoaib Meenai via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jan 7 02:11:01 PST 2023


smeenai 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 "")
----------------
ldionne wrote:
> rprichard wrote:
> > 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.
> > 
> Ideally, this cache file would reflect the way you actually build for the NDK. The executables in the test suite should reliably use `-nostdlib++` and so on to make sure that we're linking only against the just-built libc++, so I am not sure whether these hoops are necessary. Did you notice that the tests were not being linked/run against the right library?
> 
> The same comment holds for the `_static` renaming above.
Yeah, I feel like it'd be less confusing if this used the `__ndk` inline namespace like the actual NDK's libc++ does.


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