From de54204d2656053e5530d055468f55c2806eed69 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Thu, 26 Jun 2025 17:18:32 +0200 Subject: [PATCH] Revert "build: check for __xstat declarations" This reverts commit 0766f541927f50879599e62fdaa5a2e51b9791d3. From commit description: Currently we check the function is resolved at link time. Although what we really care is if the headers are silently transposing any of our stat calls to __xstat{,64}. If so, we'd want to wrap the latter functions. As the now-removed comment says, glibc 2.33 was the first release to no longer have static inline wrappers that do the transposition. See the glibc commit 8ed005daf0ab ("Remove stat wrapper functions, move them to exported symbols") for more details. The glibc in Leap 16.0 behaves as pre-2.33 in this respect (bsc#1240126 bsc#1221482) --- configure.ac | 6 +++++- meson.build | 4 ++-- testsuite/path.c | 12 +++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 9443268a0b50..80cd18e7d8f8 100644 --- a/configure.ac +++ b/configure.ac @@ -39,6 +39,7 @@ AC_PROG_CC_C99 # Function and structure checks ##################################################################### +AC_CHECK_FUNCS_ONCE(__xstat) AC_CHECK_FUNCS_ONCE([open64 stat64 fopen64 __stat64_time64]) AC_CHECK_FUNCS_ONCE([secure_getenv]) @@ -51,13 +52,16 @@ CC_CHECK_FUNC_BUILTIN([__builtin_umul_overflow], [ ], [ ]) CC_CHECK_FUNC_BUILTIN([__builtin_umull_overflow], [ ], [ ]) CC_CHECK_FUNC_BUILTIN([__builtin_umulll_overflow], [ ], [ ]) +# Non glibc compilers (musl and newer versions of bionic) do not need +# the 64 LFS API wrapping. +AC_CHECK_DECLS_ONCE([[__GLIBC__]], [], [], [[#include ]]) + # dietlibc doesn't have st.st_mtim struct member AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include ]) # basename may be only available in libgen.h with the POSIX behavior, # not desired here AC_CHECK_DECLS_ONCE([[basename]], [], [], [[#include ]]) -AC_CHECK_DECLS_ONCE([[__xstat]], [], [], [[#include