diff options
| author | David Lamparter <equinox@diac24.net> | 2019-06-21 14:50:56 +0200 | 
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2019-06-21 14:51:50 +0200 | 
| commit | 57d898f3eb761cc6bde97a4ff01e2d81aed3e771 (patch) | |
| tree | d6322d4d714ef74a90b3226b58ec9866fa3440b1 /lib/memory.h | |
| parent | eb7fce2eea3cd0e0360ca7de2ad2bed61ab130b0 (diff) | |
lib: fix MTYPE alias on clang
This is probably a compiler bug :/
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/memory.h')
| -rw-r--r-- | lib/memory.h | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/memory.h b/lib/memory.h index 28c3bb752f..14cd76f2f5 100644 --- a/lib/memory.h +++ b/lib/memory.h @@ -144,10 +144,11 @@ struct memgroup {  	__asm__(".equiv MTYPE_" #name ", _mt_" #name "\n\t"                    \  		".global MTYPE_" #name "\n");                                  \  	/* end */ +/* and this one's borked on clang, it drops static on aliases :/, so... asm */  #define DEFINE_MTYPE_STATIC(group, name, desc)                                 \  	DEFINE_MTYPE_ATTR(group, name, static, desc)                           \ -	static struct memtype MTYPE_##name[1]                                  \ -		__attribute__((alias("_mt_" #name)));                          \ +	extern struct memtype MTYPE_##name[1];                                 \ +	__asm__(".equiv MTYPE_" #name ", _mt_" #name "\n");                    \  	/* end */  DECLARE_MGROUP(LIB)  | 
