From 80dca7ba59d440966bb49ebdaf900ff128e10817 Mon Sep 17 00:00:00 2001 From: Hsin-Yi Chen Date: Tue, 5 Mar 2024 12:47:35 +0800 Subject: [PATCH] Annotate LLNDK functions in non-vendor libraries The ABI tool analyzes the source code of LLNDK libraries. It compiles the source with the flags for core variants where __INTRODUCED_IN_LLNDK does not version the API. To expose the version information to the ABI tool, __INTRODUCED_IN_LLNDK is defined as an "annotate" attribute in core variants. Test: make Bug: 314010764 Change-Id: I798a397f0e7567ca54db5e4aff4235933ebd3943 --- libvendorsupport/include_llndk/android/llndk-versioning.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libvendorsupport/include_llndk/android/llndk-versioning.h b/libvendorsupport/include_llndk/android/llndk-versioning.h index 7c408c940..b375a2fa7 100644 --- a/libvendorsupport/include_llndk/android/llndk-versioning.h +++ b/libvendorsupport/include_llndk/android/llndk-versioning.h @@ -40,8 +40,10 @@ __BEGIN_DECLS #else // __ANDROID_VENDOR__ // For non-vendor libraries, __INTRODUCED_IN_LLNDK must be ignored because it must not change -// symbols of NDK or the system side of the treble boundary. -#define __INTRODUCED_IN_LLNDK(vendor_api_level) +// symbols of NDK or the system side of the treble boundary. It leaves a no-op annotation for ABI +// analysis. +#define __INTRODUCED_IN_LLNDK(vendor_api_level) \ + __attribute__((annotate("introduced_in_llndk=" #vendor_api_level))) #endif // __ANDROID_VENDOR__