kabi: Introduce CONFIG_KABI_RESERVE

Disable for images if kabi compatibility is explicitly not needed.

Signed-off-by: Lugang He <helugang@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
This commit is contained in:
WangYuli 2024-08-27 16:27:37 +08:00
parent 5083950054
commit efd0fdb727
2 changed files with 15 additions and 0 deletions

View File

@ -443,6 +443,7 @@
# define _DEEPIN_KABI_DEPRECATE(_type, _orig) _type deepin_reserved_##_orig
# define _DEEPIN_KABI_DEPRECATE_FN(_type, _orig, _args...) \
_type (* deepin_reserved_##_orig)(_args)
#ifdef CONFIG_DEEPIN_KABI_RESERVE
# define _DEEPIN_KABI_REPLACE(_orig, _new) \
union { \
_new; \
@ -451,6 +452,9 @@
} DEEPIN_KABI_UNIQUE_ID; \
__DEEPIN_KABI_CHECK_SIZE_ALIGN(_orig, _new); \
}
#else
# define _DEEPIN_KABI_REPLACE(_orig, _new) _new;
#endif /* CONFIG_DEEPIN_KABI_RESERVE */
# define _DEEPIN_KABI_EXCLUDE(_elem) _elem
@ -497,7 +501,11 @@
# define DEEPIN_KABI_USE_SPLIT(n, ...) DEEPIN_KABI_REPLACE_SPLIT(_DEEPIN_KABI_RESERVE(n), __VA_ARGS__)
#ifdef CONFIG_DEEPIN_KABI_RESERVE
# define _DEEPIN_KABI_RESERVE(n) unsigned long deepin_reserved##n
#else
# define _DEEPIN_KABI_RESERVE(n)
#endif /* CONFIG_DEEPIN_KABI_RESERVE */
#define DEEPIN_KABI_EXCLUDE(_elem) _DEEPIN_KABI_EXCLUDE(_elem);

View File

@ -1930,6 +1930,13 @@ config BINDGEN_VERSION_TEXT
config TRACEPOINTS
bool
config DEEPIN_KABI_RESERVE
bool "Support for KABI RESERVE"
default y
help
This option can be turned off for images that clearly do not require
kabi compatibility.
source "kernel/Kconfig.kexec"
endmenu # General setup