Commit graph

2 commits

Author SHA1 Message Date
Greg Kroah-Hartman
bfb2ce3eb1 ANDROID: GKI: rework the ANDROID_KABI_USE() macro to not use __UNIQUE()
The __UNIQUE_ID() macro causes problems as it turns out to not be
deterministic across different compiler runs as it relies on the
__COUNTER__ macro which could have been used on other .h files previous
to this .h file being included.

This shows up specifically when building with "LTO=thin" vs. "LTO=full"
as different build paths seem to be triggered.

As the structure name isn't really needed at all here, we were just
including it for older compilers that could not handle anonymous
structures in a union, just drop the whole thing which resolves the abi
naming issue.

Bug: 210255585
Reported-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6b9449fa9d26ffc5d66b2f0f3b41e2d5f3003f68
2021-11-09 18:38:36 +01:00
Greg Kroah-Hartman
3605968cf0 ANDROID: GKI: add android_kabi.h
This header file is to be used for various macros to help make keeping
the kernel ABI "stable" during an "ABI Freeze" period.

They are to be used both before the freeze (to anticipate places where
there will be changes), and after the freeze (to keep the abi stable for
structures where there were changes due to LTS or other changes to the
kernel tree.)

Strongly based on rh_kabi.h from Red Hat's RHEL kernel tree.

This adds support for "real" padding and the ability to replace fields
with other fields.

But, note that ABI changes will still be caught by libabigail at this
point in time, work on that is still ongoing.  When that is completed,
all that will be needed is to modify the _ANDROID_KABI_RESERVE() macro
in this file.  No other file changes should be needed.

Bug: 151154716
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I77038cc251c819c3ed22a9cb8843b185416b6727
2020-03-17 10:07:47 +01:00