mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-09 03:08:38 +01:00
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 <aarond@fb.com> Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
parent
890699a78b
commit
2e071c3cc1
@ -31,10 +31,17 @@
|
|||||||
static const char libbsd_emit_link_warning_##symbol[] \
|
static const char libbsd_emit_link_warning_##symbol[] \
|
||||||
__attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg;
|
__attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg;
|
||||||
|
|
||||||
|
#ifdef __ELF__
|
||||||
#define libbsd_symver_default(alias, symbol, version) \
|
#define libbsd_symver_default(alias, symbol, version) \
|
||||||
__asm__(".symver " #symbol "," #alias "@@" #version)
|
__asm__(".symver " #symbol "," #alias "@@" #version)
|
||||||
|
|
||||||
#define libbsd_symver_variant(alias, symbol, version) \
|
#define libbsd_symver_variant(alias, symbol, version) \
|
||||||
__asm__(".symver " #symbol "," #alias "@" #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
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user