diff options
author | Joseph Myers <joseph@codesourcery.com> | 2017-05-19 11:26:00 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2017-05-19 11:26:00 +0000 |
commit | 8f2e1830f298f45d34cfdb4cffc8ce3b940a3990 (patch) | |
tree | 2ef1718177270ba6b5d846641a49cbf79c0225c3 /sysdeps/ieee754/ldbl-opt | |
parent | 332e01c6276e05ece5953007c98aa84725c4fda4 (diff) | |
download | glibc-8f2e1830f298f45d34cfdb4cffc8ce3b940a3990.tar.gz glibc-8f2e1830f298f45d34cfdb4cffc8ce3b940a3990.tar.xz glibc-8f2e1830f298f45d34cfdb4cffc8ce3b940a3990.zip |
Create and use first-versions.h with macros for function symbol versions.
This patch arranges for the glibc build to generate a header first-versions.h that defines macros for the earliest symbol version in which each public symbol (GLIBC_[0-9]* symbol version, name only uses C identifier characters) is available. This is used in sysdeps/ieee754/ldbl-opt/math-type-macros-double.h to replace the manually defined LDOUBLE_*_libm_version macros for various functions defined using type-generic templates, the purpose of which is to use in LONG_DOUBLE_COMPAT tests "was this function originally added before glibc supported long double != double on this platform?". As discussed in <https://sourceware.org/ml/libc-alpha/2016-12/msg00246.html>, I expect this to be useful more generally in reducing the amount of special-case code needed in ldbl-opt and ldbl-64-128. Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch. * scripts/versions.awk: Generate first-versions.h. * sysdeps/ieee754/ldbl-opt/math-type-macros-double.h: Include <first-versions.h>. (LDOUBLE_cabsl_libm_version): Remove macro. (LDOUBLE_cargl_libm_version): Likewise. (LDOUBLE_cimagl_libm_version): Likewise. (LDOUBLE_conjl_libm_version): Likewise. (LDOUBLE_creall_libm_version): Likewise. (LDOUBLE_cacosl_libm_version): Likewise. (LDOUBLE_cacoshl_libm_version): Likewise. (LDOUBLE_ccosl_libm_version): Likewise. (LDOUBLE_ccoshl_libm_version): Likewise. (LDOUBLE_casinl_libm_version): Likewise. (LDOUBLE_csinl_libm_version): Likewise. (LDOUBLE_casinhl_libm_version): Likewise. (LDOUBLE_csinhl_libm_version): Likewise. (LDOUBLE_catanl_libm_version): Likewise. (LDOUBLE_catanhl_libm_version): Likewise. (LDOUBLE_ctanl_libm_version): Likewise. (LDOUBLE_ctanhl_libm_version): Likewise. (LDOUBLE_cexpl_libm_version): Likewise. (LDOUBLE_clogl_libm_version): Likewise. (LDOUBLE_cprojl_libm_version): Likewise. (LDOUBLE_csqrtl_libm_version): Likewise. (LDOUBLE_cpowl_libm_version): Likewise. (LDOUBLE_clog10l_libm_version): Likewise. (LDOUBLE___clog10l_libm_version): Likewise. (LDOUBLE_fdiml_libm_version): Likewise. (LDOUBLE_fmaxl_libm_version): Likewise. (LDOUBLE_fminl_libm_version): Likewise. (LDOUBLE_ilogbl_libm_version): Likewise. (LDOUBLE_nanl_libm_version): Likewise. [!M_LIBM_NEED_COMPAT] (M_LIBM_NEED_COMPAT): Use FIRST_VERSION_libm_* macros. [!declare_mgen_libm_compat] (declare_mgen_libm_compat): Likewise. * Makerules [$(build-shared) = yes && !avoid-generated] (before-compile): Add $(common-objpfx)first-versions.h. [$(build-shared) = yes && !avoid-generated] ($(common-objpfx)first-versions.h): New target. ($(common-objpfx)sysd-versions): Depend on and change to rule for building $(common-objpfx)versions.stmp.
Diffstat (limited to 'sysdeps/ieee754/ldbl-opt')
-rw-r--r-- | sysdeps/ieee754/ldbl-opt/math-type-macros-double.h | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h index a83c2b37cc..67b5268dc4 100644 --- a/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h +++ b/sysdeps/ieee754/ldbl-opt/math-type-macros-double.h @@ -19,48 +19,19 @@ #ifndef _MATH_TYPE_MACROS_DOUBLE #include <math_ldbl_opt.h> - -#define LDOUBLE_cabsl_libm_version GLIBC_2_1 -#define LDOUBLE_cargl_libm_version GLIBC_2_1 -#define LDOUBLE_cimagl_libm_version GLIBC_2_1 -#define LDOUBLE_conjl_libm_version GLIBC_2_1 -#define LDOUBLE_creall_libm_version GLIBC_2_1 -#define LDOUBLE_cacosl_libm_version GLIBC_2_1 -#define LDOUBLE_cacoshl_libm_version GLIBC_2_1 -#define LDOUBLE_ccosl_libm_version GLIBC_2_1 -#define LDOUBLE_ccoshl_libm_version GLIBC_2_1 -#define LDOUBLE_casinl_libm_version GLIBC_2_1 -#define LDOUBLE_csinl_libm_version GLIBC_2_1 -#define LDOUBLE_casinhl_libm_version GLIBC_2_1 -#define LDOUBLE_csinhl_libm_version GLIBC_2_1 -#define LDOUBLE_catanl_libm_version GLIBC_2_1 -#define LDOUBLE_catanhl_libm_version GLIBC_2_1 -#define LDOUBLE_ctanl_libm_version GLIBC_2_1 -#define LDOUBLE_ctanhl_libm_version GLIBC_2_1 -#define LDOUBLE_cexpl_libm_version GLIBC_2_1 -#define LDOUBLE_clogl_libm_version GLIBC_2_1 -#define LDOUBLE_cprojl_libm_version GLIBC_2_1 -#define LDOUBLE_csqrtl_libm_version GLIBC_2_1 -#define LDOUBLE_cpowl_libm_version GLIBC_2_1 -#define LDOUBLE_clog10l_libm_version GLIBC_2_1 -#define LDOUBLE___clog10l_libm_version GLIBC_2_1 -#define LDOUBLE_fdiml_libm_version GLIBC_2_1 -#define LDOUBLE_fmaxl_libm_version GLIBC_2_1 -#define LDOUBLE_fminl_libm_version GLIBC_2_1 -#define LDOUBLE_ilogbl_libm_version GLIBC_2_0 -#define LDOUBLE_nanl_libm_version GLIBC_2_1 +#include <first-versions.h> /* Define compat symbols for long double on platforms where it was not always a distinct type. */ #if !defined M_LIBM_NEED_COMPAT # define M_LIBM_NEED_COMPAT(f) \ - LONG_DOUBLE_COMPAT (libm, LDOUBLE_ ## f ## l_libm_version) + LONG_DOUBLE_COMPAT (libm, FIRST_VERSION_libm_ ## f ## l) #endif #if !defined declare_mgen_libm_compat # define declare_mgen_libm_compat(from, to) \ compat_symbol (libm, from, to ## l, \ - LDOUBLE_ ## to ## l_libm_version); + FIRST_VERSION_libm_ ## to ## l); #endif #include_next <math-type-macros-double.h> |