From 2d16e3a7875a9cb5abd60713bb2e39b536a7dec4 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 28 Dec 2022 13:48:47 +0100 Subject: Fix versioned symbol aliases when used with link-time optimization --- lib/internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal.h b/lib/internal.h index ed0e94f..e9e413e 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -15,12 +15,12 @@ // optimizations is happy to optimize them away, leading to linker failures. #define VERSIONED_ABI __attribute__((used)) PCI_ABI #ifdef __APPLE__ -#define STATIC_ALIAS(_decl, _for) _decl PCI_ABI { return _for; } +#define STATIC_ALIAS(_decl, _for) _decl VERSIONED_ABI { return _for; } #define DEFINE_ALIAS(_decl, _for) #define SYMBOL_VERSION(_int, _ext) #else #define STATIC_ALIAS(_decl, _for) -#define DEFINE_ALIAS(_decl, _for) extern _decl __attribute__((alias(#_for))) +#define DEFINE_ALIAS(_decl, _for) extern _decl __attribute__((alias(#_for))) VERSIONED_ABI #ifdef _WIN32 /* GCC does not support asm .symver directive for Windows targets, so define new external global function symbol as alias to internal symbol */ #define SYMBOL_VERSION(_int, _ext) asm(".globl\t" PCI_STRINGIFY(__MINGW_USYMBOL(_ext)) "\n\t" \ -- cgit 1.2.3-korg