# Function and structure checks
#####################################################################
-AC_CHECK_FUNCS_ONCE(__xstat)
AC_CHECK_FUNCS_ONCE([open64 stat64 fopen64 __stat64_time64])
AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv])
CC_CHECK_FUNC_BUILTIN([__builtin_uaddl_overflow], [ ], [ ])
CC_CHECK_FUNC_BUILTIN([__builtin_uaddll_overflow], [ ], [ ])
-# Non glibc compilers (musl and newer versions of bionic) do not need
-# the 64 LFS API wrapping.
-AC_CHECK_DECLS_ONCE([[__GLIBC__]], [], [], [[#include <features.h>]])
-
# dietlibc doesn't have st.st_mtim struct member
AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
# basename may be only available in libgen.h with the POSIX behavior,
# not desired here
AC_CHECK_DECLS_ONCE([[basename]], [], [], [[#include <string.h>]])
+AC_CHECK_DECLS_ONCE([[__xstat]], [], [], [[#include <sys/stat.h]])
AC_MSG_CHECKING([whether _Static_assert() is supported])
AC_COMPILE_IFELSE(
################################################################################
_funcs = [
- '__xstat',
'open64', 'stat64', 'fopen64', '__stat64_time64',
'__secure_getenv', 'secure_getenv',
]
# not desired here
_decls = [
['basename', 'string.h'],
+ ['__xstat', 'sys/stat.h'],
]
foreach tuple : _decls
decl = tuple[0]
header = tuple[1]
- glibc = cc.has_header_symbol(header, decl, args : '-D_GNU_SOURCE')
+ have = cc.has_header_symbol(header, decl, args : '-D_GNU_SOURCE')
cdata.set10('HAVE_DECL_@0@'.format(decl.to_upper()), have)
endforeach
return _fn(p, flags); \
}
-/*
- * wrapper template for __xstat family
- * This family got deprecated/dropped in glibc 2.32.9000, but we still need
- * to keep it for a while for programs that were built against previous versions
- */
#define WRAP_VERSTAT(prefix, suffix) \
-TS_EXPORT int prefix ## stat ## suffix (int ver, \
- const char *path, \
- struct stat ## suffix *st); \
TS_EXPORT int prefix ## stat ## suffix (int ver, \
const char *path, \
struct stat ## suffix *st) \
WRAP_OPEN(64);
#endif
-#ifdef HAVE___XSTAT
+#if HAVE_DECL___XSTAT
WRAP_VERSTAT(__x,);
-#if HAVE_DECL___GLIBC__
WRAP_VERSTAT(__x,64);
#endif
-#endif