]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Revert "linux: Move {f}xstat{at} to compat symbols" for static build
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 29 Dec 2020 13:21:29 +0000 (13:21 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 21 Jan 2021 17:11:53 +0000 (14:11 -0300)
This reverts commit 20b39d59467b0c1d858e89ded8b0cebe55e22f60 for static
library.  This avoids the need to rebuild the world for the case where
libstdc++ (and potentially other libraries) are linked to a old glibc.

To avoid requering to provide xstat symbols for newer ABIs (such as
riscv32) a new LIB_COMPAT macro is added.  It is similar to SHLIB_COMPAT
but also works for static case (thus evaluating similar to SHLIB_COMPAT
for both shared and static case).

Checked with a check-abi on all affected ABIs. I also check if the
static library does contains the xstat symbols.

17 files changed:
include/shlib-compat.h
sysdeps/mach/hurd/fxstat.c
sysdeps/mach/hurd/fxstat64.c
sysdeps/mach/hurd/fxstatat.c
sysdeps/mach/hurd/fxstatat64.c
sysdeps/mach/hurd/lxstat.c
sysdeps/mach/hurd/lxstat64.c
sysdeps/mach/hurd/xstat.c
sysdeps/mach/hurd/xstat64.c
sysdeps/unix/sysv/linux/fxstat.c
sysdeps/unix/sysv/linux/fxstat64.c
sysdeps/unix/sysv/linux/fxstatat.c
sysdeps/unix/sysv/linux/fxstatat64.c
sysdeps/unix/sysv/linux/lxstat.c
sysdeps/unix/sysv/linux/lxstat64.c
sysdeps/unix/sysv/linux/xstat.c
sysdeps/unix/sysv/linux/xstat64.c

index 43583bbe2ef3b0ddfc6ac22b5067f20923c7b21d..28baef1ea42731f8b72ab08999658abf530e03aa 100644 (file)
@@ -21,8 +21,6 @@
 
 # include <abi-versions.h>
 
-#ifdef SHARED
-
 /* The file abi-versions.h (generated by scripts/abi-versions.awk) defines
    symbols like `ABI_libm_GLIBC_2_0' for each version set in the source
    code for each library.  For a version set that is subsumed by a later
    when the two version sets named are in fact two different ABIs we are
    supporting.  If these do not differ, then there is no need to compile in
    extra code to support this version set where it has been superseded by a
-   newer version.  The compatibility code should be conditionalized with
-   e.g. `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced
-   in the GLIBC_2.0 version and obsoleted in the GLIBC_2.2 version.  */
-
-# define SHLIB_COMPAT(lib, introduced, obsoleted)                            \
-  _SHLIB_COMPAT (lib, introduced, obsoleted)
-# define _SHLIB_COMPAT(lib, introduced, obsoleted)                           \
+   newer version.  */
+#define LIB_COMPAT(lib, introduced, obsoleted)                               \
+  _LIB_COMPAT (lib, introduced, obsoleted)
+#define _LIB_COMPAT(lib, introduced, obsoleted)                                      \
   (IS_IN (lib)                                                               \
    && (!(ABI_##lib##_##obsoleted - 0)                                        \
        || ((ABI_##lib##_##introduced - 0) < (ABI_##lib##_##obsoleted - 0))))
 
+#ifdef SHARED
+
+/* Similar to LIB_COMPAT, but evaluate to 0 for static build.  The
+   compatibility code should be conditionalized with e.g.
+   `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced
+   in the GLIBC_2.0 version and obsoleted in the GLIBC_2.2 version.  */
+
+# define SHLIB_COMPAT(lib, introduced, obsoleted)                            \
+  _LIB_COMPAT (lib, introduced, obsoleted)
+
 /* That header also defines symbols like `VERSION_libm_GLIBC_2_1' to
    the version set name to use for e.g. symbols first introduced into
    libm in the GLIBC_2.1 version.  Definitions of symbols with explicit
index 8568d0d593ea734e0b64d3fbdab9cd1e7f51114a..fff521fa2910e1e58320d4a8e4cf2ab3316bb2e6 100644 (file)
@@ -21,7 +21,7 @@
 #include <hurd.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file descriptor FD in BUF.  */
 int
@@ -34,4 +34,4 @@ __fxstat (int vers, int fd, struct stat *buf)
 }
 weak_alias (__fxstat, _fxstat)
 
-#endif
+#endif /* LIB_COMPAT  */
index cb5161fdc938082290888cb0914d3abe28ef3d87..c116655f6934324bae8e7350be89fa7959601ffd 100644 (file)
@@ -21,7 +21,7 @@
 #include <hurd.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
 
 /* Get information about the file descriptor FD in BUF.  */
 int
index 825e080b180271675ee6594a6dab118e34d86808..995b0ad9227d77b64e32dae7db4e05dc01db1fd5 100644 (file)
@@ -22,7 +22,7 @@
 #include <hurd.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
 
 int
 __fxstatat (int vers, int fd, const char *filename, struct stat *buf, int flag)
@@ -32,5 +32,4 @@ __fxstatat (int vers, int fd, const char *filename, struct stat *buf, int flag)
 
   return __fstatat (fd, filename, buf, flag);
 }
-
 #endif
index c787f98784c90cead03f56b19af08a3106b5f021..f24e272041c1f42d8b181e7a0a437c9825a77fd9 100644 (file)
@@ -23,7 +23,7 @@
 #include <hurd.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
 
 /* Get information about the file descriptor FD in BUF.  */
 int
@@ -35,5 +35,4 @@ __fxstatat64 (int vers, int fd, const char *filename, struct stat64 *buf,
 
   return __fstatat64 (fd, filename, buf, flag);
 }
-
 #endif
index 440c0ef778051c92081adf6ad4432b6d2b50dcad..b9ad6b46dabe67a3d13ab1764c46f86357e44f24 100644 (file)
@@ -21,7 +21,7 @@
 #include <hurd.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 int
 __lxstat (int vers, const char *file, struct stat *buf)
index 2ee81ecf21b24c6dec46340c096e6fa42fc9959a..2b8f2abc2668cd28bee5a6d02e89fb1ed14ab51e 100644 (file)
@@ -22,7 +22,7 @@
 #include <hurd.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
 
 /* Get information about the file descriptor FD in BUF.  */
 int
@@ -33,5 +33,4 @@ __lxstat64 (int vers, const char *file, struct stat64 *buf)
 
   return __lstat64 (file, buf);
 }
-
 #endif
index fe52d297e397ba0ea1569b38a2c08d6a998b971a..3c36f989191cd1566034f8980e4f9776c335284d 100644 (file)
@@ -20,7 +20,7 @@
 #include <hurd.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get file information about FILE in BUF.  */
 int
index 7a68d6a1f589b2bafadc052a96fc6c55ffe82b72..dd1c6c38eb902a0c6bd6acb9eb53f20bf08cc63f 100644 (file)
@@ -21,7 +21,7 @@
 #include <hurd.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
 
 /* Get information about the file descriptor FD in BUF.  */
 int
index 216ec7d19acf77a2f4ee9e8238a16a4288dd2731..f3917e3609c3b3b0739d3b1e305a8c9e1512fef6 100644 (file)
@@ -26,7 +26,7 @@
 # include <xstatover.h>
 # include <shlib-compat.h>
 
-# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+# if LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file FD in BUF.  */
 int
@@ -61,6 +61,6 @@ __fxstat (int vers, int fd, struct stat *buf)
     }
 }
 
-# endif /* SHLIB_COMPAT  */
+# endif /* LIB_COMPAT  */
 
 #endif /* XSTAT_IS_XSTAT64  */
index ede7ac0f57e29e6e4f7a902d89fc30836e5e63a6..be1279827307a3311a969d3304a6e0cecf989866 100644 (file)
@@ -26,7 +26,7 @@
 #include <statx_cp.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file FD in BUF.  */
 
@@ -78,4 +78,4 @@ strong_alias (___fxstat64, __fxstat64)
 strong_alias (___fxstat64, __fxstat)
 #endif
 
-#endif /* SHLIB_COMPAT  */
+#endif /* LIB_COMPAT  */
index 7217bbdc4f5c9e1eae9ee75ae05d8c403de11a34..853328d053bb0f32fcd5a3da2acf75ae244a705a 100644 (file)
@@ -26,7 +26,7 @@
 # include <xstatover.h>
 # include <shlib-compat.h>
 
-# if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
+# if LIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
 
 /* Get information about the file FD in BUF.  */
 int
@@ -50,6 +50,6 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
 #endif
 }
 
-# endif /* SHLIB_COMPAT  */
+# endif /* LIB_COMPAT  */
 
 #endif /* XSTAT_IS_XSTAT64  */
index 71cc593e5bfc4376b402b723e9feb2a30077b715..f442bff6241d43a386fb31b0042c032fc2df406c 100644 (file)
@@ -26,7 +26,7 @@
 #include <statx_cp.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)
 
 /* Get information about the file FD in BUF.  */
 
@@ -69,4 +69,4 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
 strong_alias (__fxstatat64, __fxstatat)
 #endif
 
-#endif /* SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)  */
+#endif /* LIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33)  */
index e9833e7c9504862da94c7f92b63dfbde37e153c9..7a644dc51967fec66c1bf5a02d9a8e18e26ad6ac 100644 (file)
@@ -26,7 +26,7 @@
 # include <xstatconv.h>
 # include <xstatover.h>
 
-# if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+# if LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
 int
index e2415f4fa2defccbc9e14ad9bb203515aeb24813..37c70bac27455ea6aeb05e2812e5d1a73b9be05a 100644 (file)
@@ -26,7 +26,7 @@
 #include <statx_cp.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
 
@@ -95,4 +95,4 @@ strong_alias (___lxstat64, __lxstat64);
 strong_alias (___lxstat64,__lxstat)
 #endif
 
-#endif /* SHLIB_COMPAT  */
+#endif /* LIB_COMPAT  */
index 60d8323580c7704d93134006d9904d651136cacc..4ee083514a14f47028e8ab77e03044652630969c 100644 (file)
 #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 LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
 int
@@ -61,6 +61,6 @@ __xstat (int vers, const char *name, struct stat *buf)
     }
 }
 
-# endif /* SHLIB_COMPAT  */
+# endif /* LIB_COMPAT  */
 
 #endif /* XSTAT_IS_XSTAT64  */
index b75a0fa26b2fe9d9f94c6068e6240a0d3f4c0711..36947ed128d8dc51161f9280fd557359e94bd7b7 100644 (file)
@@ -26,7 +26,7 @@
 #include <statx_cp.h>
 #include <shlib-compat.h>
 
-#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
+#if LIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_33)
 
 /* Get information about the file NAME in BUF.  */
 
@@ -92,4 +92,5 @@ compat_symbol (libc, __old__xstat64, __xstat64, GLIBC_2_1);
 strong_alias (___xstat64, __xstat64)
 #endif
 
-#endif /* SHLIB_COMPAT  */
+
+#endif /* LIB_COMPAT  */