Re: [PATCH v2] io: fix ftw ABI on MIPS n64
"Andreas K. Huettel" <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Organization | Gentoo Linux |
| Message-ID | <[email protected]> |
Am Mittwoch, 22. Juli 2026, 04:58:36 Japanische Normalzeit schrieb Xi Ruoyao: > On MIPS n64 off_t is same as off64_t, but struct stat is not same as > struct stat64 (very peculiar but see the "as tempting as it..." comment > in linux/mips/kernel_stat.h). As the ftw/ftw64 callback accepts a > pointer to a function who accepts struct stat/stat64, for MIPS n64 we > must use different implementations for ftw and ftw64. > > Thus for testing if ftw64 can be aliased to ftw, we should check > XSTAT_IS_XSTAT64 instead of __OFF_T_MATCHES_OFF64_T. > > This resolves the io/tst-ftw-lnk failure observed on MIPS n64. OK, this solves a real problem. As such we can still add it, assuming you get an R-B soon. Since the patch touches non-arch-specific code, however simple, I'd then wait with the release for a few days to allow for more testing all around. We do have a buffer until 1/August, luckily. > > Link: https://sourceware.org/glibc/wiki/Testing/Tests/io/tst-ftw-lnk > Signed-off-by: Xi Ruoyao <[email protected]> > --- > > Tested on x86_64-linux and mips64-linux. No new failures were found, > and the aliasing of ftw ftw64 is as expected. On x86_64: > > $ objdump -t libc.so.6 | grep ' ftw(64)?$' -E > 00000000001094e0 w F .text 000000000000000f ftw > 00000000001094e0 w F .text 000000000000000f ftw64 > > On mips64: > $ objdump -t libc.so.6 | grep ' ftw(64)?$' -E > 000000000013a908 g F .text 0000000000000028 ftw > 000000000013bff0 w F .text 0000000000000028 ftw64 > > io/ftw.c | 4 ++-- > io/ftw64.c | 3 ++- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/io/ftw.c b/io/ftw.c > index ed0eeb3904..c759701372 100644 > --- a/io/ftw.c > +++ b/io/ftw.c > @@ -16,9 +16,9 @@ > License along with the GNU C Library; if not, see > <https://www.gnu.org/licenses/>. */ > > -#include <sys/types.h> > +#include <kernel_stat.h> > > -#ifndef __OFF_T_MATCHES_OFF64_T > +#if !XSTAT_IS_XSTAT64 > # include "ftw-common.c" > > versioned_symbol (libc, __new_nftw, nftw, GLIBC_2_3_3); > diff --git a/io/ftw64.c b/io/ftw64.c > index d3cd14c21a..fc36f97e7e 100644 > --- a/io/ftw64.c > +++ b/io/ftw64.c > @@ -31,6 +31,7 @@ > #define ftw __rename_ftw > #define nftw __rename_nftw > > +#include <kernel_stat.h> > #include <shlib-compat.h> > #include "ftw-common.c" > > @@ -44,7 +45,7 @@ versioned_symbol (libc, __new_nftw64, nftw64, GLIBC_2_3_3); > compat_symbol (libc, __old_nftw64, nftw64, GLIBC_2_1); > #endif > > -#ifdef __OFF_T_MATCHES_OFF64_T > +#if XSTAT_IS_XSTAT64 > weak_alias (__ftw64, ftw) > versioned_symbol (libc, __new_nftw64, nftw, GLIBC_2_3_3); > # if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_3_3) > -- PD Dr. Andreas K. Hüttel [email protected] Gentoo Linux developer (council, comrel, toolchain, base-system, perl, libreoffice) https://wiki.gentoo.org/wiki/User:Dilfridge
signature.asc
(application/pgp-signature, 870 B)
-----BEGIN PGP SIGNATURE----- iQJPBAABCAA5FiEE/Rnm0xsZLuTcY+rT3CsWIV7VQSoFAmpgjV4bFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyAAoJENwrFiFe1UEqmPMP/RvTRPZYr048CRy+EbMV I5Awpua5sOw/svEGO9qvy8FoWA6mg697v+xrA+Kdm55LcQZlF5ccgYD97TPUo6sB YhSj7q7XR8FT+R7hYbWW8/ivdcpSqF5eXfo7srcO7wC4bo0osAl/cKTi/nTK4u0c xL3T5Kt+8ArDcBwFeA3g3BVk9mCKmSKeWH6nnuPZAo/4THTHb3DKaVv42WGhhzT3 22XBo2N8kRl4+mvCScrOUQBDilrfv1U1Ky0Uxt8uUUEJYdNl51QMbT3GJA+Nf4HL 4oXMNvg2eQ23ZbelFul6qcGlduZwQ7HOUz7gRGdEjKvYSxpbc1vaYFxKz4RgWDyG JmKrc9654xN+ALvwR1nukm0Aw8jAJvaPVM2br0aT+4FgviXN7zQFyf+KE4jmEPK2 e/o66hFQVBKjO37LDLud8RD1cAE11h/ZIiGzyEs5CcTfhOwp5F0H0Ez9jvl+2MRo y+YfUTmi0JVQBGRMIUQgJNT0LHuNWBA99XPaE76QMdqjWyP3Us+JllqEtjDZeF0+ 0u7qrlWtSd+nWVEnnKuWdJk1JQNNg2yIosqIU92eTje2aojLueVGxlWqRVkwEPTX thGiLYbYSCx5dPig53cQKZ0MsrHW2diJruDAwehSf/ZTH585Wsb9RdgToz/BzktM nlkMDaK61bCyNdBcYVLgMSEA =wu6t -----END PGP SIGNATURE-----