Skip to content

remove explicit API guards from bionic #2058

@DanAlbert

Description

@DanAlbert

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 if WEAK_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.

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions