aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-12-29 13:21:29 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-01-21 14:11:53 -0300
commit46c1c765d14c77c6c36df1b51dae6674a4eef06b (patch)
tree435a65a76f8d01fbf8a76da7f2fda54c2ce03731 /include
parent28f2ce27722d890a884cc7fa2f6d2bc0cb418f26 (diff)
downloadglibc-46c1c765d14c77c6c36df1b51dae6674a4eef06b.zip
glibc-46c1c765d14c77c6c36df1b51dae6674a4eef06b.tar.gz
glibc-46c1c765d14c77c6c36df1b51dae6674a4eef06b.tar.bz2
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.
Diffstat (limited to 'include')
-rw-r--r--include/shlib-compat.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/include/shlib-compat.h b/include/shlib-compat.h
index 43583bb..28baef1 100644
--- a/include/shlib-compat.h
+++ b/include/shlib-compat.h
@@ -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
@@ -34,17 +32,24 @@
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