mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
glibc: restore "weak_hidden_alias" macro for older glibc versions
The fstat,lstat,stat,mknod stubs used to build older (before v2.33) glibc versions depend on the weak_hidden_alias macro. It was removed from the glibc libc-symbols header, so patch it back in for the older builds.
This commit is contained in:
parent
5293bdfe63
commit
d8fffee3fb
1 changed files with 12 additions and 0 deletions
12
lib/libc/glibc/include/libc-symbols.h
vendored
12
lib/libc/glibc/include/libc-symbols.h
vendored
|
|
@ -155,6 +155,18 @@
|
|||
extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) \
|
||||
__attribute_copy__ (name);
|
||||
|
||||
/* Zig patch. weak_hidden_alias was removed from glibc v2.36 (v2.37?), Zig
|
||||
needs it for the v2.32 and earlier {f,l,}stat wrappers, so only include
|
||||
in this header for 2.32 and earlier. */
|
||||
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 32) || __GLIBC__ < 2
|
||||
# define weak_hidden_alias(name, aliasname) \
|
||||
_weak_hidden_alias (name, aliasname)
|
||||
# define _weak_hidden_alias(name, aliasname) \
|
||||
extern __typeof (name) aliasname \
|
||||
__attribute__ ((weak, alias (#name), __visibility__ ("hidden"))) \
|
||||
__attribute_copy__ (name);
|
||||
#endif
|
||||
|
||||
/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
|
||||
# define weak_extern(symbol) _weak_extern (weak symbol)
|
||||
# define _weak_extern(expr) _Pragma (#expr)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue