mirror of
https://sourceware.org/git/glibc.git
synced 2025-06-05 00:22:17 +03:00
Revert "linux: Move {f}xstat{at} to compat symbols" for static build
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.
This commit is contained in:
parent
28f2ce2772
commit
46c1c765d1
@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
# include <abi-versions.h>
|
# include <abi-versions.h>
|
||||||
|
|
||||||
#ifdef SHARED
|
|
||||||
|
|
||||||
/* The file abi-versions.h (generated by scripts/abi-versions.awk) defines
|
/* 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
|
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
|
code for each library. For a version set that is subsumed by a later
|
||||||
@ -34,17 +32,24 @@
|
|||||||
when the two version sets named are in fact two different ABIs we are
|
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
|
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
|
extra code to support this version set where it has been superseded by a
|
||||||
newer version. The compatibility code should be conditionalized with
|
newer version. */
|
||||||
e.g. `#if SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_2)' for code introduced
|
#define LIB_COMPAT(lib, introduced, obsoleted) \
|
||||||
in the GLIBC_2.0 version and obsoleted in the GLIBC_2.2 version. */
|
_LIB_COMPAT (lib, introduced, obsoleted)
|
||||||
|
#define _LIB_COMPAT(lib, introduced, obsoleted) \
|
||||||
# define SHLIB_COMPAT(lib, introduced, obsoleted) \
|
|
||||||
_SHLIB_COMPAT (lib, introduced, obsoleted)
|
|
||||||
# define _SHLIB_COMPAT(lib, introduced, obsoleted) \
|
|
||||||
(IS_IN (lib) \
|
(IS_IN (lib) \
|
||||||
&& (!(ABI_##lib##_##obsoleted - 0) \
|
&& (!(ABI_##lib##_##obsoleted - 0) \
|
||||||
|| ((ABI_##lib##_##introduced - 0) < (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
|
/* 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
|
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
|
libm in the GLIBC_2.1 version. Definitions of symbols with explicit
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
#include <shlib-compat.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. */
|
/* Get information about the file descriptor FD in BUF. */
|
||||||
int
|
int
|
||||||
@ -34,4 +34,4 @@ __fxstat (int vers, int fd, struct stat *buf)
|
|||||||
}
|
}
|
||||||
weak_alias (__fxstat, _fxstat)
|
weak_alias (__fxstat, _fxstat)
|
||||||
|
|
||||||
#endif
|
#endif /* LIB_COMPAT */
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
#include <shlib-compat.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. */
|
/* Get information about the file descriptor FD in BUF. */
|
||||||
int
|
int
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
#include <shlib-compat.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
|
int
|
||||||
__fxstatat (int vers, int fd, const char *filename, struct stat *buf, int flag)
|
__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);
|
return __fstatat (fd, filename, buf, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
#include <shlib-compat.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. */
|
/* Get information about the file descriptor FD in BUF. */
|
||||||
int
|
int
|
||||||
@ -35,5 +35,4 @@ __fxstatat64 (int vers, int fd, const char *filename, struct stat64 *buf,
|
|||||||
|
|
||||||
return __fstatat64 (fd, filename, buf, flag);
|
return __fstatat64 (fd, filename, buf, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
#include <shlib-compat.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
|
int
|
||||||
__lxstat (int vers, const char *file, struct stat *buf)
|
__lxstat (int vers, const char *file, struct stat *buf)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
#include <shlib-compat.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. */
|
/* Get information about the file descriptor FD in BUF. */
|
||||||
int
|
int
|
||||||
@ -33,5 +33,4 @@ __lxstat64 (int vers, const char *file, struct stat64 *buf)
|
|||||||
|
|
||||||
return __lstat64 (file, buf);
|
return __lstat64 (file, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
#include <shlib-compat.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. */
|
/* Get file information about FILE in BUF. */
|
||||||
int
|
int
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <hurd.h>
|
#include <hurd.h>
|
||||||
#include <shlib-compat.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. */
|
/* Get information about the file descriptor FD in BUF. */
|
||||||
int
|
int
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# include <xstatover.h>
|
# include <xstatover.h>
|
||||||
# include <shlib-compat.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. */
|
/* Get information about the file FD in BUF. */
|
||||||
int
|
int
|
||||||
@ -61,6 +61,6 @@ __fxstat (int vers, int fd, struct stat *buf)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* SHLIB_COMPAT */
|
# endif /* LIB_COMPAT */
|
||||||
|
|
||||||
#endif /* XSTAT_IS_XSTAT64 */
|
#endif /* XSTAT_IS_XSTAT64 */
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <statx_cp.h>
|
#include <statx_cp.h>
|
||||||
#include <shlib-compat.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. */
|
/* Get information about the file FD in BUF. */
|
||||||
|
|
||||||
@ -78,4 +78,4 @@ strong_alias (___fxstat64, __fxstat64)
|
|||||||
strong_alias (___fxstat64, __fxstat)
|
strong_alias (___fxstat64, __fxstat)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SHLIB_COMPAT */
|
#endif /* LIB_COMPAT */
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# include <xstatover.h>
|
# include <xstatover.h>
|
||||||
# include <shlib-compat.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. */
|
/* Get information about the file FD in BUF. */
|
||||||
int
|
int
|
||||||
@ -50,6 +50,6 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* SHLIB_COMPAT */
|
# endif /* LIB_COMPAT */
|
||||||
|
|
||||||
#endif /* XSTAT_IS_XSTAT64 */
|
#endif /* XSTAT_IS_XSTAT64 */
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <statx_cp.h>
|
#include <statx_cp.h>
|
||||||
#include <shlib-compat.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. */
|
/* 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)
|
strong_alias (__fxstatat64, __fxstatat)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SHLIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33) */
|
#endif /* LIB_COMPAT(libc, GLIBC_2_4, GLIBC_2_33) */
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# include <xstatconv.h>
|
# include <xstatconv.h>
|
||||||
# include <xstatover.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. */
|
/* Get information about the file NAME in BUF. */
|
||||||
int
|
int
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <statx_cp.h>
|
#include <statx_cp.h>
|
||||||
#include <shlib-compat.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. */
|
/* Get information about the file NAME in BUF. */
|
||||||
|
|
||||||
@ -95,4 +95,4 @@ strong_alias (___lxstat64, __lxstat64);
|
|||||||
strong_alias (___lxstat64,__lxstat)
|
strong_alias (___lxstat64,__lxstat)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SHLIB_COMPAT */
|
#endif /* LIB_COMPAT */
|
||||||
|
@ -20,13 +20,13 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <kernel_stat.h>
|
#include <kernel_stat.h>
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
#include <shlib-compat.h>
|
|
||||||
|
|
||||||
#if !XSTAT_IS_XSTAT64
|
#if !XSTAT_IS_XSTAT64
|
||||||
# include <xstatconv.h>
|
# include <xstatconv.h>
|
||||||
# include <xstatover.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. */
|
/* Get information about the file NAME in BUF. */
|
||||||
int
|
int
|
||||||
@ -61,6 +61,6 @@ __xstat (int vers, const char *name, struct stat *buf)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* SHLIB_COMPAT */
|
# endif /* LIB_COMPAT */
|
||||||
|
|
||||||
#endif /* XSTAT_IS_XSTAT64 */
|
#endif /* XSTAT_IS_XSTAT64 */
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <statx_cp.h>
|
#include <statx_cp.h>
|
||||||
#include <shlib-compat.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. */
|
/* 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)
|
strong_alias (___xstat64, __xstat64)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SHLIB_COMPAT */
|
|
||||||
|
#endif /* LIB_COMPAT */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user