public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols"
@ 2020-10-22 19:03 Adhemerval Zanella
  2020-10-22 19:03 ` [PATCH 2/2] Revert "linux: Move xmknod{at} " Adhemerval Zanella
  2020-12-24 11:51 ` [PATCH 1/2] Revert "linux: Move {f}xstat{at} " Andreas Schwab
  0 siblings, 2 replies; 20+ messages in thread
From: Adhemerval Zanella @ 2020-10-22 19:03 UTC (permalink / raw)
  To: libc-alpha, Florian Weimer

This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 to
moke {f}xstat{at} default symbols.  It also only builds them for
compat mode to avoid export them for newer ABIs that supports
the stat symbol, such as riscv32.

The idea is to not force static libraries built against old glibc
to update against new glibcs (since they reference the the
{f}xstat{at} symbols).

Checked on x86_64-linux-gnu and i686-linux-gnu.
---
 sysdeps/unix/sysv/linux/alpha/fxstat64.c      | 12 +----
 sysdeps/unix/sysv/linux/alpha/fxstatat64.c    |  9 +---
 sysdeps/unix/sysv/linux/alpha/lxstat64.c      | 12 +----
 sysdeps/unix/sysv/linux/alpha/xstat64.c       | 12 +----
 sysdeps/unix/sysv/linux/fxstat.c              | 29 +++++-------
 sysdeps/unix/sysv/linux/fxstat64.c            | 34 ++++++--------
 sysdeps/unix/sysv/linux/fxstatat.c            | 23 ++++-----
 sysdeps/unix/sysv/linux/fxstatat64.c          | 31 +++++-------
 sysdeps/unix/sysv/linux/lxstat.c              | 27 +++++------
 sysdeps/unix/sysv/linux/lxstat64.c            | 47 +++++++++----------
 sysdeps/unix/sysv/linux/mips/fxstat.c         |  8 ----
 sysdeps/unix/sysv/linux/mips/lxstat.c         |  8 ----
 .../unix/sysv/linux/mips/mips64/fxstat64.c    |  8 ----
 .../unix/sysv/linux/mips/mips64/fxstatat.c    |  8 ----
 .../unix/sysv/linux/mips/mips64/fxstatat64.c  |  8 ----
 .../unix/sysv/linux/mips/mips64/lxstat64.c    |  8 ----
 sysdeps/unix/sysv/linux/mips/mips64/xstat64.c |  9 +---
 sysdeps/unix/sysv/linux/mips/xstat.c          |  8 ----
 sysdeps/unix/sysv/linux/xstat.c               | 27 +++++------
 sysdeps/unix/sysv/linux/xstat64.c             | 43 ++++++++---------
 20 files changed, 122 insertions(+), 249 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/alpha/fxstat64.c b/sysdeps/unix/sysv/linux/alpha/fxstat64.c
index bcfb55050c..9d6b8eca32 100644
--- a/sysdeps/unix/sysv/linux/alpha/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/alpha/fxstat64.c
@@ -22,11 +22,9 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
 
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __fxstat64 (int vers, int fd, struct stat64 *buf)
 {
   switch (vers)
@@ -44,12 +42,4 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
       }
     }
 }
-
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
-strong_alias (__fxstat64, __fxstat_compat)
-compat_symbol (libc, __fxstat_compat, __fxstat, GLIBC_2_0);
-#endif
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
-compat_symbol (libc, __fxstat64, __fxstat64, GLIBC_2_1);
-#endif
+strong_alias (__fxstat64, __fxstat);
diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat64.c b/sysdeps/unix/sysv/linux/alpha/fxstatat64.c
index fa3074eeca..997fb87ac6 100644
--- a/sysdeps/unix/sysv/linux/alpha/fxstatat64.c
+++ b/sysdeps/unix/sysv/linux/alpha/fxstatat64.c
@@ -22,18 +22,11 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
 {
   return INLINE_SYSCALL_CALL (fstatat64, fd, file, st, flag);
 }
-strong_alias (__fxstatat64, __fxstatat_compat)
-compat_symbol (libc, __fxstatat_compat, __fxstatat, GLIBC_2_4);
-
-compat_symbol (libc, __fxstatat64, __fxstatat64, GLIBC_2_4);
-#endif
+strong_alias (__fxstatat64, __fxstatat);
diff --git a/sysdeps/unix/sysv/linux/alpha/lxstat64.c b/sysdeps/unix/sysv/linux/alpha/lxstat64.c
index 7424b2f621..38f132f15e 100644
--- a/sysdeps/unix/sysv/linux/alpha/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/alpha/lxstat64.c
@@ -23,11 +23,9 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
 
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __lxstat64 (int vers, const char *name, struct stat64 *buf)
 {
   switch (vers)
@@ -45,12 +43,4 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
       }
     }
 }
-
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
-strong_alias (__lxstat64, __lxstat_compat)
-compat_symbol (libc, __lxstat_compat, __lxstat, GLIBC_2_0);
-#endif
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
-compat_symbol (libc, __lxstat64, __lxstat64, GLIBC_2_1);
-#endif
+weak_alias (__lxstat64, __lxstat);
diff --git a/sysdeps/unix/sysv/linux/alpha/xstat64.c b/sysdeps/unix/sysv/linux/alpha/xstat64.c
index 59f7ddae7f..c856c95dc5 100644
--- a/sysdeps/unix/sysv/linux/alpha/xstat64.c
+++ b/sysdeps/unix/sysv/linux/alpha/xstat64.c
@@ -23,11 +23,9 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
 
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __xstat64 (int vers, const char *name, struct stat64 *buf)
 {
   switch (vers)
@@ -45,12 +43,4 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
       }
     }
 }
-
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
-strong_alias (__xstat64, __xstat_compat)
-compat_symbol (libc, __xstat_compat, __xstat, GLIBC_2_0);
-#endif
-
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
-compat_symbol (libc, __xstat64, __xstat64, GLIBC_2_1);
-#endif
+weak_alias (__xstat64, __xstat);
diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c
index 649bb95252..c2c28b9096 100644
--- a/sysdeps/unix/sysv/linux/fxstat.c
+++ b/sysdeps/unix/sysv/linux/fxstat.c
@@ -20,49 +20,46 @@
 #include <fcntl.h>
 #include <kernel_stat.h>
 #include <sysdep.h>
+#include <shlib-compat.h>
 
-#if !XSTAT_IS_XSTAT64
-# include <xstatconv.h>
-# include <xstatover.h>
-# include <shlib-compat.h>
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
-# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+# if !XSTAT_IS_XSTAT64
+#  include <xstatconv.h>
+#  include <xstatover.h>
 
 /* Get information about the file FD in BUF.  */
 int
-attribute_compat_text_section
 __fxstat (int vers, int fd, struct stat *buf)
 {
   switch (vers)
     {
     case _STAT_VER_KERNEL:
       {
-# if STAT_IS_KERNEL_STAT
+#  if STAT_IS_KERNEL_STAT
 	/* New kABIs which uses generic pre 64-bit time Linux ABI,
 	   e.g. csky, nios2  */
 	int r = INLINE_SYSCALL_CALL (fstat64, fd, buf);
 	return r ?: stat_overflow (buf);
-# else
+#  else
 	/* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
 	   microblaze, s390, sh, powerpc, and sparc.  */
 	return INLINE_SYSCALL_CALL (fstat, fd, buf);
-# endif
+#  endif
       }
 
     default:
       {
-# if STAT_IS_KERNEL_STAT
+#  if STAT_IS_KERNEL_STAT
 	return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-# else
+#  else
 	struct stat64 buf64;
 	int r = INLINE_SYSCALL_CALL (fstat64, fd, &buf64);
 	return r ?: __xstat32_conv (vers, &buf64, buf);
-#endif
+# endif
       }
     }
 }
+# endif /* XSTAT_IS_XSTAT64  */
 
-compat_symbol (libc, __fxstat, __fxstat, GLIBC_2_0);
-# endif /* SHLIB_COMPAT  */
-
-#endif /* XSTAT_IS_XSTAT64  */
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)  */
diff --git a/sysdeps/unix/sysv/linux/fxstat64.c b/sysdeps/unix/sysv/linux/fxstat64.c
index 4bd926bf01..a80b3fd4a3 100644
--- a/sysdeps/unix/sysv/linux/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/fxstat64.c
@@ -27,15 +27,13 @@
 #include <shlib-compat.h>
 
 #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
-
 /* Get information about the file FD in BUF.  */
 
 int
-attribute_compat_text_section
 ___fxstat64 (int vers, int fd, struct stat64 *buf)
 {
-#if XSTAT_IS_XSTAT64
-# ifdef __NR_fstat64
+# if XSTAT_IS_XSTAT64
+#  ifdef __NR_fstat64
   /* 64-bit kABI outlier, e.g. sparc64.  */
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL_CALL (fstat, fd, buf);
@@ -45,13 +43,13 @@ ___fxstat64 (int vers, int fd, struct stat64 *buf)
       int r = INLINE_SYSCALL_CALL (fstat64, fd, &st64);
       return r ?: __xstat32_conv (vers, &st64, (struct stat *) buf);
     }
-# elif defined __NR_fstat
+#  elif defined __NR_fstat
   /* 64-bit kABI, e.g. aarch64, ia64, powerpc64*, s390x, riscv64,
      and x86_64.  */
   if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX)
     return INLINE_SYSCALL_CALL (fstat, fd, buf);
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-# else
+#  else
   /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32.  */
   struct statx tmp;
   int r = INLINE_SYSCALL_CALL (statx, fd, "", AT_EMPTY_PATH,
@@ -59,26 +57,24 @@ ___fxstat64 (int vers, int fd, struct stat64 *buf)
   if (r == 0)
     __cp_stat64_statx (buf, &tmp);
   return r;
-# endif
-#else
+#  endif
+# else
   /* All kABIs with non-LFS support, e.g. arm, csky, i386, hppa, m68k,
      microblaze, mips32, nios2, sh, powerpc32, and sparc32.  */
   return INLINE_SYSCALL_CALL (fstat64, fd, buf);
-#endif /* XSTAT_IS_XSTAT64  */
+# endif /* XSTAT_IS_XSTAT64  */
 }
 
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-compat_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2);
+# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+versioned_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2);
 strong_alias (___fxstat64, __old__fxstat64)
 compat_symbol (libc, __old__fxstat64, __fxstat64, GLIBC_2_1);
-#else
+# else
 strong_alias (___fxstat64, __fxstat64)
-compat_symbol (libc, ___fxstat64, __fxstat64, GLIBC_2_2);
-#endif
+# endif
 
-#if XSTAT_IS_XSTAT64
-strong_alias (___fxstat64, __fxstat_compat)
-compat_symbol (libc, __fxstat_compat, __fxstat, GLIBC_2_2);
-#endif
+# if XSTAT_IS_XSTAT64
+strong_alias (__fxstat64, __fxstat);
+# endif
 
-#endif /* SHLIB_COMPAT  */
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)  */
diff --git a/sysdeps/unix/sysv/linux/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c
index 2083e18eac..186d9bf7af 100644
--- a/sysdeps/unix/sysv/linux/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/fxstatat.c
@@ -20,20 +20,19 @@
 #include <fcntl.h>
 #include <kernel_stat.h>
 #include <sysdep.h>
+#include <shlib-compat.h>
 
-#if !XSTAT_IS_XSTAT64
-# include <xstatconv.h>
-# include <xstatover.h>
-# include <shlib-compat.h>
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
-# if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
+# if !XSTAT_IS_XSTAT64
+#  include <xstatconv.h>
+#  include <xstatover.h>
 
 /* Get information about the file FD in BUF.  */
 int
-attribute_compat_text_section
 __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
 {
-#if STAT_IS_KERNEL_STAT
+# if STAT_IS_KERNEL_STAT
   /* New kABIs which uses generic pre 64-bit time Linux ABI, e.g.
      csky, nios2  */
   if (vers == _STAT_VER_KERNEL)
@@ -42,16 +41,14 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
       return r ?: stat_overflow (st);
     }
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-#else
+# else
   /* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k, mips32,
      microblaze, s390, sh, powerpc32, and sparc32.  */
   struct stat64 st64;
   int r = INLINE_SYSCALL_CALL (fstatat64, fd, file, &st64, flag);
   return r ?: __xstat32_conv (vers, &st64, st);
-#endif
+# endif
 }
+# endif /* XSTAT_IS_XSTAT64  */
 
-compat_symbol (libc, __fxstatat, __fxstatat, GLIBC_2_4);
-# endif /* SHLIB_COMPAT  */
-
-#endif /* XSTAT_IS_XSTAT64  */
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)  */
diff --git a/sysdeps/unix/sysv/linux/fxstatat64.c b/sysdeps/unix/sysv/linux/fxstatat64.c
index 8a505451d9..7b214dfc14 100644
--- a/sysdeps/unix/sysv/linux/fxstatat64.c
+++ b/sysdeps/unix/sysv/linux/fxstatat64.c
@@ -26,26 +26,25 @@
 #include <statx_cp.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
-
 /* Get information about the file FD in BUF.  */
 
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+
 int
-attribute_compat_text_section
 __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
 {
-#if XSTAT_IS_XSTAT64
-# ifdef __NR_newfstatat
+# if XSTAT_IS_XSTAT64
+#  ifdef __NR_newfstatat
   /* 64-bit kABI, e.g. aarch64, ia64, powerpc64*, s390x, riscv64, and
      x86_64.  */
   if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX)
     return INLINE_SYSCALL_CALL (newfstatat, fd, file, st, flag);
-# elif defined __NR_fstatat64
+#  elif defined __NR_fstatat64
   /* 64-bit kABI outlier, e.g. sparc64.  */
   struct stat64 st64;
   int r = INLINE_SYSCALL_CALL (fstatat64, fd, file, &st64, flag);
   return r ?: __xstat32_conv (vers, &st64, (struct stat *) st);
-# else
+#  else
   /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32.  */
   if (vers == _STAT_VER_KERNEL)
     {
@@ -56,21 +55,17 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
 	__cp_stat64_statx (st, &tmp);
       return r;
     }
-# endif
-#else
+#  endif
+# else
   /* All kABIs with non-LFS support, e.g. arm, csky, i386, hppa, m68k,
      microblaze, mips32, nios2, sh, powerpc32, and sparc32.  */
   if (vers == _STAT_VER_LINUX)
     return INLINE_SYSCALL_CALL (fstatat64, fd, file, st, flag);
-#endif
+# endif
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
 }
+# if XSTAT_IS_XSTAT64
+strong_alias (__fxstatat64, __fxstatat);
+# endif
 
-compat_symbol (libc, __fxstatat64, __fxstatat64, GLIBC_2_4);
-
-#if XSTAT_IS_XSTAT64
-strong_alias (__fxstatat64, __fxstatat_compat)
-compat_symbol (libc, __fxstatat_compat, __fxstatat, GLIBC_2_4);
-#endif
-
-#endif /* SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)  */
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)  */
diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c
index 913618eab9..8d55a63057 100644
--- a/sysdeps/unix/sysv/linux/lxstat.c
+++ b/sysdeps/unix/sysv/linux/lxstat.c
@@ -22,48 +22,45 @@
 #include <sysdep.h>
 #include <shlib-compat.h>
 
-#if !XSTAT_IS_XSTAT64
-# include <xstatconv.h>
-# include <xstatover.h>
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
-# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+# if !XSTAT_IS_XSTAT64
+#  include <xstatconv.h>
+#  include <xstatover.h>
 
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __lxstat (int vers, const char *name, struct stat *buf)
 {
   switch (vers)
     {
     case _STAT_VER_KERNEL:
       {
-# if STAT_IS_KERNEL_STAT
+#  if STAT_IS_KERNEL_STAT
 	/* New kABIs which uses generic pre 64-bit time Linux ABI,
 	   e.g. csky, nios2  */
 	int r = INLINE_SYSCALL_CALL (fstatat64, AT_FDCWD, name, buf,
 				     AT_SYMLINK_NOFOLLOW);
 	return r ?: stat_overflow (buf);
-# else
+#  else
 	/* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
 	   microblaze, s390, sh, powerpc, and sparc.  */
 	return INLINE_SYSCALL_CALL (lstat, name, buf);
-# endif
+#  endif
       }
 
     default:
       {
-# if STAT_IS_KERNEL_STAT
+#  if STAT_IS_KERNEL_STAT
 	return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-# else
+#  else
 	struct stat64 buf64;
 	int r = INLINE_SYSCALL_CALL (lstat64, name, &buf64);
 	return r ?: __xstat32_conv (vers, &buf64, buf);
-#endif
+#  endif
       }
     }
 }
+# endif /* XSTAT_IS_XSTAT64  */
 
-compat_symbol (libc, __lxstat, __lxstat, GLIBC_2_0);
-# endif /* SHLIB_COMPAT  */
-
-#endif /* XSTAT_IS_XSTAT64  */
+#endif /* #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)  */
diff --git a/sysdeps/unix/sysv/linux/lxstat64.c b/sysdeps/unix/sysv/linux/lxstat64.c
index 277b54b305..3f11501c62 100644
--- a/sysdeps/unix/sysv/linux/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/lxstat64.c
@@ -26,16 +26,14 @@
 #include <statx_cp.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
-
 int
-attribute_compat_text_section
 ___lxstat64 (int vers, const char *name, struct stat64 *buf)
 {
-#if XSTAT_IS_XSTAT64
-# ifdef __NR_lstat64
+# if XSTAT_IS_XSTAT64
+#  ifdef __NR_lstat64
   /* 64-bit kABI outlier, e.g. sparc64.  */
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL_CALL (lstat, name, buf);
@@ -45,16 +43,16 @@ ___lxstat64 (int vers, const char *name, struct stat64 *buf)
       int r = INLINE_SYSCALL_CALL (lstat64, name, &st64);
       return r ?: __xstat32_conv (vers, &st64, (struct stat *) buf);
     }
-# elif defined __NR_lstat
+#  elif defined __NR_lstat
   /* Old 64-bit kABI, e.g. ia64, powerpc64*, s390x, and x86_64.  */
   if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX)
     return INLINE_SYSCALL_CALL (lstat, name, buf);
-# elif defined __NR_newfstatat
+#  elif defined __NR_newfstatat
   /* New kABIs which uses generic 64-bit Linux ABI, e.g. aarch64, riscv64.  */
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL_CALL (newfstatat, AT_FDCWD, name, buf,
 				AT_SYMLINK_NOFOLLOW);
-# else
+#  else
   /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32.  */
   if (vers == _STAT_VER_KERNEL)
     {
@@ -66,36 +64,35 @@ ___lxstat64 (int vers, const char *name, struct stat64 *buf)
 	__cp_stat64_statx (buf, &tmp);
       return r;
      }
-# endif
-#else
-# if STAT_IS_KERNEL_STAT
+#  endif
+# else
+#  if STAT_IS_KERNEL_STAT
   /* New kABIs which uses generic pre 64-bit time Linux ABI,
      e.g. csky, nios2  */
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL_CALL (fstatat64, AT_FDCWD, name, buf,
 				AT_SYMLINK_NOFOLLOW);
-# else
+#  else
   /* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
      microblaze, s390, sh, mips32, powerpc32, and sparc32.  */
   return INLINE_SYSCALL_CALL (lstat64, name, buf);
-# endif /* STAT_IS_KERNEL_STAT  */
-#endif /* XSTAT_IS_XSTAT64  */
+#  endif /* STAT_IS_KERNEL_STAT  */
+# endif /* XSTAT_IS_XSTAT64  */
 
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
 }
 
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-compat_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2);
+# if XSTAT_IS_XSTAT64
+weak_alias (___lxstat64, __lxstat);
+weak_alias (___lxstat64, __GI___lxstat);
+# endif
+
+# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+versioned_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2);
 strong_alias (___lxstat64, __old__lxstat64)
 compat_symbol (libc, __old__lxstat64, __lxstat64, GLIBC_2_1);
-#else
+# else
 strong_alias (___lxstat64, __lxstat64);
-compat_symbol (libc, ___lxstat64, __lxstat64, GLIBC_2_2);
-#endif
-
-#if XSTAT_IS_XSTAT64
-strong_alias (___lxstat64,__lxstat_compat)
-compat_symbol (libc, __lxstat_compat, __lxstat, GLIBC_2_2);
-#endif
+# endif
 
-#endif /* SHLIB_COMPAT  */
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)  */
diff --git a/sysdeps/unix/sysv/linux/mips/fxstat.c b/sysdeps/unix/sysv/linux/mips/fxstat.c
index cb9f656628..4585c2362b 100644
--- a/sysdeps/unix/sysv/linux/mips/fxstat.c
+++ b/sysdeps/unix/sysv/linux/mips/fxstat.c
@@ -21,13 +21,9 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __fxstat (int vers, int fd, struct stat *buf)
 {
   switch (vers)
@@ -43,7 +39,3 @@ __fxstat (int vers, int fd, struct stat *buf)
       }
     }
 }
-
-compat_symbol (libc, __fxstat, __fxstat, GLIBC_2_0);
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/lxstat.c b/sysdeps/unix/sysv/linux/mips/lxstat.c
index ebd05cca50..62a3b15b32 100644
--- a/sysdeps/unix/sysv/linux/mips/lxstat.c
+++ b/sysdeps/unix/sysv/linux/mips/lxstat.c
@@ -21,13 +21,9 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __lxstat (int vers, const char *name, struct stat *buf)
 {
   switch (vers)
@@ -43,7 +39,3 @@ __lxstat (int vers, const char *name, struct stat *buf)
       }
     }
 }
-
-compat_symbol (libc, __lxstat, __lxstat, GLIBC_2_0);
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
index 855c650814..e6c1cacd4b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c
@@ -20,14 +20,10 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_33)
 
 /* Get information about the file FD in BUF.  */
 
 int
-attribute_compat_text_section
 __fxstat64 (int vers, int fd, struct stat64 *buf)
 {
   struct kernel_stat kbuf;
@@ -35,7 +31,3 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
   return r ?: __xstat64_conv (vers, &kbuf, buf);
 
 }
-
-compat_symbol (libc, __fxstat64, __fxstat64, GLIBC_2_2);
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c
index 1c1fbb02c2..e384dbab8b 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat.c
@@ -21,20 +21,12 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
 
 /* Get information about the file FD in BUF.  */
 int
-attribute_compat_text_section
 __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
 {
   struct kernel_stat kst;
   int r = INLINE_SYSCALL_CALL (newfstatat, fd, file, &kst, flag);
   return r ?: __xstat_conv (vers, &kst, st);
 }
-
-compat_symbol (libc, __fxstatat, __fxstatat, GLIBC_2_4);
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
index f40a2c5aa8..cfd172d301 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c
@@ -19,14 +19,10 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
 
 int
-attribute_compat_text_section
 __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
 {
   if (vers == _STAT_VER_LINUX)
@@ -37,7 +33,3 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
     }
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
 }
-
-compat_symbol (libc, __fxstatat64, __fxstatat64, GLIBC_2_4);
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
index 752c5284a7..0f3934f8c8 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c
@@ -20,20 +20,12 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __lxstat64 (int vers, const char *name, struct stat64 *buf)
 {
   struct kernel_stat kbuf;
   int r = INLINE_SYSCALL_CALL (lstat, name, &kbuf);
   return r ?: __xstat64_conv (vers, &kbuf, buf);
 }
-
-compat_symbol (libc, __lxstat64, __lxstat64, GLIBC_2_2);
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
index a620ba2f1f..64d2952276 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
+++ b/sysdeps/unix/sysv/linux/mips/mips64/xstat64.c
@@ -20,20 +20,13 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_2, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
+
 int
-attribute_compat_text_section
 __xstat64 (int vers, const char *name, struct stat64 *buf)
 {
   struct kernel_stat kbuf;
   int r = INLINE_SYSCALL_CALL (stat, name, &kbuf);
   return r ?: __xstat64_conv (vers, &kbuf, buf);
 }
-
-compat_symbol (libc, __xstat64, __xstat64, GLIBC_2_2);
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/xstat.c b/sysdeps/unix/sysv/linux/mips/xstat.c
index 0748a3422d..d6ff5ccbe0 100644
--- a/sysdeps/unix/sysv/linux/mips/xstat.c
+++ b/sysdeps/unix/sysv/linux/mips/xstat.c
@@ -21,13 +21,9 @@
 #include <kernel_stat.h>
 #include <sysdep.h>
 #include <xstatconv.h>
-#include <shlib-compat.h>
-
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __xstat (int vers, const char *name, struct stat *buf)
 {
   switch (vers)
@@ -43,7 +39,3 @@ __xstat (int vers, const char *name, struct stat *buf)
       }
     }
 }
-
-compat_symbol (libc, __xstat, __xstat, GLIBC_2_0);
-
-#endif
diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c
index 3eb2d8c51b..8e4d9929e2 100644
--- a/sysdeps/unix/sysv/linux/xstat.c
+++ b/sysdeps/unix/sysv/linux/xstat.c
@@ -22,47 +22,44 @@
 #include <sysdep.h>
 #include <shlib-compat.h>
 
-#if !XSTAT_IS_XSTAT64
-# include <xstatconv.h>
-# include <xstatover.h>
+#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
-# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+# if !XSTAT_IS_XSTAT64
+#  include <xstatconv.h>
+#  include <xstatover.h>
 
 /* Get information about the file NAME in BUF.  */
 int
-attribute_compat_text_section
 __xstat (int vers, const char *name, struct stat *buf)
 {
   switch (vers)
     {
     case _STAT_VER_KERNEL:
       {
-# if STAT_IS_KERNEL_STAT
+#  if STAT_IS_KERNEL_STAT
 	/* New kABIs which uses generic pre 64-bit time Linux ABI,
 	   e.g. csky, nios2  */
 	int r = INLINE_SYSCALL_CALL (fstatat64, AT_FDCWD, name, buf, 0);
 	return r ?: stat_overflow (buf);
-# else
+#  else
 	/* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
 	   microblaze, s390, sh, powerpc, and sparc32.  */
 	return INLINE_SYSCALL_CALL (stat, name, buf);
-# endif
+#  endif
       }
 
     default:
       {
-# if STAT_IS_KERNEL_STAT
+#  if STAT_IS_KERNEL_STAT
 	return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-# else
+#  else
 	struct stat64 buf64;
 	int r = INLINE_SYSCALL_CALL (stat64, name, &buf64);
 	return r ?: __xstat32_conv (vers, &buf64, buf);
-#endif
+#  endif
       }
     }
 }
+# endif /* XSTAT_IS_XSTAT64  */
 
-compat_symbol (libc, __xstat, __xstat, GLIBC_2_0);
-# endif /* SHLIB_COMPAT  */
-
-#endif /* XSTAT_IS_XSTAT64  */
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33) */
diff --git a/sysdeps/unix/sysv/linux/xstat64.c b/sysdeps/unix/sysv/linux/xstat64.c
index dd4f808c7a..27d6a876e8 100644
--- a/sysdeps/unix/sysv/linux/xstat64.c
+++ b/sysdeps/unix/sysv/linux/xstat64.c
@@ -29,13 +29,11 @@
 #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
-
 int
-attribute_compat_text_section
 ___xstat64 (int vers, const char *name, struct stat64 *buf)
 {
-#if XSTAT_IS_XSTAT64
-# ifdef __NR_stat64
+# if XSTAT_IS_XSTAT64
+#  ifdef __NR_stat64
   /* 64-bit kABI outlier, e.g. sparc64.  */
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL_CALL (stat, name, buf);
@@ -45,15 +43,15 @@ ___xstat64 (int vers, const char *name, struct stat64 *buf)
       int r = INLINE_SYSCALL_CALL (stat64, name, &st64);
       return r ?: __xstat32_conv (vers, &st64, (struct stat *) buf);
     }
-# elif defined __NR_stat
+#  elif defined __NR_stat
   /* Old 64-bit kABI, e.g. ia64, powerpc64*, s390x, and x86_64.  */
   if (vers == _STAT_VER_KERNEL || vers == _STAT_VER_LINUX)
     return INLINE_SYSCALL_CALL (stat, name, buf);
-# elif defined __NR_newfstatat
+#  elif defined __NR_newfstatat
   /* New kABIs which uses generic 64-bit Linux ABI, e.g. aarch64, riscv64.  */
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL_CALL (newfstatat, AT_FDCWD, name, buf, 0);
-# else
+#  else
   /* New 32-bit kABIs with only 64-bit time_t support, e.g. arc, riscv32.  */
   if (vers == _STAT_VER_KERNEL)
     {
@@ -64,35 +62,34 @@ ___xstat64 (int vers, const char *name, struct stat64 *buf)
 	__cp_stat64_statx (buf, &tmp);
       return r;
      }
-# endif
-#else
-# if STAT_IS_KERNEL_STAT
+#  endif
+# else
+#  if STAT_IS_KERNEL_STAT
   /* New kABIs which uses generic pre 64-bit time Linux ABI,
      e.g. csky, nios2  */
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL_CALL (fstatat64, AT_FDCWD, name, buf, 0);
-# else
+#  else
   /* Old kABIs with old non-LFS support, e.g. arm, i386, hppa, m68k,
      microblaze, s390, sh, mips32, powerpc32, and sparc32.  */
   return INLINE_SYSCALL_CALL (stat64, name, buf);
-# endif /* STAT_IS_KERNEL_STAT  */
-#endif /* XSTAT_IS_XSTAT64  */
+#  endif /* STAT_IS_KERNEL_STAT  */
+# endif /* XSTAT_IS_XSTAT64  */
 
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
 }
 
-#if XSTAT_IS_XSTAT64
-strong_alias (___xstat64, __xstat_compat)
-compat_symbol (libc, __xstat_compat, __xstat, GLIBC_2_2);
-#endif
+# if XSTAT_IS_XSTAT64
+weak_alias (___xstat64, __xstat);
+weak_alias (___xstat64, __GI___xstat);
+# endif
 
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-compat_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2);
+# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
+versioned_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2);
 strong_alias (___xstat64, __old__xstat64)
 compat_symbol (libc, __old__xstat64, __xstat64, GLIBC_2_1);
-#else
+# else
 strong_alias (___xstat64, __xstat64)
-compat_symbol (libc, ___xstat64, __xstat64, GLIBC_2_2);
-#endif
+# endif
 
-#endif /* SHLIB_COMPAT  */
+#endif /* SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)  */
-- 
2.25.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-22 19:03 [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols" Adhemerval Zanella
@ 2020-10-22 19:03 ` Adhemerval Zanella
  2020-10-23 16:35   ` Florian Weimer
  2020-12-02  1:45   ` Siddhesh Poyarekar
  2020-12-24 11:51 ` [PATCH 1/2] Revert "linux: Move {f}xstat{at} " Andreas Schwab
  1 sibling, 2 replies; 20+ messages in thread
From: Adhemerval Zanella @ 2020-10-22 19:03 UTC (permalink / raw)
  To: libc-alpha, Florian Weimer

This reverts commit 81b83ff61f95f30ad53d6075247af0ea61a0b16e responsible
to make both __xmknod{at} compatible symbols.

The idea is to not force static libraries built against old glibc
to update against new glibcs (since they reference the the
xmknod{at} symbols).
---
 sysdeps/mach/hurd/xmknod.c         | 11 -----------
 sysdeps/mach/hurd/xmknodat.c       | 11 -----------
 sysdeps/unix/sysv/linux/xmknod.c   |  3 ---
 sysdeps/unix/sysv/linux/xmknodat.c |  2 --
 4 files changed, 27 deletions(-)

diff --git a/sysdeps/mach/hurd/xmknod.c b/sysdeps/mach/hurd/xmknod.c
index a1b5af086d..fa69bc3bec 100644
--- a/sysdeps/mach/hurd/xmknod.c
+++ b/sysdeps/mach/hurd/xmknod.c
@@ -17,7 +17,6 @@
 
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <shlib-compat.h>
 
 /* Create a device file named FILE_NAME, with permission and special bits MODE
    and device number DEV (which can be constructed from major and minor
@@ -28,13 +27,3 @@ __xmknod (int vers, const char *file_name, mode_t mode, dev_t *dev)
   return __xmknodat (vers, AT_FDCWD, file_name, mode, dev);
 }
 libc_hidden_def (__xmknod)
-
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
-int
-__xmknod_compat (int vers, const char *file_name, mode_t mode, dev_t *dev)
-{
-  return __xmknod (vers, file_name, mode, dev);
-}
-
-compat_symbol (libc, __xmknod_compat, __xmknod, GLIBC_2_0);
-#endif
diff --git a/sysdeps/mach/hurd/xmknodat.c b/sysdeps/mach/hurd/xmknodat.c
index 90724694d5..e46c63036e 100644
--- a/sysdeps/mach/hurd/xmknodat.c
+++ b/sysdeps/mach/hurd/xmknodat.c
@@ -26,7 +26,6 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/sysmacros.h>
-#include <shlib-compat.h>
 
 /* Create a device file named PATH relative to FD, with permission and
    special bits MODE and device number DEV (which can be constructed
@@ -118,13 +117,3 @@ __xmknodat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
   return 0;
 }
 libc_hidden_def (__xmknodat)
-
-#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
-int
-__xmknodat_compat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
-{
-  return __xmknodat (vers, fd, path, mode, dev);
-}
-
-compat_symbol (libc, __xmknodat_compat, __xmknodat, GLIBC_2_4);
-#endif
diff --git a/sysdeps/unix/sysv/linux/xmknod.c b/sysdeps/unix/sysv/linux/xmknod.c
index 82bb0bd953..f7eb104423 100644
--- a/sysdeps/unix/sysv/linux/xmknod.c
+++ b/sysdeps/unix/sysv/linux/xmknod.c
@@ -26,7 +26,6 @@
    and device number DEV (which can be constructed from major and minor
    device numbers with the `makedev' macro above).  */
 int
-attribute_compat_text_section
 __xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
 {
   if (vers != _MKNOD_VER)
@@ -34,6 +33,4 @@ __xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
 
   return __mknodat (AT_FDCWD, path, mode, *dev);
 }
-
-compat_symbol (libc, __xmknod, __xmknod, GLIBC_2_0);
 #endif
diff --git a/sysdeps/unix/sysv/linux/xmknodat.c b/sysdeps/unix/sysv/linux/xmknodat.c
index fae3fe54d1..b1a43229c8 100644
--- a/sysdeps/unix/sysv/linux/xmknodat.c
+++ b/sysdeps/unix/sysv/linux/xmknodat.c
@@ -31,6 +31,4 @@ __xmknodat (int vers, int fd, const char *file, mode_t mode, dev_t *dev)
 
   return __mknodat (fd, file, mode, *dev);
 }
-
-compat_symbol (libc, __xmknodat, __xmknodat, GLIBC_2_4);
 #endif
-- 
2.25.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-22 19:03 ` [PATCH 2/2] Revert "linux: Move xmknod{at} " Adhemerval Zanella
@ 2020-10-23 16:35   ` Florian Weimer
  2020-10-23 16:39     ` Adhemerval Zanella
  2020-12-02  1:45   ` Siddhesh Poyarekar
  1 sibling, 1 reply; 20+ messages in thread
From: Florian Weimer @ 2020-10-23 16:35 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

* Adhemerval Zanella:

> This reverts commit 81b83ff61f95f30ad53d6075247af0ea61a0b16e responsible
> to make both __xmknod{at} compatible symbols.
>
> The idea is to not force static libraries built against old glibc
> to update against new glibcs (since they reference the the
> xmknod{at} symbols).

I think it's not correct to label this as a revert in the Git sense.
At best it's a partial revert.  I tried first to verify this as an
actual revert and was wondering if I got the diffing wrong.

I think you need to remove libc_hidden_def and libc_hidden_proto around
__xmknod, __xmknodat.  “git grep 'libc_hidden.*__xmknod'” should not
return anything.  Maybe that should be a separate patch.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-23 16:35   ` Florian Weimer
@ 2020-10-23 16:39     ` Adhemerval Zanella
  2020-10-23 16:43       ` Florian Weimer
  0 siblings, 1 reply; 20+ messages in thread
From: Adhemerval Zanella @ 2020-10-23 16:39 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha



On 23/10/2020 13:35, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> This reverts commit 81b83ff61f95f30ad53d6075247af0ea61a0b16e responsible
>> to make both __xmknod{at} compatible symbols.
>>
>> The idea is to not force static libraries built against old glibc
>> to update against new glibcs (since they reference the the
>> xmknod{at} symbols).
> 
> I think it's not correct to label this as a revert in the Git sense.
> At best it's a partial revert.  I tried first to verify this as an
> actual revert and was wondering if I got the diffing wrong.

Ok, I will change to a partial remove.

> 
> I think you need to remove libc_hidden_def and libc_hidden_proto around
> __xmknod, __xmknodat.  “git grep 'libc_hidden.*__xmknod'” should not
> return anything.  Maybe that should be a separate patch.

If I recall correctly they are still required for Hurd, but I double
check.  In fact I think we should remove all the io/*xstat* and
io/*xmknod* since there is no point in providing them as generic
interfaces.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-23 16:39     ` Adhemerval Zanella
@ 2020-10-23 16:43       ` Florian Weimer
  2020-10-23 16:47         ` Adhemerval Zanella
  0 siblings, 1 reply; 20+ messages in thread
From: Florian Weimer @ 2020-10-23 16:43 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

* Adhemerval Zanella:

> On 23/10/2020 13:35, Florian Weimer wrote:
>> * Adhemerval Zanella:
>> 
>>> This reverts commit 81b83ff61f95f30ad53d6075247af0ea61a0b16e responsible
>>> to make both __xmknod{at} compatible symbols.
>>>
>>> The idea is to not force static libraries built against old glibc
>>> to update against new glibcs (since they reference the the
>>> xmknod{at} symbols).
>> 
>> I think it's not correct to label this as a revert in the Git sense.
>> At best it's a partial revert.  I tried first to verify this as an
>> actual revert and was wondering if I got the diffing wrong.
>
> Ok, I will change to a partial remove.
>
>> 
>> I think you need to remove libc_hidden_def and libc_hidden_proto around
>> __xmknod, __xmknodat.  “git grep 'libc_hidden.*__xmknod'” should not
>> return anything.  Maybe that should be a separate patch.
>
> If I recall correctly they are still required for Hurd, but I double
> check.  In fact I think we should remove all the io/*xstat* and
> io/*xmknod* since there is no point in providing them as generic
> interfaces.

Then I think you should add the missing libc_hidden_defs instead (to the
Linux implementations).  The present state is inconsistent and
potentially brittle.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-23 16:43       ` Florian Weimer
@ 2020-10-23 16:47         ` Adhemerval Zanella
  2020-10-23 17:18           ` Florian Weimer
  0 siblings, 1 reply; 20+ messages in thread
From: Adhemerval Zanella @ 2020-10-23 16:47 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha



On 23/10/2020 13:43, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 23/10/2020 13:35, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>> This reverts commit 81b83ff61f95f30ad53d6075247af0ea61a0b16e responsible
>>>> to make both __xmknod{at} compatible symbols.
>>>>
>>>> The idea is to not force static libraries built against old glibc
>>>> to update against new glibcs (since they reference the the
>>>> xmknod{at} symbols).
>>>
>>> I think it's not correct to label this as a revert in the Git sense.
>>> At best it's a partial revert.  I tried first to verify this as an
>>> actual revert and was wondering if I got the diffing wrong.
>>
>> Ok, I will change to a partial remove.
>>
>>>
>>> I think you need to remove libc_hidden_def and libc_hidden_proto around
>>> __xmknod, __xmknodat.  “git grep 'libc_hidden.*__xmknod'” should not
>>> return anything.  Maybe that should be a separate patch.
>>
>> If I recall correctly they are still required for Hurd, but I double
>> check.  In fact I think we should remove all the io/*xstat* and
>> io/*xmknod* since there is no point in providing them as generic
>> interfaces.
> 
> Then I think you should add the missing libc_hidden_defs instead (to the
> Linux implementations).  The present state is inconsistent and
> potentially brittle.

Why do we need to add the libc_hidden_defs for Linux? Currently they are not
used internally anymore (both xmknod and xmknodat will call __mknodat).

I think it would be better to check if the hidden_proto/def are stil required
for Hurd and it were to move the libc_hidden_def to a Hurd only header.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-23 16:47         ` Adhemerval Zanella
@ 2020-10-23 17:18           ` Florian Weimer
  2020-10-23 18:56             ` Adhemerval Zanella
  0 siblings, 1 reply; 20+ messages in thread
From: Florian Weimer @ 2020-10-23 17:18 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

* Adhemerval Zanella:

>>> If I recall correctly they are still required for Hurd, but I double
>>> check.  In fact I think we should remove all the io/*xstat* and
>>> io/*xmknod* since there is no point in providing them as generic
>>> interfaces.
>> 
>> Then I think you should add the missing libc_hidden_defs instead (to the
>> Linux implementations).  The present state is inconsistent and
>> potentially brittle.
>
> Why do we need to add the libc_hidden_defs for Linux? Currently they are not
> used internally anymore (both xmknod and xmknodat will call __mknodat).

I think they always have to come in pairs, conceptually.  Some pairings
work by accident.  I think the aliasing could be implemented in the
other direction, then this use case (public symbol, no internal
references) would break, but the other one (unused export, internal
references) would work.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-23 17:18           ` Florian Weimer
@ 2020-10-23 18:56             ` Adhemerval Zanella
  2020-10-26 12:56               ` Florian Weimer
  0 siblings, 1 reply; 20+ messages in thread
From: Adhemerval Zanella @ 2020-10-23 18:56 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha



On 23/10/2020 14:18, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>>>> If I recall correctly they are still required for Hurd, but I double
>>>> check.  In fact I think we should remove all the io/*xstat* and
>>>> io/*xmknod* since there is no point in providing them as generic
>>>> interfaces.
>>>
>>> Then I think you should add the missing libc_hidden_defs instead (to the
>>> Linux implementations).  The present state is inconsistent and
>>> potentially brittle.
>>
>> Why do we need to add the libc_hidden_defs for Linux? Currently they are not
>> used internally anymore (both xmknod and xmknodat will call __mknodat).
> 
> I think they always have to come in pairs, conceptually.  Some pairings
> work by accident.  I think the aliasing could be implemented in the
> other direction, then this use case (public symbol, no internal
> references) would break, but the other one (unused export, internal
> references) would work.
For this specific case, the libc_hidden_proto on include/sys/stat.h are
only defined for NO_RTLD_HIDDEN, which is only define for Hurd.  So I
don't think there is the need to add the libc_hidden_def for the Linux
implementation. 

This is also for the xstat symbols.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-23 18:56             ` Adhemerval Zanella
@ 2020-10-26 12:56               ` Florian Weimer
  2020-10-26 16:24                 ` Adhemerval Zanella
  0 siblings, 1 reply; 20+ messages in thread
From: Florian Weimer @ 2020-10-26 12:56 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

* Adhemerval Zanella:

> On 23/10/2020 14:18, Florian Weimer wrote:
>> * Adhemerval Zanella:
>> 
>>>>> If I recall correctly they are still required for Hurd, but I double
>>>>> check.  In fact I think we should remove all the io/*xstat* and
>>>>> io/*xmknod* since there is no point in providing them as generic
>>>>> interfaces.
>>>>
>>>> Then I think you should add the missing libc_hidden_defs instead (to the
>>>> Linux implementations).  The present state is inconsistent and
>>>> potentially brittle.
>>>
>>> Why do we need to add the libc_hidden_defs for Linux? Currently they are not
>>> used internally anymore (both xmknod and xmknodat will call __mknodat).
>> 
>> I think they always have to come in pairs, conceptually.  Some pairings
>> work by accident.  I think the aliasing could be implemented in the
>> other direction, then this use case (public symbol, no internal
>> references) would break, but the other one (unused export, internal
>> references) would work.

> For this specific case, the libc_hidden_proto on include/sys/stat.h are
> only defined for NO_RTLD_HIDDEN, which is only define for Hurd.  So I
> don't think there is the need to add the libc_hidden_def for the Linux
> implementation. 
>
> This is also for the xstat symbols.

Hmm.  I really don't like this.  But we can consider it separately from
the (partial) revert.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-26 12:56               ` Florian Weimer
@ 2020-10-26 16:24                 ` Adhemerval Zanella
  2020-10-26 16:30                   ` Florian Weimer
  0 siblings, 1 reply; 20+ messages in thread
From: Adhemerval Zanella @ 2020-10-26 16:24 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-alpha



On 26/10/2020 09:56, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 23/10/2020 14:18, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>>>> If I recall correctly they are still required for Hurd, but I double
>>>>>> check.  In fact I think we should remove all the io/*xstat* and
>>>>>> io/*xmknod* since there is no point in providing them as generic
>>>>>> interfaces.
>>>>>
>>>>> Then I think you should add the missing libc_hidden_defs instead (to the
>>>>> Linux implementations).  The present state is inconsistent and
>>>>> potentially brittle.
>>>>
>>>> Why do we need to add the libc_hidden_defs for Linux? Currently they are not
>>>> used internally anymore (both xmknod and xmknodat will call __mknodat).
>>>
>>> I think they always have to come in pairs, conceptually.  Some pairings
>>> work by accident.  I think the aliasing could be implemented in the
>>> other direction, then this use case (public symbol, no internal
>>> references) would break, but the other one (unused export, internal
>>> references) would work.
> 
>> For this specific case, the libc_hidden_proto on include/sys/stat.h are
>> only defined for NO_RTLD_HIDDEN, which is only define for Hurd.  So I
>> don't think there is the need to add the libc_hidden_def for the Linux
>> implementation. 
>>
>> This is also for the xstat symbols.
> 
> Hmm.  I really don't like this.  But we can consider it separately from
> the (partial) revert.

Could we track this with a different patch? I would like to close this
and the xstat issue.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-26 16:24                 ` Adhemerval Zanella
@ 2020-10-26 16:30                   ` Florian Weimer
  0 siblings, 0 replies; 20+ messages in thread
From: Florian Weimer @ 2020-10-26 16:30 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha

* Adhemerval Zanella:

> On 26/10/2020 09:56, Florian Weimer wrote:
>> * Adhemerval Zanella:
>> 
>>> On 23/10/2020 14:18, Florian Weimer wrote:
>>>> * Adhemerval Zanella:
>>>>
>>>>>>> If I recall correctly they are still required for Hurd, but I double
>>>>>>> check.  In fact I think we should remove all the io/*xstat* and
>>>>>>> io/*xmknod* since there is no point in providing them as generic
>>>>>>> interfaces.
>>>>>>
>>>>>> Then I think you should add the missing libc_hidden_defs instead (to the
>>>>>> Linux implementations).  The present state is inconsistent and
>>>>>> potentially brittle.
>>>>>
>>>>> Why do we need to add the libc_hidden_defs for Linux? Currently they are not
>>>>> used internally anymore (both xmknod and xmknodat will call __mknodat).
>>>>
>>>> I think they always have to come in pairs, conceptually.  Some pairings
>>>> work by accident.  I think the aliasing could be implemented in the
>>>> other direction, then this use case (public symbol, no internal
>>>> references) would break, but the other one (unused export, internal
>>>> references) would work.
>> 
>>> For this specific case, the libc_hidden_proto on include/sys/stat.h are
>>> only defined for NO_RTLD_HIDDEN, which is only define for Hurd.  So I
>>> don't think there is the need to add the libc_hidden_def for the Linux
>>> implementation. 
>>>
>>> This is also for the xstat symbols.
>> 
>> Hmm.  I really don't like this.  But we can consider it separately from
>> the (partial) revert.
>
> Could we track this with a different patch?

Yes, that's what I meant.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-10-22 19:03 ` [PATCH 2/2] Revert "linux: Move xmknod{at} " Adhemerval Zanella
  2020-10-23 16:35   ` Florian Weimer
@ 2020-12-02  1:45   ` Siddhesh Poyarekar
  2020-12-02 11:32     ` Adhemerval Zanella
  1 sibling, 1 reply; 20+ messages in thread
From: Siddhesh Poyarekar @ 2020-12-02  1:45 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha, Florian Weimer

On 10/23/20 12:33 AM, Adhemerval Zanella via Libc-alpha wrote:
> This reverts commit 81b83ff61f95f30ad53d6075247af0ea61a0b16e responsible
> to make both __xmknod{at} compatible symbols.
> 
> The idea is to not force static libraries built against old glibc
> to update against new glibcs (since they reference the the
> xmknod{at} symbols).

Hi Adhemerval,

If you haven't already (I couldn't find it) could you please push this 
set?  AFAICT from Florian's comments he's OK with the patch and the 
hidden symbols could be a separate change.

Thanks,
Siddhesh

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/2] Revert "linux: Move xmknod{at} to compat symbols"
  2020-12-02  1:45   ` Siddhesh Poyarekar
@ 2020-12-02 11:32     ` Adhemerval Zanella
  0 siblings, 0 replies; 20+ messages in thread
From: Adhemerval Zanella @ 2020-12-02 11:32 UTC (permalink / raw)
  To: Siddhesh Poyarekar, libc-alpha, Florian Weimer



On 01/12/2020 22:45, Siddhesh Poyarekar wrote:
> On 10/23/20 12:33 AM, Adhemerval Zanella via Libc-alpha wrote:
>> This reverts commit 81b83ff61f95f30ad53d6075247af0ea61a0b16e responsible
>> to make both __xmknod{at} compatible symbols.
>>
>> The idea is to not force static libraries built against old glibc
>> to update against new glibcs (since they reference the the
>> xmknod{at} symbols).
> 
> Hi Adhemerval,
> 
> If you haven't already (I couldn't find it) could you please push this set?  AFAICT from Florian's comments he's OK with the patch and the hidden symbols could be a separate change.

Alright, I will push both reverts, thanks.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols"
  2020-10-22 19:03 [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols" Adhemerval Zanella
  2020-10-22 19:03 ` [PATCH 2/2] Revert "linux: Move xmknod{at} " Adhemerval Zanella
@ 2020-12-24 11:51 ` Andreas Schwab
  2020-12-24 12:11   ` Florian Weimer
  1 sibling, 1 reply; 20+ messages in thread
From: Andreas Schwab @ 2020-12-24 11:51 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha; +Cc: Florian Weimer, Adhemerval Zanella

On Okt 22 2020, Adhemerval Zanella via Libc-alpha wrote:

> This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 to
> moke {f}xstat{at} default symbols.

That still doesn't work, __fxstat64 is missing from the static libc.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols"
  2020-12-24 11:51 ` [PATCH 1/2] Revert "linux: Move {f}xstat{at} " Andreas Schwab
@ 2020-12-24 12:11   ` Florian Weimer
  2020-12-24 12:32     ` Andreas Schwab
  0 siblings, 1 reply; 20+ messages in thread
From: Florian Weimer @ 2020-12-24 12:11 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Adhemerval Zanella via Libc-alpha

* Andreas Schwab:

> On Okt 22 2020, Adhemerval Zanella via Libc-alpha wrote:
>
>> This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 to
>> moke {f}xstat{at} default symbols.

How does this present itself as a problem?

Building against an older glibc for static linking against a future
glibc seems a rather fringe use case to me.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols"
  2020-12-24 12:11   ` Florian Weimer
@ 2020-12-24 12:32     ` Andreas Schwab
  2020-12-24 13:11       ` Adhemerval Zanella
  2020-12-24 14:28       ` Florian Weimer
  0 siblings, 2 replies; 20+ messages in thread
From: Andreas Schwab @ 2020-12-24 12:32 UTC (permalink / raw)
  To: Florian Weimer; +Cc: Adhemerval Zanella via Libc-alpha

On Dez 24 2020, Florian Weimer wrote:

> * Andreas Schwab:
>
>> On Okt 22 2020, Adhemerval Zanella via Libc-alpha wrote:
>>
>>> This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 to
>>> moke {f}xstat{at} default symbols.
>
> How does this present itself as a problem?

configure:3190: checking whether g++ can link programs
configure:3213: g++ -o conftest -g -O2   conftest.cpp  >&5
configure:3213: $? = 0
configure:3236: g++ -o conftest -g -O2   -static conftest.cpp  >&5
/usr/lib/gcc/i586-suse-linux/10/../../../../i586-suse-linux/bin/ld: /usr/lib/gc\
c/i586-suse-linux/10/libstdc++.a(basic_file.o): in function `std::__basic_file<\
char>::showmanyc()':
/usr/include/sys/stat.h:518: undefined reference to `__fxstat64'
collect2: error: ld returned 1 exit status

> Building against an older glibc for static linking against a future
> glibc seems a rather fringe use case to me.

That basically means you have to rebuild the world, due to the ubiquity
of stat etc.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols"
  2020-12-24 12:32     ` Andreas Schwab
@ 2020-12-24 13:11       ` Adhemerval Zanella
  2020-12-24 14:28       ` Florian Weimer
  1 sibling, 0 replies; 20+ messages in thread
From: Adhemerval Zanella @ 2020-12-24 13:11 UTC (permalink / raw)
  To: libc-alpha



On 24/12/2020 09:32, Andreas Schwab wrote:
> On Dez 24 2020, Florian Weimer wrote:
> 
>> * Andreas Schwab:
>>
>>> On Okt 22 2020, Adhemerval Zanella via Libc-alpha wrote:
>>>
>>>> This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 to
>>>> moke {f}xstat{at} default symbols.
>>
>> How does this present itself as a problem?
> 
> configure:3190: checking whether g++ can link programs
> configure:3213: g++ -o conftest -g -O2   conftest.cpp  >&5
> configure:3213: $? = 0
> configure:3236: g++ -o conftest -g -O2   -static conftest.cpp  >&5
> /usr/lib/gcc/i586-suse-linux/10/../../../../i586-suse-linux/bin/ld: /usr/lib/gc\
> c/i586-suse-linux/10/libstdc++.a(basic_file.o): in function `std::__basic_file<\
> char>::showmanyc()':
> /usr/include/sys/stat.h:518: undefined reference to `__fxstat64'
> collect2: error: ld returned 1 exit status
> 
>> Building against an older glibc for static linking against a future
>> glibc seems a rather fringe use case to me.
> 
> That basically means you have to rebuild the world, due to the ubiquity
> of stat etc.

Right, I think it would be safe for 2.33 to still keep providing the xstat
symbols for static.  I will send a patch.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols"
  2020-12-24 12:32     ` Andreas Schwab
  2020-12-24 13:11       ` Adhemerval Zanella
@ 2020-12-24 14:28       ` Florian Weimer
  2020-12-24 14:48         ` Adhemerval Zanella
  1 sibling, 1 reply; 20+ messages in thread
From: Florian Weimer @ 2020-12-24 14:28 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Adhemerval Zanella via Libc-alpha

* Andreas Schwab:

> On Dez 24 2020, Florian Weimer wrote:
>
>> * Andreas Schwab:
>>
>>> On Okt 22 2020, Adhemerval Zanella via Libc-alpha wrote:
>>>
>>>> This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 to
>>>> moke {f}xstat{at} default symbols.
>>
>> How does this present itself as a problem?
>
> configure:3190: checking whether g++ can link programs
> configure:3213: g++ -o conftest -g -O2   conftest.cpp  >&5
> configure:3213: $? = 0
> configure:3236: g++ -o conftest -g -O2   -static conftest.cpp  >&5
> /usr/lib/gcc/i586-suse-linux/10/../../../../i586-suse-linux/bin/ld: /usr/lib/gc\
> c/i586-suse-linux/10/libstdc++.a(basic_file.o): in function `std::__basic_file<\
> char>::showmanyc()':
> /usr/include/sys/stat.h:518: undefined reference to `__fxstat64'
> collect2: error: ld returned 1 exit status

Is this our g++ linker test?

Testing static linking against libstdc++ is somewhat unusual.

>> Building against an older glibc for static linking against a future
>> glibc seems a rather fringe use case to me.
>
> That basically means you have to rebuild the world, due to the ubiquity
> of stat etc.

Is static linking really that prevalent?

But I had not considered the libstdc++ case.  So maybe we need to
preserve these symbols for a while, even for static linking.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols"
  2020-12-24 14:28       ` Florian Weimer
@ 2020-12-24 14:48         ` Adhemerval Zanella
  2020-12-24 15:21           ` Florian Weimer
  0 siblings, 1 reply; 20+ messages in thread
From: Adhemerval Zanella @ 2020-12-24 14:48 UTC (permalink / raw)
  To: Florian Weimer, Andreas Schwab; +Cc: Adhemerval Zanella via Libc-alpha



On 24/12/2020 11:28, Florian Weimer wrote:
> * Andreas Schwab:
> 
>> On Dez 24 2020, Florian Weimer wrote:
>>
>>> * Andreas Schwab:
>>>
>>>> On Okt 22 2020, Adhemerval Zanella via Libc-alpha wrote:
>>>>
>>>>> This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 to
>>>>> moke {f}xstat{at} default symbols.
>>>
>>> How does this present itself as a problem?
>>
>> configure:3190: checking whether g++ can link programs
>> configure:3213: g++ -o conftest -g -O2   conftest.cpp  >&5
>> configure:3213: $? = 0
>> configure:3236: g++ -o conftest -g -O2   -static conftest.cpp  >&5
>> /usr/lib/gcc/i586-suse-linux/10/../../../../i586-suse-linux/bin/ld: /usr/lib/gc\
>> c/i586-suse-linux/10/libstdc++.a(basic_file.o): in function `std::__basic_file<\
>> char>::showmanyc()':
>> /usr/include/sys/stat.h:518: undefined reference to `__fxstat64'
>> collect2: error: ld returned 1 exit status
> 
> Is this our g++ linker test?
> 
> Testing static linking against libstdc++ is somewhat unusual.
> 
>>> Building against an older glibc for static linking against a future
>>> glibc seems a rather fringe use case to me.
>>
>> That basically means you have to rebuild the world, due to the ubiquity
>> of stat etc.
> 
> Is static linking really that prevalent?
> 
> But I had not considered the libstdc++ case.  So maybe we need to
> preserve these symbols for a while, even for static linking.
> 

I saw this issue when making the patch for riscv32, where the old toolchain
libstdc++ was configured to use the xstat symbols (I had to bootstrap the
toolchain).

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols"
  2020-12-24 14:48         ` Adhemerval Zanella
@ 2020-12-24 15:21           ` Florian Weimer
  0 siblings, 0 replies; 20+ messages in thread
From: Florian Weimer @ 2020-12-24 15:21 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha; +Cc: Andreas Schwab, Adhemerval Zanella

* Adhemerval Zanella via Libc-alpha:

> I saw this issue when making the patch for riscv32, where the old toolchain
> libstdc++ was configured to use the xstat symbols (I had to bootstrap the
> toolchain).

Independently of the present issue, we should probably make the C++
configure tests in glibc more fine-grained, so that most C++ tests
will work even if statically linking libstdc++ fails.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-12-24 15:21 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22 19:03 [PATCH 1/2] Revert "linux: Move {f}xstat{at} to compat symbols" Adhemerval Zanella
2020-10-22 19:03 ` [PATCH 2/2] Revert "linux: Move xmknod{at} " Adhemerval Zanella
2020-10-23 16:35   ` Florian Weimer
2020-10-23 16:39     ` Adhemerval Zanella
2020-10-23 16:43       ` Florian Weimer
2020-10-23 16:47         ` Adhemerval Zanella
2020-10-23 17:18           ` Florian Weimer
2020-10-23 18:56             ` Adhemerval Zanella
2020-10-26 12:56               ` Florian Weimer
2020-10-26 16:24                 ` Adhemerval Zanella
2020-10-26 16:30                   ` Florian Weimer
2020-12-02  1:45   ` Siddhesh Poyarekar
2020-12-02 11:32     ` Adhemerval Zanella
2020-12-24 11:51 ` [PATCH 1/2] Revert "linux: Move {f}xstat{at} " Andreas Schwab
2020-12-24 12:11   ` Florian Weimer
2020-12-24 12:32     ` Andreas Schwab
2020-12-24 13:11       ` Adhemerval Zanella
2020-12-24 14:28       ` Florian Weimer
2020-12-24 14:48         ` Adhemerval Zanella
2020-12-24 15:21           ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).