From 31e7de74001ff54e104169fe4eac13532860864f Mon Sep 17 00:00:00 2001 From: Giuliano Procida Date: Tue, 10 Jun 2025 19:16:48 +0100 Subject: [PATCH] ANDROID: disable KABI macros for VDSO and EFI libstub If BUILD_VDSO or __DISABLED_EXPORTS are defined, mostly disable the KABI macros to prevent VDSO and EFI libstub link errors. Bug: 400972353 Change-Id: I8031509bc5b481f0350735ecdf6c79f6d885daeb Suggested-by: Sami Tolvanen Signed-off-by: Giuliano Procida Signed-off-by: John Stultz --- include/linux/android_kabi.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/android_kabi.h b/include/linux/android_kabi.h index f5cc7c48477e..f36faf4654cd 100644 --- a/include/linux/android_kabi.h +++ b/include/linux/android_kabi.h @@ -42,11 +42,15 @@ * Worker macros, don't use these, use the ones without a leading '_' */ +#if defined(BUILD_VDSO) || defined(__DISABLE_EXPORTS) +#define __ANDROID_KABI_RULE(hint, target, value) +#else #define __ANDROID_KABI_RULE(hint, target, value) \ static const char CONCATENATE(__gendwarfksyms_rule_, \ __COUNTER__)[] __used __aligned(1) \ __section(".discard.gendwarfksyms.kabi_rules") = \ "1\0" #hint "\0" target "\0" value +#endif #define _ANDROID_KABI_RULE(hint, target, value) \ __ANDROID_KABI_RULE(hint, #target, #value) @@ -66,6 +70,9 @@ __stringify(_new)); \ } +#if defined(BUILD_VDSO) || defined(__DISABLE_EXPORTS) +#define _ANDROID_KABI_REPLACE(_orig, _new) _new +#else #define _ANDROID_KABI_REPLACE(_orig, _new) \ union { \ _new; \ @@ -74,6 +81,7 @@ }; \ _ANDROID_KABI_NORMAL_SIZE_ALIGN(_orig, _new); \ } +#endif /*