[libcxx-commits] [libcxx] [libc++][Android] Restrict use of mblen/towctrans/wctrans (PR #116147)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 15 10:39:59 PST 2025


philnik777 wrote:

> > Sorry this fell between the cracks and I forgot to review again. Thanks for the clear explanation of Android NDK versions.
> > For these kinds of things in general, we tend to favour using `XFAIL: android-ndk-<version>` instead, since that prevents the accumulation of `#ifdef`s in the test suite. Would you be willing to use that instead?
> 
> We could use `UNSUPPORTED:` instead, which would work with both the old and the new sysroot. Is that OK?

I think that should be fine with a `TODO` added so we don't forget to remove it again.

> Details:
> 
> We would need to do XFAIL based on both the target API and the NDK sysroot "version", but that's tricky because AFAIK the sysroot doesn't have a version on it.
> 
> The problem is that the NDK's sysroot happened to declare these functions even for old API levels, even though they weren't available in libc.so. It was an old hack to make libc++ happy, IIRC. The sysroot was modified to stop declaring the functions in https://r.android.com/3216959. Of course, they still _are_ declared for new enough API levels (26 and up).
> 
> i.e. This new XFAIL would work with the new sysroot:
> 
> ```
> // towctrans and wctrans were added in Android API 26.
> // XFAIL: target={{.+}}-android{{(eabi)?(21|22|23|24|25)}}
> ```
> 
> ... but it would break the libc++ Android CI until the sysroot in the Docker image was updated (because the tests are currently passing for API 21, which is tested in CI).



https://github.com/llvm/llvm-project/pull/116147


More information about the libcxx-commits mailing list