From 2e071c3cc152ec55db7b87248fdc017a0f735302 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 6 Aug 2019 19:14:29 +0200 Subject: [PATCH] build: Support platforms without symbol versioning The .symver directive is ELF-specific. On non-ELF platforms, work around this with __attribute__((__alias__)) for the default symbol, and ignore the variant versioned symbols. Based-on-patch-by: Aaron Dierking Signed-off-by: Guillem Jover --- src/local-link.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/local-link.h b/src/local-link.h index 5a17bfe..0d4351a 100644 --- a/src/local-link.h +++ b/src/local-link.h @@ -31,10 +31,17 @@ static const char libbsd_emit_link_warning_##symbol[] \ __attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg; +#ifdef __ELF__ #define libbsd_symver_default(alias, symbol, version) \ __asm__(".symver " #symbol "," #alias "@@" #version) #define libbsd_symver_variant(alias, symbol, version) \ __asm__(".symver " #symbol "," #alias "@" #version) +#else +#define libbsd_symver_default(alias, symbol, version) \ + extern __typeof(symbol) alias __attribute__((__alias__(#symbol))) + +#define libbsd_symver_variant(alias, symbol, version) +#endif #endif