Restore sparc32 copysignl, fabsl, fmal compat symbols (bug 22229) [committed]

Message ID alpine.DEB.2.20.1710041646250.9643@digraph.polyomino.org.uk
State New
Headers show
Series
  • Restore sparc32 copysignl, fabsl, fmal compat symbols (bug 22229) [committed]
Related show

Commit Message

Joseph Myers Oct. 4, 2017, 4:46 p.m.
32-bit SPARC libm should have compat symbols for copysignl
(GLIBC_2.0), fabsl (GLIBC_2.0), fmal (GLIBC_2.1), pointing to the
double functions; they were present in glibc 2.8, for example, but are
now missing, probably when optimized SPARC function implementations
were added without appropriate compat symbol handling.  The same
applies to copysignl in libc.  This patch restores those compat
symbols.

Tested with build-many-glibcs.py for sparcv9-linux-gnu.  Committed.

2017-10-04  Joseph Myers  <joseph@codesourcery.com>

	[BZ #22229]
	* sysdeps/sparc/sparc32/fpu/s_copysign.S: Include
	<math_ldbl_opt.h>
	(copysignl): Define as compat symbol at version GLIBC_2_0 for libm
	and libc.
	* sysdeps/sparc/sparc32/fpu/s_fabs.S: Include <math_ldbl_opt.h>.
	(fabsl): Define as compat symbol at version GLIBC_2_0 for libm.
	* sysdeps/sparc/sparc32/fpu/s_fma.c: Include <math_ldbl_opt.h>.
	(fmal): Define as compat symbol at version GLIBC_2_1 for libm.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S:
	Include <math_ldbl_opt.h>
	(copysignl): Define as compat symbol at version GLIBC_2_0 for libm
	and libc.
	(compat_symbol): Undefine and redefine.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S: Include
	<math_ldbl_opt.h>
	(fabsl): Define as compat symbol at version GLIBC_2_0 for libm.
	(compat_symbol): Undefine and redefine.
	* sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
	[HAVE_AS_VIS3_SUPPORT]: Include <math_ldbl_opt.h>.
	[HAVE_AS_VIS3_SUPPORT] (fmal): Define as compat symbol at version
	GLIBC_2_1 for libm.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Add
	GLIBC_2.0 copysignl symbol.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Add
	GLIBC_2.0 copysignl and fabsl and GLIBC_2.1 fmal symbols.

Patch

diff --git a/sysdeps/sparc/sparc32/fpu/s_copysign.S b/sysdeps/sparc/sparc32/fpu/s_copysign.S
index bddbfb2..348cabc 100644
--- a/sysdeps/sparc/sparc32/fpu/s_copysign.S
+++ b/sysdeps/sparc/sparc32/fpu/s_copysign.S
@@ -18,6 +18,7 @@ 
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math_ldbl_opt.h>
 
 ENTRY (__copysign)
 	sethi	%hi(0x80000000), %g1
@@ -28,4 +29,10 @@  ENTRY (__copysign)
 	retl
 	 ldd	[%sp + 72], %f0
 END (__copysign)
-weak_alias (__copysign, copysign)
\ No newline at end of file
+weak_alias (__copysign, copysign)
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
+#endif
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
+compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/sparc/sparc32/fpu/s_fabs.S b/sysdeps/sparc/sparc32/fpu/s_fabs.S
index fdeda68..774949a 100644
--- a/sysdeps/sparc/sparc32/fpu/s_fabs.S
+++ b/sysdeps/sparc/sparc32/fpu/s_fabs.S
@@ -17,6 +17,7 @@ 
    <http://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <math_ldbl_opt.h>
 
 ENTRY (__fabs)
 	st	%o0, [%sp+72]
@@ -26,3 +27,6 @@  ENTRY (__fabs)
 	 fabss	%f0, %f0
 END (__fabs)
 weak_alias (__fabs, fabs)
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, __fabs, fabsl, GLIBC_2_0);
+#endif
diff --git a/sysdeps/sparc/sparc32/fpu/s_fma.c b/sysdeps/sparc/sparc32/fpu/s_fma.c
index 8f62605..bfdcb23 100644
--- a/sysdeps/sparc/sparc32/fpu/s_fma.c
+++ b/sysdeps/sparc/sparc32/fpu/s_fma.c
@@ -1,2 +1,6 @@ 
 /* Always use dbl-64 version because long double is emulated in software.  */
+#include <math_ldbl_opt.h>
 #include <sysdeps/ieee754/dbl-64/s_fma.c>
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
+compat_symbol (libm, __fma, fmal, GLIBC_2_1);
+#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S
index cdd98c0..5d26430 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_copysign.S
@@ -1,11 +1,20 @@ 
 #include <sparc-ifunc.h>
+#include <math_ldbl_opt.h>
 
 SPARC_ASM_VIS3_IFUNC(copysign)
 
 weak_alias (__copysign, copysign)
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, __copysign, copysignl, GLIBC_2_0);
+#endif
+#if LONG_DOUBLE_COMPAT (libc, GLIBC_2_0)
+compat_symbol (libc, __copysign, copysignl, GLIBC_2_0);
+#endif
 
 # undef weak_alias
 # define weak_alias(a, b)
+# undef compat_symbol
+# define compat_symbol(a, b, c, d)
 
 #define __copysign __copysign_generic
 
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S
index 86c6398..72cc08f 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fabs.S
@@ -1,11 +1,17 @@ 
 #include <sparc-ifunc.h>
+#include <math_ldbl_opt.h>
 
 SPARC_ASM_VIS3_IFUNC(fabs)
 
 weak_alias (__fabs, fabs)
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_0)
+compat_symbol (libm, __fabs, fabsl, GLIBC_2_0);
+#endif
 
 # undef weak_alias
 # define weak_alias(a, b)
+# undef compat_symbol
+# define compat_symbol(a, b, c, d)
 
 #define __fabs __fabs_generic
 
diff --git a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
index 3f2f162..05113c3 100644
--- a/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
+++ b/sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fma.c
@@ -1,12 +1,16 @@ 
 #ifdef HAVE_AS_VIS3_SUPPORT
 # include <sparc-ifunc.h>
 # include <math.h>
+# include <math_ldbl_opt.h>
 
 extern double __fma_vis3 (double, double, double);
 extern double __fma_generic (double, double, double);
 
 sparc_libm_ifunc(__fma, hwcap & HWCAP_SPARC_FMAF ? __fma_vis3 : __fma_generic);
 weak_alias (__fma, fma)
+#if LONG_DOUBLE_COMPAT (libm, GLIBC_2_1)
+compat_symbol (libm, __fma, fmal, GLIBC_2_1);
+#endif
 
 # define __fma __fma_generic
 #endif
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
index 7f7449f..a62463b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist
@@ -367,6 +367,7 @@  GLIBC_2.0 confstr F
 GLIBC_2.0 connect F
 GLIBC_2.0 copysign F
 GLIBC_2.0 copysignf F
+GLIBC_2.0 copysignl F
 GLIBC_2.0 creat F
 GLIBC_2.0 create_module F
 GLIBC_2.0 ctermid F
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
index f8f10e5..92de6ed 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist
@@ -29,6 +29,7 @@  GLIBC_2.0 ceilf F
 GLIBC_2.0 ceill F
 GLIBC_2.0 copysign F
 GLIBC_2.0 copysignf F
+GLIBC_2.0 copysignl F
 GLIBC_2.0 cos F
 GLIBC_2.0 cosf F
 GLIBC_2.0 cosh F
@@ -52,6 +53,7 @@  GLIBC_2.0 expm1f F
 GLIBC_2.0 expm1l F
 GLIBC_2.0 fabs F
 GLIBC_2.0 fabsf F
+GLIBC_2.0 fabsl F
 GLIBC_2.0 finite F
 GLIBC_2.0 finitef F
 GLIBC_2.0 finitel F
@@ -254,6 +256,7 @@  GLIBC_2.1 fetestexcept F
 GLIBC_2.1 feupdateenv F
 GLIBC_2.1 fma F
 GLIBC_2.1 fmaf F
+GLIBC_2.1 fmal F
 GLIBC_2.1 fmax F
 GLIBC_2.1 fmaxf F
 GLIBC_2.1 fmaxl F