-
Notifications
You must be signed in to change notification settings - Fork 263
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
remove explicit API guards from bionic #2058
Comments
Should API guards be added to some structs?
|
we'll probably have to do some, yes.
if you work on gnulib, "please fix your configure file to check for the functions you want, rather than making potentially invalid assumptions like this" ... if you don't, yeah, this is the kind of thing we'll want to work around in the short term (but probably still file bugs with the libraries that have broken assumptions like this). |
Yes, please fix those problems if you're able. If we hide structs or constants in the NDK it's a hack to keep those projects building that prevents other projects from using those types. |
Test: ndk/checkbuild.py && ndk/run_tests.py Bug: android/ndk#2058 Change-Id: Ie726e052618284c76c865bb1fce90ea6450c5a25
Description
WEAK_API_DEFS
doesn't work for anything in libc because we've got a tool that adds explicit API guards wherever there's an__INTRODUCED_IN
(but only in bionic). That was a workaround we needed back when we supported GCC and could rely on__attribute__((availability))
everywhere, but that's long gone.https://r.android.com/3236544 removes that. Can see from the one explicit guard I put back that there is potential for source compat break here. I'm planning to add explicit guards back wherever they're need to keep from breaking common 3p libraries, but there's no way to find those proactively.
The extremely conservative approach that wouldn't risk any source compat breaks but would still let us remove the tool that's supporting this (so still reduces our maintenance costs, but unfortunately would give up the advantage of making
WEAK_API_DEFS
work everywhere) would be to check in the preprocessed headers with the explicit guards. That can be the last resort, but it'd be much better ifWEAK_API_DEFS
can also benefit from this.I'm feeling ambitious today so aiming for r28, but if the change doesn't land in time for beta 1 it'll get pushed to r29.
The text was updated successfully, but these errors were encountered: