From 6f3aff3961a4c5ce87e05096a1a9dcf1055b7647 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 19 Jan 2023 15:35:24 +0900 Subject: [Bug #19289] Retain `ruby_abi_version` function A few extension libraries, to hide all symbols except for necessary to load, hardcode the symbols to be exported in symbol list files for linker without even checking by `have_func`. As a workaround for such libraries, retain `ruby_abi_version` symbol always even in released versions for now. --- include/ruby/internal/abi.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/ruby/internal') diff --git a/include/ruby/internal/abi.h b/include/ruby/internal/abi.h index b5ce9dc289..8e1bbf3951 100644 --- a/include/ruby/internal/abi.h +++ b/include/ruby/internal/abi.h @@ -31,6 +31,7 @@ #if defined(HAVE_FUNC_WEAK) && !defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) # define RUBY_DLN_CHECK_ABI #endif +#endif /* RUBY_ABI_VERSION */ #ifdef RUBY_DLN_CHECK_ABI @@ -41,7 +42,11 @@ extern "C" { RUBY_FUNC_EXPORTED unsigned long long __attribute__((weak)) ruby_abi_version(void) { +# ifdef RUBY_ABI_VERSION return RUBY_ABI_VERSION; +# else + return 0; +# endif } # ifdef __cplusplus @@ -51,5 +56,3 @@ ruby_abi_version(void) #endif #endif - -#endif -- cgit v1.2.1