authorgravatar for pat.github@tullmann.orgPat Tullmann <pat.github@tullmann.org> 2023-10-22 23:02:24-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-04 17:12:07-07:00
log2c6372a11741cee93057fe15b002735e488b7dc9
treea849ca370617a1204bc44d1433bac22d44e449c4
parentf1bd218a884e7ddca2b6c43658eebf2747adb35b

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.

1 files changed, 12 insertions(+), 0 deletions(-)

lib/libc/glibc/include/libc-symbols.h+12
......@@ -155,6 +155,18 @@
155155 extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) \
156156 __attribute_copy__ (name);
157157
158/* Zig patch. weak_hidden_alias was removed from glibc v2.36 (v2.37?), Zig
159 needs it for the v2.32 and earlier {f,l,}stat wrappers, so only include
160 in this header for 2.32 and earlier. */
161#if (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 32) || __GLIBC__ < 2
162# define weak_hidden_alias(name, aliasname) \
163 _weak_hidden_alias (name, aliasname)
164# define _weak_hidden_alias(name, aliasname) \
165 extern __typeof (name) aliasname \
166 __attribute__ ((weak, alias (#name), __visibility__ ("hidden"))) \
167 __attribute_copy__ (name);
168#endif
169
158170/* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */
159171# define weak_extern(symbol) _weak_extern (weak symbol)
160172# define _weak_extern(expr) _Pragma (#expr)