Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull bionic's %a support into libandroid_support #437

Closed
DanAlbert opened this issue Jun 28, 2017 · 1 comment
Closed

pull bionic's %a support into libandroid_support #437

DanAlbert opened this issue Jun 28, 2017 · 1 comment
Assignees
Milestone

Comments

@DanAlbert
Copy link
Member

As part of #300, I'm pruning the musl stdio stuff from libandroid_support. One thing we're losing during this transition is %a support in the printf family. This bug tracks getting that pulled back in.

@DanAlbert DanAlbert added this to the r16 milestone Jun 28, 2017
@DanAlbert DanAlbert self-assigned this Jun 28, 2017
@DanAlbert DanAlbert modified the milestones: unplanned, r16 Jul 25, 2017
@DanAlbert
Copy link
Member Author

Given feedback on #440, I'm moving anything that would expand the compatlib into the unplanned bucket.

miodragdinic pushed a commit to MIPS/ndk that referenced this issue Apr 17, 2018
Historically this is where the libandroid_support bugs are. The only
things we lose by dropping this is support for %a in printf and
functioning versions of *wprintf functions.

Parts of libc++ that rely on the former are just being marked XFAIL
for the moment (it's only needed for serialization of RNG state to
stringstreams, something that doesn't seem all that important). We'll
pick up Bionic's *sprintf family later to fix this.

We've actually had definitions for the latter forever, but they just
return -1 and set errno to ENOTSUP. The functions existing but not
working actually causes std::to_wstring to OOM (it allocates an
increasingly large wstring until it finds one that doesn't fail, and
never does), which in turn causes OOM killer to kill the device.

We can avoid this by implementing swprintf in terms of snprintf, using
wcsrtombs and mbsrtowcs to translate. The only thing that doesn't work
in this case is %ls. Since we're delegating to the device's snprintf,
that will not work on old devices, but will work on new devices, so
this only improves functionality.

We need to pull in part of bionic's wide character implementation for
this, because musl's isn't correct.

Also disable a %a test for pre-L. We didn't have support for this
until L, and it's temporarily being removed from libandroid_support.

Test: ./checkbuild.py && ./run_tests.py
Bug: android/ndk#300
Bug: android/ndk#437
Change-Id: Ic70c0d3f6f439de2e1c19027ec4fd3d37b766f77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant