-
Notifications
You must be signed in to change notification settings - Fork 265
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
x86 API level 16 and 17 incorrect ldexp result #507
Comments
Just tested and the problem is also present with the latest 16.0.4293906-beta1 NDK. |
interesting that you're seeing this with r16 too, because one difference there is that libandroid_support.a contains ldexpl for x86 in r16 but didn't in r15 (see #502). |
Just checked and the problem is also present on API 10 and API 15 so basically any x86 image below API 18 (tested with 16.0.4293906-beta1). To clarify the original report: |
i suspect that
fixed ldexpl for x86 (by fixing the scalbn family). that's pretty much the last time that any of these functions changed, and it would tie in well with the API 18 release date. the odd part here is that the r16beta1 libandroid_support.a should include an ldexpl. ah, except it's a weak reference. and i guess i don't know what that resolves to at run time. (though your example suggests "the incorrect copy in libm".) that presumably means that none of
are actually helping. maybe we do want to fix https://issuetracker.google.com/64450768 and use _RENAME for all the <math.h> *l functions sooner rather than later... presumably if you edit <math.h> to say
then your code works? i think we want to add a __RENAME32 (or somesuch) so we can add these annotations to all the long double functions in <math.h> (since |
Yes, replacing This is the output of objdump on a empty new c++ android project with a call to
We can see that the call is not handled through |
https://android-review.googlesource.com/#/c/platform/bionic/+/485247 is the proposed fix (in the platform). |
Thanks for the update! How does this impact the NDK exactly? Does the NDK get packaged with the headers from platform/bionic or? Can we expect the next beta release of the r16 NDK to have these changes included? |
TL;DR, yes, we hope to get this into r16beta2. step 1 is for me to submit the change mentioned above. step 2 is that we run a script that copies all the latest headers into the NDK. step 3 is to cherrypick that batch of new headers to the r16 release branch. step 0 though is for me to manually cherrypick my libc change into my NDK and check that it doesn't break anything (it seems quite likely to upset the current libandroid_support), and fix libandroid_support appropriately. |
Ok, thank you for the clarification! |
We can cut a lot of stuff out of the NDK's libandroid_support with this, and reduce unnecessary relocations for all LP32 code. LP64 code should be unaffected. Bug: https://issuetracker.google.com/64450768 Bug: android/ndk#507 Test: ran tests, plus manual readelf on the _test.o files Change-Id: I3de6015921195304ea9c829ef31665cd34664066
i think at this point everything's done and this should be in beta2... |
Bug: https://issuetracker.google.com/64450768 Bug: android/ndk#507 Test: built tests Change-Id: I49b8a6008e5131b054eb1eefe0a0130699e3b082
Description
We are having problems with the boost multiprecision library failing to initialize which were traced to a call to
std::ldexp
which is returning NaN instead of 536870912 for a long double input:std::ldexp(0.5L, 30)
. Making the same call with a double inputstd::ldexp(0.5, 30)
works fine.Can be easily reproduced in a new vanila project with c++ support by pasting the above line in the generated native-lib.cpp.
As far as we've been able to test, this only occures on x86 api level 16 and 17. Higher api levels are not affected as well as arm7 abi-s.
The text was updated successfully, but these errors were encountered: