-
Notifications
You must be signed in to change notification settings - Fork 260
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
NDK's version markers (e.g. LIBC) cause warnings on L MR1 (API 22) #622
Comments
yeah, the idea is that once NDK apps refer to the specific version they want, we can offer modified behaviors via new versions rather than api-level checks. (though obviously the semantics are quite different: an api-level check applies based on your AndroidManifest targetSdkVersion regardless of the NDK target you used, whereas symbol versioning applies based on the NDK target you used regardless of the AndroidManifest targetSdkVersion. so probably not very useful for apps, but maybe useful for vendor code...) |
What api-level checks do you mean? I know either static checks for the platform API (usually, based on minSdkVersion), or dynamic checks (based on the platform we are running on). True, the system dynamic linker uses some shims if the targetSdkVersion is less than the platform version, but this has little to do with version markers on libc and her kin. |
we're not using this yet but the idea is that if have function |
Yes, adding |
So where did we land on this? Do we want to drop the versioning info for @dimitry- was the one that was pushing for getting versioning information on everything, so maybe he remembers better why we did it this way (iirc it's so that you get the correctly versioned symbol on M+ if we end up altering it). I think I agree with @enh that it's probably better to do this sort of thing based on your |
The main reason was to get as much apps as possible to use symbols so we could take advantage of being able to provide to different implementation for different version sooner. Checking targetSdkVersion and having bug-compatible implementation for the symbol are similar but I can thing of one case where symbol versions can provide better compatibility management. That is if app has a third party library which relies on bug-compatible behavior of a libc function but app itself wants to target different sdk version. Another less likely scenario is app using 2 different third party libraries and only one of them relies on bug-compatible implementation of a libc function. the other one has already been fixed and uses the later version. |
@dimitry- the latter scenario falls in the category of "nightmare". The most important challenge is to keep the native libs upwards compatible. The minSdkVersion (reflected by ANDROID_PLATFORM for Cmake) should be the only thing that defines this. |
Yeah, I think we should go ahead and unversion pre-M. We're not punting versions indefinitely, it's just a few more years down the road. |
@rprichard: You suggested the following:
Want to give that a try for r19? |
@DanAlbert Yeah, that sounds good to me. |
@rprichard: if you haven't had a chance to look at this by beta 2, punt to r20. |
@rprichard I'm facing this issue when running a cocos2d-x app with API 22. App won't start anymore. Other APIs (23 and 28) are ok. Thanks |
This won't prevent an app from starting. It's just a warning. |
@rprichard do you want to look at this for r21? |
I can take a closer look at this before r21 ships, but my current impression is that we can't fix it until the NDK switches to lld, because of differences in the way bfd/gold and lld handle version markers. |
Ah, that's right. Okay, I'm going to move this into unplanned then and we'll pick it up later. |
* Update build/soong from branch 'master' to cdf399c40a6c6a61255eba009d504ce2cdf43e7d - Merge "Stop versioning NDK stubs pre-M." - Stop versioning NDK stubs pre-M. Test: make ndk # readelf various stubs to check version info Bug: android/ndk#622 Merged-In: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3 Change-Id: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
* Update build/soong from branch 'master' to cdf399c40a6c6a61255eba009d504ce2cdf43e7d - Merge "Stop versioning NDK stubs pre-M." - Stop versioning NDK stubs pre-M. Test: make ndk # readelf various stubs to check version info Bug: android/ndk#622 Merged-In: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3 Change-Id: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
* Update build/soong from branch 'master' to cdf399c40a6c6a61255eba009d504ce2cdf43e7d - Merge "Stop versioning NDK stubs pre-M." - Stop versioning NDK stubs pre-M. Test: make ndk # readelf various stubs to check version info Bug: android/ndk#622 Merged-In: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3 Change-Id: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
* Update build/soong from branch 'master' to cdf399c40a6c6a61255eba009d504ce2cdf43e7d - Merge "Stop versioning NDK stubs pre-M." - Stop versioning NDK stubs pre-M. Test: make ndk # readelf various stubs to check version info Bug: android/ndk#622 Merged-In: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3 Change-Id: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
* Update build/soong from branch 'master' to cdf399c40a6c6a61255eba009d504ce2cdf43e7d - Merge "Stop versioning NDK stubs pre-M." - Stop versioning NDK stubs pre-M. Test: make ndk # readelf various stubs to check version info Bug: android/ndk#622 Merged-In: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3 Change-Id: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
* Update build/soong from branch 'master' to cdf399c40a6c6a61255eba009d504ce2cdf43e7d - Merge "Stop versioning NDK stubs pre-M." - Stop versioning NDK stubs pre-M. Test: make ndk # readelf various stubs to check version info Bug: android/ndk#622 Merged-In: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3 Change-Id: Ic2930cfe5ee8377bb89bfb1bc051b6975f6e57d3
Split off from #602. That issue complained that even a Hello World executable prints linker errors about an unrecognized PIE flag. One of the comments instead complained about DT entry errors:
#602 (comment)
I debugged it here: https://android-review.googlesource.com/c/toolchain/binutils/+/571550#message-07efb48b6e8c26830153ec7ae05384dfb2acf14a. It only happens on L MR1 (API 22).
Test program:
The unrecognized 0x6ffffffe and 0x6fffffff DT entries are the VERNEED and VERNEEDNUM entries in a.out:
a.out has these symbols because the libc.so stub library has marked all its symbols with a LIBC version.
I'm not sure which NDK release was the first to use these version markers. r13b has them. r10e doesn't:
Maybe we can simply leave the version markers off of
libc.so
stub libraries for 22 and below?I'm not quite sure why we have these version markers. Maybe we want binaries on newer OSs to have them, and they don't break typical apps even on L MR1. There's also a LIBC_DEPRECATED version marker, and starting with N, each new version's APIs have a different marker (LIBC_N, LIBC_O, LIBC_P).
The text was updated successfully, but these errors were encountered: