Use libm_alias_ldouble for ldbl-128 functions [committed]

Message ID alpine.DEB.2.20.1710061745360.21489@digraph.polyomino.org.uk
State New
Headers show
Series
  • Use libm_alias_ldouble for ldbl-128 functions [committed]
Related show

Commit Message

Joseph Myers Oct. 6, 2017, 5:46 p.m.
This patch makes ldbl-128 functions use libm_alias_ldouble to define
function aliases.  float128_private.h is updated accordingly.  Most of
the ldbl-64-128 wrappers are removed as no longer needed with this
change (leaving those that involve versioning for functions in libc or
that shouldn't be exported from libm for _Float128 / _Float64x types
with the same format as long double).

Tested for x86_64, and tested with build-many-glibcs.py that installed
stripped shared libraries are unchanged by this patch.  Committed.

(Note: in this patch series, I don't intend to change ldbl-128ibm
functions to use libm_alias_ldouble.  It would be perfectly reasonable
for them to do so, as a cleanup, but it's not relevant to the purpose
of this series which is preparation for providing _FloatN / _FloatNx
functions in cases where those can alias functions for other types,
since no _FloatN / _FloatNx types can have the ldbl-128ibm format.)

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

	* sysdeps/ieee754/float128/float128_private.h: Include
	<libm-alias-ldouble.h> and <libm-alias-float128.h>.
	(libm_alias_ldouble_r): Undefine and redefine.
	* sysdeps/ieee754/ldbl-128/s_asinhl.c: Include
	<libm-alias-ldouble.h>.
	(asinhl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_atanl.c: Include
	<libm-alias-ldouble.h>.
	(atanl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_cbrtl.c: Include
	<libm-alias-ldouble.h>.
	(cbrtl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_ceill.c: Include
	<libm-alias-ldouble.h>.
	(ceill): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_copysignl.c: Include
	<libm-alias-ldouble.h>.
	(copysignl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_cosl.c: Include
	<libm-alias-ldouble.h>.
	(cosl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_erfl.c: Include
	<libm-alias-ldouble.h>.
	(erfl): Define using libm_alias_ldouble.
	(erfcl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_expm1l.c: Include
	<libm-alias-ldouble.h>.
	(expm1l): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_fabsl.c: Include
	<libm-alias-ldouble.h>.
	(fabsl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_floorl.c: Include
	<libm-alias-ldouble.h>.
	(floorl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_fmal.c: Include
	<libm-alias-ldouble.h>.
	(fmal): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_frexpl.c: Include
	<libm-alias-ldouble.h>.
	(frexpl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_fromfpl.c (fromfpl): Define using
	libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_fromfpl_main.c: Include
	<libm-alias-ldouble.h>.
	* sysdeps/ieee754/ldbl-128/s_fromfpxl.c (fromfpxl): Define using
	libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_getpayloadl.c: Include
	<libm-alias-ldouble.h>.
	(getpayloadl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_llrintl.c: Include
	<libm-alias-ldouble.h>.
	(llrintl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_llroundl.c: Include
	<libm-alias-ldouble.h>.
	(llroundl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_logbl.c: Include
	<libm-alias-ldouble.h>.
	(logbl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_lrintl.c: Include
	<libm-alias-ldouble.h>.
	(lrintl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_lroundl.c: Include
	<libm-alias-ldouble.h>.
	(lroundl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_modfl.c: Include
	<libm-alias-ldouble.h>.
	(modfl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_nearbyintl.c: Include
	<libm-alias-ldouble.h>.
	(nearbyintl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_nextafterl.c: Include
	<libm-alias-ldouble.h>.
	(nextafterl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_nextupl.c: Include
	<libm-alias-ldouble.h>.
	(nextupl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_remquol.c: Include
	<libm-alias-ldouble.h>.
	(remquol): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_rintl.c: Include
	<libm-alias-ldouble.h>.
	(rintl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_roundevenl.c: Include
	<libm-alias-ldouble.h>.
	(roundevenl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_roundl.c: Include
	<libm-alias-ldouble.h>.
	(roundl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_setpayloadl.c (setpayloadl): Define
	using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c: Include
	<libm-alias-ldouble.h>.
	* sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c (setpayloadsigl):
	Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_sincosl.c: Include
	<libm-alias-ldouble.h>.
	(sincosl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_sinl.c: Include
	<libm-alias-ldouble.h>.
	(sinl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_tanhl.c: Include
	<libm-alias-ldouble.h>.
	(tanhl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_tanl.c: Include
	<libm-alias-ldouble.h>.
	(tanl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_totalorderl.c: Include
	<libm-alias-ldouble.h>.
	(totalorderl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_totalordermagl.c: Include
	<libm-alias-ldouble.h>.
	(totalordermagl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_truncl.c: Include
	<libm-alias-ldouble.h>.
	(truncl): Define using libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_ufromfpl.c (ufromfpl): Define using
	libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-128/s_ufromfpxl.c (ufromfpxl): Define using
	libm_alias_ldouble.
	* sysdeps/ieee754/ldbl-64-128/s_copysignl.c: Include
	<libm-alias-ldouble.h>.
	(weak_alias): Do not undefine and redefine.
	[IS_IN (libc)] (libm_alias_ldouble): Undefine and redefine.
	(copysignl): Define with long_double_symbol only if [IS_IN
	(libc)].
	* sysdeps/ieee754/ldbl-64-128/s_frexpl.c: Include
	<libm-alias-ldouble.h>.
	(weak_alias): Do not undefine and redefine.
	[IS_IN (libc)] (libm_alias_ldouble): Undefine and redefine.
	(frexpl): Define with long_double_symbol only if [IS_IN (libc)].
	* sysdeps/ieee754/ldbl-64-128/s_modfl.c: Include
	<libm-alias-ldouble.h>.
	(weak_alias): Do not undefine and redefine.
	[IS_IN (libc)] (libm_alias_ldouble): Undefine and redefine.
	(modfl): Define with long_double_symbol only if [IS_IN (libc)].
	* sysdeps/ieee754/ldbl-64-128/s_asinhl.c: Remove file.
	* sysdeps/ieee754/ldbl-64-128/s_atanl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_cbrtl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_ceill.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_cosl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_erfl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_expm1l.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_fabsl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_floorl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_fmal.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_llrintl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_llroundl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_logbl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_lrintl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_lroundl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_remquol.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_rintl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_roundl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_sincosl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_sinl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_tanhl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_tanl.c: Likewise.
	* sysdeps/ieee754/ldbl-64-128/s_truncl.c: Likewise.

Patch

diff --git a/sysdeps/ieee754/float128/float128_private.h b/sysdeps/ieee754/float128/float128_private.h
index 8c7d2ba..c687a72 100644
--- a/sysdeps/ieee754/float128/float128_private.h
+++ b/sysdeps/ieee754/float128/float128_private.h
@@ -116,6 +116,12 @@ 
 #define M_SQRT1_2l M_SQRT1_2f128
 
 
+#include <libm-alias-ldouble.h>
+#include <libm-alias-float128.h>
+#undef libm_alias_ldouble_r
+#define libm_alias_ldouble_r(from, to, r) libm_alias_float128_r (from, to, r)
+
+
 /* IEEE function renames.  */
 #define __ieee754_acoshl __ieee754_acoshf128
 #define __ieee754_acosl __ieee754_acosf128
diff --git a/sysdeps/ieee754/ldbl-128/s_asinhl.c b/sysdeps/ieee754/ldbl-128/s_asinhl.c
index 83efb34..307ca00 100644
--- a/sysdeps/ieee754/ldbl-128/s_asinhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_asinhl.c
@@ -32,6 +32,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <float.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 static const _Float128
   one = 1,
@@ -76,4 +77,4 @@  __asinhl (_Float128 x)
   else
     return w;
 }
-weak_alias (__asinhl, asinhl)
+libm_alias_ldouble (__asinh, asinh)
diff --git a/sysdeps/ieee754/ldbl-128/s_atanl.c b/sysdeps/ieee754/ldbl-128/s_atanl.c
index 6f2cd54..e05368d 100644
--- a/sysdeps/ieee754/ldbl-128/s_atanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_atanl.c
@@ -62,6 +62,7 @@ 
 #include <float.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 /* arctan(k/8), k = 0, ..., 82 */
 static const _Float128 atantbl[84] = {
@@ -250,4 +251,4 @@  __atanl (_Float128 x)
     return u;
 }
 
-weak_alias (__atanl, atanl)
+libm_alias_ldouble (__atan, atan)
diff --git a/sysdeps/ieee754/ldbl-128/s_cbrtl.c b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
index eb88d29..526e850 100644
--- a/sysdeps/ieee754/ldbl-128/s_cbrtl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cbrtl.c
@@ -56,6 +56,7 @@  Adapted for glibc October, 2001.
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 static const _Float128 CBRT2 = L(1.259921049894873164767210607278228350570251);
 static const _Float128 CBRT4 = L(1.587401051968199474751705639272308260391493);
@@ -132,4 +133,4 @@  __cbrtl (_Float128 x)
   return (x);
 }
 
-weak_alias (__cbrtl, cbrtl)
+libm_alias_ldouble (__cbrt, cbrt)
diff --git a/sysdeps/ieee754/ldbl-128/s_ceill.c b/sysdeps/ieee754/ldbl-128/s_ceill.c
index 8ac39fa..e6aba5f 100644
--- a/sysdeps/ieee754/ldbl-128/s_ceill.c
+++ b/sysdeps/ieee754/ldbl-128/s_ceill.c
@@ -26,6 +26,7 @@  static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 _Float128 __ceill(_Float128 x)
 {
@@ -63,4 +64,4 @@  _Float128 __ceill(_Float128 x)
 	SET_LDOUBLE_WORDS64(x,i0,i1);
 	return x;
 }
-weak_alias (__ceill, ceill)
+libm_alias_ldouble (__ceil, ceil)
diff --git a/sysdeps/ieee754/ldbl-128/s_copysignl.c b/sysdeps/ieee754/ldbl-128/s_copysignl.c
index e514e3c..d23e0f7 100644
--- a/sysdeps/ieee754/ldbl-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-128/s_copysignl.c
@@ -25,6 +25,7 @@  static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 _Float128 __copysignl(_Float128 x, _Float128 y)
 {
@@ -35,4 +36,4 @@  _Float128 __copysignl(_Float128 x, _Float128 y)
 			    |(hy&0x8000000000000000ULL));
         return x;
 }
-weak_alias (__copysignl, copysignl)
+libm_alias_ldouble (__copysign, copysign)
diff --git a/sysdeps/ieee754/ldbl-128/s_cosl.c b/sysdeps/ieee754/ldbl-128/s_cosl.c
index ed3e77d..b315abc 100644
--- a/sysdeps/ieee754/ldbl-128/s_cosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_cosl.c
@@ -47,6 +47,7 @@ 
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 _Float128 __cosl(_Float128 x)
 {
@@ -83,4 +84,4 @@  _Float128 __cosl(_Float128 x)
 	    }
 	}
 }
-weak_alias (__cosl, cosl)
+libm_alias_ldouble (__cos, cos)
diff --git a/sysdeps/ieee754/ldbl-128/s_erfl.c b/sysdeps/ieee754/ldbl-128/s_erfl.c
index ce9e6cc..88e91c7 100644
--- a/sysdeps/ieee754/ldbl-128/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_erfl.c
@@ -100,6 +100,7 @@ 
 #include <float.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 /* Evaluate P[n] x^n  +  P[n-1] x^(n-1)  +  ...  +  P[0] */
 
@@ -803,7 +804,7 @@  __erfl (_Float128 x)
   return( y );
 }
 
-weak_alias (__erfl, erfl)
+libm_alias_ldouble (__erf, erf)
 _Float128
 __erfcl (_Float128 x)
 {
@@ -945,4 +946,4 @@  __erfcl (_Float128 x)
     }
 }
 
-weak_alias (__erfcl, erfcl)
+libm_alias_ldouble (__erfc, erfc)
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index 46d078b..ea0d29c 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -57,6 +57,7 @@ 
 #include <float.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 /* exp(x) - 1 = x + 0.5 x^2 + x^3 P(x)/Q(x)
    -.5 ln 2  <  x  <  .5 ln 2
@@ -163,4 +164,4 @@  __expm1l (_Float128 x)
   return x;
 }
 libm_hidden_def (__expm1l)
-weak_alias (__expm1l, expm1l)
+libm_alias_ldouble (__expm1, expm1)
diff --git a/sysdeps/ieee754/ldbl-128/s_fabsl.c b/sysdeps/ieee754/ldbl-128/s_fabsl.c
index 1efb7a2..8d55453 100644
--- a/sysdeps/ieee754/ldbl-128/s_fabsl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fabsl.c
@@ -23,6 +23,7 @@  static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 _Float128 __fabsl(_Float128 x)
 {
@@ -31,4 +32,4 @@  _Float128 __fabsl(_Float128 x)
 	SET_LDOUBLE_MSW64(x,hx&0x7fffffffffffffffLL);
         return x;
 }
-weak_alias (__fabsl, fabsl)
+libm_alias_ldouble (__fabs, fabs)
diff --git a/sysdeps/ieee754/ldbl-128/s_floorl.c b/sysdeps/ieee754/ldbl-128/s_floorl.c
index 77b1473..f9c5e01 100644
--- a/sysdeps/ieee754/ldbl-128/s_floorl.c
+++ b/sysdeps/ieee754/ldbl-128/s_floorl.c
@@ -26,6 +26,7 @@  static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 _Float128 __floorl(_Float128 x)
 {
@@ -64,4 +65,4 @@  _Float128 __floorl(_Float128 x)
 	SET_LDOUBLE_WORDS64(x,i0,i1);
 	return x;
 }
-weak_alias (__floorl, floorl)
+libm_alias_ldouble (__floor, floor)
diff --git a/sysdeps/ieee754/ldbl-128/s_fmal.c b/sysdeps/ieee754/ldbl-128/s_fmal.c
index 40c4e73..077d515 100644
--- a/sysdeps/ieee754/ldbl-128/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128/s_fmal.c
@@ -22,6 +22,7 @@ 
 #include <fenv.h>
 #include <ieee754.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <tininess.h>
 
 /* This implementation uses rounding to odd to avoid problems with
@@ -295,4 +296,4 @@  __fmal (_Float128 x, _Float128 y, _Float128 z)
       return v.d * L(0x1p-228);
     }
 }
-weak_alias (__fmal, fmal)
+libm_alias_ldouble (__fma, fma)
diff --git a/sysdeps/ieee754/ldbl-128/s_frexpl.c b/sysdeps/ieee754/ldbl-128/s_frexpl.c
index 7ac28f1..bab0779 100644
--- a/sysdeps/ieee754/ldbl-128/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-128/s_frexpl.c
@@ -29,6 +29,7 @@  static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 static const _Float128
 two114 = L(2.0769187434139310514121985316880384E+34); /* 0x4071000000000000, 0 */
@@ -51,4 +52,4 @@  _Float128 __frexpl(_Float128 x, int *eptr)
 	SET_LDOUBLE_MSW64(x,hx);
 	return x;
 }
-weak_alias (__frexpl, frexpl)
+libm_alias_ldouble (__frexp, frexp)
diff --git a/sysdeps/ieee754/ldbl-128/s_fromfpl.c b/sysdeps/ieee754/ldbl-128/s_fromfpl.c
index f3fdba3..bcedcee 100644
--- a/sysdeps/ieee754/ldbl-128/s_fromfpl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fromfpl.c
@@ -2,4 +2,4 @@ 
 #define INEXACT 0
 #define FUNC __fromfpl
 #include <s_fromfpl_main.c>
-weak_alias (__fromfpl, fromfpl)
+libm_alias_ldouble (__fromfp, fromfp)
diff --git a/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c b/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c
index 7dc5071..83e9e7e 100644
--- a/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c
+++ b/sysdeps/ieee754/ldbl-128/s_fromfpl_main.c
@@ -20,6 +20,7 @@ 
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <stdbool.h>
 #include <stdint.h>
 
diff --git a/sysdeps/ieee754/ldbl-128/s_fromfpxl.c b/sysdeps/ieee754/ldbl-128/s_fromfpxl.c
index 9477cc2..0a342a2 100644
--- a/sysdeps/ieee754/ldbl-128/s_fromfpxl.c
+++ b/sysdeps/ieee754/ldbl-128/s_fromfpxl.c
@@ -2,4 +2,4 @@ 
 #define INEXACT 1
 #define FUNC __fromfpxl
 #include <s_fromfpl_main.c>
-weak_alias (__fromfpxl, fromfpxl)
+libm_alias_ldouble (__fromfpx, fromfpx)
diff --git a/sysdeps/ieee754/ldbl-128/s_getpayloadl.c b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
index a7d3959..c60bd30 100644
--- a/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
+++ b/sysdeps/ieee754/ldbl-128/s_getpayloadl.c
@@ -18,6 +18,7 @@ 
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <stdint.h>
 
 _Float128
@@ -55,4 +56,4 @@  __getpayloadl (const _Float128 *x)
   SET_LDOUBLE_WORDS64 (ret, hx, lx);
   return ret;
 }
-weak_alias (__getpayloadl, getpayloadl)
+libm_alias_ldouble (__getpayload, getpayload)
diff --git a/sysdeps/ieee754/ldbl-128/s_llrintl.c b/sysdeps/ieee754/ldbl-128/s_llrintl.c
index 94798cf..415b682 100644
--- a/sysdeps/ieee754/ldbl-128/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llrintl.c
@@ -24,6 +24,7 @@ 
 #include <math.h>
 
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <fix-fp-int-convert-overflow.h>
 
 static const _Float128 two112[2] =
@@ -105,4 +106,4 @@  __llrintl (_Float128 x)
   return sx ? -result : result;
 }
 
-weak_alias (__llrintl, llrintl)
+libm_alias_ldouble (__llrint, llrint)
diff --git a/sysdeps/ieee754/ldbl-128/s_llroundl.c b/sysdeps/ieee754/ldbl-128/s_llroundl.c
index 8b44f1f..4e0a108 100644
--- a/sysdeps/ieee754/ldbl-128/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llroundl.c
@@ -23,6 +23,7 @@ 
 #include <math.h>
 
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <fix-fp-int-convert-overflow.h>
 
 long long int
@@ -99,4 +100,4 @@  __llroundl (_Float128 x)
   return sign * result;
 }
 
-weak_alias (__llroundl, llroundl)
+libm_alias_ldouble (__llround, llround)
diff --git a/sysdeps/ieee754/ldbl-128/s_logbl.c b/sysdeps/ieee754/ldbl-128/s_logbl.c
index 24baae6..9264fe6 100644
--- a/sysdeps/ieee754/ldbl-128/s_logbl.c
+++ b/sysdeps/ieee754/ldbl-128/s_logbl.c
@@ -25,6 +25,7 @@  static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 _Float128
 __logbl (_Float128 x)
@@ -51,4 +52,4 @@  __logbl (_Float128 x)
   return (_Float128) (ex - 16383);
 }
 
-weak_alias (__logbl, logbl)
+libm_alias_ldouble (__logb, logb)
diff --git a/sysdeps/ieee754/ldbl-128/s_lrintl.c b/sysdeps/ieee754/ldbl-128/s_lrintl.c
index 49b736b..e71e179 100644
--- a/sysdeps/ieee754/ldbl-128/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lrintl.c
@@ -24,6 +24,7 @@ 
 #include <math.h>
 
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <fix-fp-int-convert-overflow.h>
 
 static const _Float128 two112[2] =
@@ -134,4 +135,4 @@  __lrintl (_Float128 x)
   return sx ? -result : result;
 }
 
-weak_alias (__lrintl, lrintl)
+libm_alias_ldouble (__lrint, lrint)
diff --git a/sysdeps/ieee754/ldbl-128/s_lroundl.c b/sysdeps/ieee754/ldbl-128/s_lroundl.c
index 15d0106..abee144 100644
--- a/sysdeps/ieee754/ldbl-128/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lroundl.c
@@ -23,6 +23,7 @@ 
 #include <math.h>
 
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <fix-fp-int-convert-overflow.h>
 
 long int
@@ -110,4 +111,4 @@  __lroundl (_Float128 x)
   return sign * result;
 }
 
-weak_alias (__lroundl, lroundl)
+libm_alias_ldouble (__lround, lround)
diff --git a/sysdeps/ieee754/ldbl-128/s_modfl.c b/sysdeps/ieee754/ldbl-128/s_modfl.c
index 6f7e48b..2d0a2d7 100644
--- a/sysdeps/ieee754/ldbl-128/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_modfl.c
@@ -29,6 +29,7 @@  static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 static const _Float128 one = 1.0;
 
@@ -76,4 +77,4 @@  _Float128 __modfl(_Float128 x, _Float128 *iptr)
 	    }
 	}
 }
-weak_alias (__modfl, modfl)
+libm_alias_ldouble (__modf, modf)
diff --git a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
index c1ee68b..04b657d 100644
--- a/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nearbyintl.c
@@ -26,6 +26,7 @@ 
 #include <fenv.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 static const _Float128
 TWO112[2]={
@@ -64,4 +65,4 @@  _Float128 __nearbyintl(_Float128 x)
 	fesetenv (&env);
 	return t;
 }
-weak_alias (__nearbyintl, nearbyintl)
+libm_alias_ldouble (__nearbyint, nearbyint)
diff --git a/sysdeps/ieee754/ldbl-128/s_nextafterl.c b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
index 6c63d17..d8bf2b6 100644
--- a/sysdeps/ieee754/ldbl-128/s_nextafterl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nextafterl.c
@@ -27,6 +27,7 @@  static char rcsid[] = "$NetBSD: $";
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 _Float128 __nextafterl(_Float128 x, _Float128 y)
 {
@@ -81,6 +82,6 @@  _Float128 __nextafterl(_Float128 x, _Float128 y)
 	SET_LDOUBLE_WORDS64(x,hx,lx);
 	return x;
 }
-weak_alias (__nextafterl, nextafterl)
+libm_alias_ldouble (__nextafter, nextafter)
 strong_alias (__nextafterl, __nexttowardl)
 weak_alias (__nextafterl, nexttowardl)
diff --git a/sysdeps/ieee754/ldbl-128/s_nextupl.c b/sysdeps/ieee754/ldbl-128/s_nextupl.c
index 9e778de..d068385 100644
--- a/sysdeps/ieee754/ldbl-128/s_nextupl.c
+++ b/sysdeps/ieee754/ldbl-128/s_nextupl.c
@@ -18,6 +18,7 @@ 
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 /* Return the least floating-point number greater than X.  */
 _Float128
@@ -53,4 +54,4 @@  __nextupl (_Float128 x)
   return x;
 }
 
-weak_alias (__nextupl, nextupl)
+libm_alias_ldouble (__nextup, nextup)
diff --git a/sysdeps/ieee754/ldbl-128/s_remquol.c b/sysdeps/ieee754/ldbl-128/s_remquol.c
index fdecab5..ce7c675 100644
--- a/sysdeps/ieee754/ldbl-128/s_remquol.c
+++ b/sysdeps/ieee754/ldbl-128/s_remquol.c
@@ -21,6 +21,7 @@ 
 #include <math.h>
 
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 
 static const _Float128 zero = 0.0;
@@ -109,4 +110,4 @@  __remquol (_Float128 x, _Float128 y, int *quo)
     x = -x;
   return x;
 }
-weak_alias (__remquol, remquol)
+libm_alias_ldouble (__remquo, remquo)
diff --git a/sysdeps/ieee754/ldbl-128/s_rintl.c b/sysdeps/ieee754/ldbl-128/s_rintl.c
index dff5c43..9e6637a 100644
--- a/sysdeps/ieee754/ldbl-128/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_rintl.c
@@ -29,6 +29,7 @@  static char rcsid[] = "$NetBSD: $";
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 static const _Float128
 TWO112[2]={
@@ -59,4 +60,4 @@  _Float128 __rintl(_Float128 x)
 	w = TWO112[sx]+x;
 	return w-TWO112[sx];
 }
-weak_alias (__rintl, rintl)
+libm_alias_ldouble (__rint, rint)
diff --git a/sysdeps/ieee754/ldbl-128/s_roundevenl.c b/sysdeps/ieee754/ldbl-128/s_roundevenl.c
index e57367b..aa199b7 100644
--- a/sysdeps/ieee754/ldbl-128/s_roundevenl.c
+++ b/sysdeps/ieee754/ldbl-128/s_roundevenl.c
@@ -19,6 +19,7 @@ 
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <stdint.h>
 
 #define BIAS 0x3fff
@@ -100,4 +101,4 @@  __roundevenl (_Float128 x)
   SET_LDOUBLE_WORDS64 (x, hx, lx);
   return x;
 }
-weak_alias (__roundevenl, roundevenl)
+libm_alias_ldouble (__roundeven, roundeven)
diff --git a/sysdeps/ieee754/ldbl-128/s_roundl.c b/sysdeps/ieee754/ldbl-128/s_roundl.c
index 18e8b65..cabb8a3 100644
--- a/sysdeps/ieee754/ldbl-128/s_roundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_roundl.c
@@ -21,6 +21,7 @@ 
 #include <math.h>
 
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 
 _Float128
@@ -77,4 +78,4 @@  __roundl (_Float128 x)
   SET_LDOUBLE_WORDS64 (x, i0, i1);
   return x;
 }
-weak_alias (__roundl, roundl)
+libm_alias_ldouble (__round, round)
diff --git a/sysdeps/ieee754/ldbl-128/s_setpayloadl.c b/sysdeps/ieee754/ldbl-128/s_setpayloadl.c
index bb07a35..9f43c25 100644
--- a/sysdeps/ieee754/ldbl-128/s_setpayloadl.c
+++ b/sysdeps/ieee754/ldbl-128/s_setpayloadl.c
@@ -1,4 +1,4 @@ 
 #define SIG 0
 #define FUNC __setpayloadl
 #include <s_setpayloadl_main.c>
-weak_alias (__setpayloadl, setpayloadl)
+libm_alias_ldouble (__setpayload, setpayload)
diff --git a/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c b/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c
index 5646634..8fcef52 100644
--- a/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c
+++ b/sysdeps/ieee754/ldbl-128/s_setpayloadl_main.c
@@ -18,6 +18,7 @@ 
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <nan-high-order-bit.h>
 #include <stdint.h>
 
diff --git a/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c b/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c
index 4e92036..cd82f29 100644
--- a/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c
+++ b/sysdeps/ieee754/ldbl-128/s_setpayloadsigl.c
@@ -1,4 +1,4 @@ 
 #define SIG 1
 #define FUNC __setpayloadsigl
 #include <s_setpayloadl_main.c>
-weak_alias (__setpayloadsigl, setpayloadsigl)
+libm_alias_ldouble (__setpayloadsig, setpayloadsig)
diff --git a/sysdeps/ieee754/ldbl-128/s_sincosl.c b/sysdeps/ieee754/ldbl-128/s_sincosl.c
index 34ca6ee..62b660f 100644
--- a/sysdeps/ieee754/ldbl-128/s_sincosl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sincosl.c
@@ -22,6 +22,7 @@ 
 #include <math.h>
 
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 void
 __sincosl (_Float128 x, _Float128 *sinx, _Float128 *cosx)
@@ -70,4 +71,4 @@  __sincosl (_Float128 x, _Float128 *sinx, _Float128 *cosx)
 	}
     }
 }
-weak_alias (__sincosl, sincosl)
+libm_alias_ldouble (__sincos, sincos)
diff --git a/sysdeps/ieee754/ldbl-128/s_sinl.c b/sysdeps/ieee754/ldbl-128/s_sinl.c
index 887e45d..773b2fa 100644
--- a/sysdeps/ieee754/ldbl-128/s_sinl.c
+++ b/sysdeps/ieee754/ldbl-128/s_sinl.c
@@ -47,6 +47,7 @@ 
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 _Float128 __sinl(_Float128 x)
 {
@@ -83,4 +84,4 @@  _Float128 __sinl(_Float128 x)
 	    }
 	}
 }
-weak_alias (__sinl, sinl)
+libm_alias_ldouble (__sin, sin)
diff --git a/sysdeps/ieee754/ldbl-128/s_tanhl.c b/sysdeps/ieee754/ldbl-128/s_tanhl.c
index 861b7f8..8f62f96 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanhl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanhl.c
@@ -44,6 +44,7 @@ 
 #include <float.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 static const _Float128 one = 1.0, two = 2.0, tiny = L(1.0e-4900);
 
@@ -97,4 +98,4 @@  __tanhl (_Float128 x)
     }
   return (jx & 0x80000000) ? -z : z;
 }
-weak_alias (__tanhl, tanhl)
+libm_alias_ldouble (__tanh, tanh)
diff --git a/sysdeps/ieee754/ldbl-128/s_tanl.c b/sysdeps/ieee754/ldbl-128/s_tanl.c
index cd7b258..77db10f 100644
--- a/sysdeps/ieee754/ldbl-128/s_tanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_tanl.c
@@ -47,6 +47,7 @@ 
 #include <errno.h>
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 _Float128 __tanl(_Float128 x)
 {
@@ -77,4 +78,4 @@  _Float128 __tanl(_Float128 x)
 							-1 -- n odd */
 	}
 }
-weak_alias (__tanl, tanl)
+libm_alias_ldouble (__tan, tan)
diff --git a/sysdeps/ieee754/ldbl-128/s_totalorderl.c b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
index 7887607..87a494a 100644
--- a/sysdeps/ieee754/ldbl-128/s_totalorderl.c
+++ b/sysdeps/ieee754/ldbl-128/s_totalorderl.c
@@ -18,6 +18,7 @@ 
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <nan-high-order-bit.h>
 #include <stdint.h>
 
@@ -52,4 +53,4 @@  __totalorderl (_Float128 x, _Float128 y)
   ly ^= hy_sign;
   return hx < hy || (hx == hy && lx <= ly);
 }
-weak_alias (__totalorderl, totalorderl)
+libm_alias_ldouble (__totalorder, totalorder)
diff --git a/sysdeps/ieee754/ldbl-128/s_totalordermagl.c b/sysdeps/ieee754/ldbl-128/s_totalordermagl.c
index 11b58ef..9436f6e 100644
--- a/sysdeps/ieee754/ldbl-128/s_totalordermagl.c
+++ b/sysdeps/ieee754/ldbl-128/s_totalordermagl.c
@@ -18,6 +18,7 @@ 
 
 #include <math.h>
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 #include <nan-high-order-bit.h>
 #include <stdint.h>
 
@@ -46,4 +47,4 @@  __totalordermagl (_Float128 x, _Float128 y)
 #endif
   return hx < hy || (hx == hy && lx <= ly);
 }
-weak_alias (__totalordermagl, totalordermagl)
+libm_alias_ldouble (__totalordermag, totalordermag)
diff --git a/sysdeps/ieee754/ldbl-128/s_truncl.c b/sysdeps/ieee754/ldbl-128/s_truncl.c
index b445a28..da09065 100644
--- a/sysdeps/ieee754/ldbl-128/s_truncl.c
+++ b/sysdeps/ieee754/ldbl-128/s_truncl.c
@@ -21,6 +21,7 @@ 
 #include <math.h>
 
 #include <math_private.h>
+#include <libm-alias-ldouble.h>
 
 
 _Float128
@@ -53,4 +54,4 @@  __truncl (_Float128 x)
 
   return x;
 }
-weak_alias (__truncl, truncl)
+libm_alias_ldouble (__trunc, trunc)
diff --git a/sysdeps/ieee754/ldbl-128/s_ufromfpl.c b/sysdeps/ieee754/ldbl-128/s_ufromfpl.c
index 2176aa0..22935e6 100644
--- a/sysdeps/ieee754/ldbl-128/s_ufromfpl.c
+++ b/sysdeps/ieee754/ldbl-128/s_ufromfpl.c
@@ -2,4 +2,4 @@ 
 #define INEXACT 0
 #define FUNC __ufromfpl
 #include <s_fromfpl_main.c>
-weak_alias (__ufromfpl, ufromfpl)
+libm_alias_ldouble (__ufromfp, ufromfp)
diff --git a/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c b/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c
index 2901151..77a5423 100644
--- a/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c
+++ b/sysdeps/ieee754/ldbl-128/s_ufromfpxl.c
@@ -2,4 +2,4 @@ 
 #define INEXACT 1
 #define FUNC __ufromfpxl
 #include <s_fromfpl_main.c>
-weak_alias (__ufromfpxl, ufromfpxl)
+libm_alias_ldouble (__ufromfpx, ufromfpx)
diff --git a/sysdeps/ieee754/ldbl-64-128/s_asinhl.c b/sysdeps/ieee754/ldbl-64-128/s_asinhl.c
deleted file mode 100644
index 4e8a541..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_asinhl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_asinhl.c>
-long_double_symbol (libm, __asinhl, asinhl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_atanl.c b/sysdeps/ieee754/ldbl-64-128/s_atanl.c
deleted file mode 100644
index c23d14a..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_atanl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_atanl.c>
-long_double_symbol (libm, __atanl, atanl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c b/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c
deleted file mode 100644
index ace5645..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_cbrtl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_cbrtl.c>
-long_double_symbol (libm, __cbrtl, cbrtl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_ceill.c b/sysdeps/ieee754/ldbl-64-128/s_ceill.c
deleted file mode 100644
index a646494..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_ceill.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_ceill.c>
-long_double_symbol (libm, __ceill, ceill);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
index 211e724..11b42d0 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
@@ -1,9 +1,10 @@ 
 #include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+#include <libm-alias-ldouble.h>
+#if IS_IN (libc)
+# undef libm_alias_ldouble
+# define libm_alias_ldouble(from, to)
+#endif
 #include <sysdeps/ieee754/ldbl-128/s_copysignl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __copysignl, copysignl);
-#else
+#if IS_IN (libc)
 long_double_symbol (libc, __copysignl, copysignl);
 #endif
diff --git a/sysdeps/ieee754/ldbl-64-128/s_cosl.c b/sysdeps/ieee754/ldbl-64-128/s_cosl.c
deleted file mode 100644
index 6a7e2e3..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_cosl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_cosl.c>
-long_double_symbol (libm, __cosl, cosl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_erfl.c b/sysdeps/ieee754/ldbl-64-128/s_erfl.c
deleted file mode 100644
index c5f9bb3..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_erfl.c
+++ /dev/null
@@ -1,6 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_erfl.c>
-long_double_symbol (libm, __erfl, erfl);
-long_double_symbol (libm, __erfcl, erfcl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_expm1l.c b/sysdeps/ieee754/ldbl-64-128/s_expm1l.c
deleted file mode 100644
index 4fb1861..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_expm1l.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_expm1l.c>
-long_double_symbol (libm, __expm1l, expm1l);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_fabsl.c b/sysdeps/ieee754/ldbl-64-128/s_fabsl.c
deleted file mode 100644
index 93d81d9..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_fabsl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_fabsl.c>
-long_double_symbol (libm, __fabsl, fabsl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_floorl.c b/sysdeps/ieee754/ldbl-64-128/s_floorl.c
deleted file mode 100644
index 9530430..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_floorl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_floorl.c>
-long_double_symbol (libm, __floorl, floorl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_fmal.c b/sysdeps/ieee754/ldbl-64-128/s_fmal.c
deleted file mode 100644
index 218aa52..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_fmal.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_fmal.c>
-long_double_symbol (libm, __fmal, fmal);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
index c7b6aaa..73ac41e 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_frexpl.c
@@ -1,9 +1,10 @@ 
 #include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+#include <libm-alias-ldouble.h>
+#if IS_IN (libc)
+# undef libm_alias_ldouble
+# define libm_alias_ldouble(from, to)
+#endif
 #include <sysdeps/ieee754/ldbl-128/s_frexpl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __frexpl, frexpl);
-#else
+#if IS_IN (libc)
 long_double_symbol (libc, __frexpl, frexpl);
 #endif
diff --git a/sysdeps/ieee754/ldbl-64-128/s_llrintl.c b/sysdeps/ieee754/ldbl-64-128/s_llrintl.c
deleted file mode 100644
index 1515f3a..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_llrintl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_llrintl.c>
-long_double_symbol (libm, __llrintl, llrintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_llroundl.c b/sysdeps/ieee754/ldbl-64-128/s_llroundl.c
deleted file mode 100644
index ca35dae..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_llroundl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_llroundl.c>
-long_double_symbol (libm, __llroundl, llroundl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_logbl.c b/sysdeps/ieee754/ldbl-64-128/s_logbl.c
deleted file mode 100644
index 8ba8179..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_logbl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_logbl.c>
-long_double_symbol (libm, __logbl, logbl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_lrintl.c b/sysdeps/ieee754/ldbl-64-128/s_lrintl.c
deleted file mode 100644
index 56e69c9..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_lrintl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_lrintl.c>
-long_double_symbol (libm, __lrintl, lrintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_lroundl.c b/sysdeps/ieee754/ldbl-64-128/s_lroundl.c
deleted file mode 100644
index d5429e2..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_lroundl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_lroundl.c>
-long_double_symbol (libm, __lroundl, lroundl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_modfl.c b/sysdeps/ieee754/ldbl-64-128/s_modfl.c
index fa4d3ad..7d7aeae 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_modfl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_modfl.c
@@ -1,9 +1,10 @@ 
 #include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
+#include <libm-alias-ldouble.h>
+#if IS_IN (libc)
+# undef libm_alias_ldouble
+# define libm_alias_ldouble(from, to)
+#endif
 #include <sysdeps/ieee754/ldbl-128/s_modfl.c>
-#if IS_IN (libm)
-long_double_symbol (libm, __modfl, modfl);
-#else
+#if IS_IN (libc)
 long_double_symbol (libc, __modfl, modfl);
 #endif
diff --git a/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c b/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c
deleted file mode 100644
index a6d0a31..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_nearbyintl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_nearbyintl.c>
-long_double_symbol (libm, __nearbyintl, nearbyintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_remquol.c b/sysdeps/ieee754/ldbl-64-128/s_remquol.c
deleted file mode 100644
index 16f0eb1..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_remquol.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_remquol.c>
-long_double_symbol (libm, __remquol, remquol);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_rintl.c b/sysdeps/ieee754/ldbl-64-128/s_rintl.c
deleted file mode 100644
index 19af9bb..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_rintl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_rintl.c>
-long_double_symbol (libm, __rintl, rintl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_roundl.c b/sysdeps/ieee754/ldbl-64-128/s_roundl.c
deleted file mode 100644
index 3fa99d6..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_roundl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_roundl.c>
-long_double_symbol (libm, __roundl, roundl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_sincosl.c b/sysdeps/ieee754/ldbl-64-128/s_sincosl.c
deleted file mode 100644
index ce0d4e2..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_sincosl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_sincosl.c>
-long_double_symbol (libm, __sincosl, sincosl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_sinl.c b/sysdeps/ieee754/ldbl-64-128/s_sinl.c
deleted file mode 100644
index ebc20af..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_sinl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_sinl.c>
-long_double_symbol (libm, __sinl, sinl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_tanhl.c b/sysdeps/ieee754/ldbl-64-128/s_tanhl.c
deleted file mode 100644
index ede9393..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_tanhl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_tanhl.c>
-long_double_symbol (libm, __tanhl, tanhl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_tanl.c b/sysdeps/ieee754/ldbl-64-128/s_tanl.c
deleted file mode 100644
index 6e635df..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_tanl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_tanl.c>
-long_double_symbol (libm, __tanl, tanl);
diff --git a/sysdeps/ieee754/ldbl-64-128/s_truncl.c b/sysdeps/ieee754/ldbl-64-128/s_truncl.c
deleted file mode 100644
index 6311479..0000000
--- a/sysdeps/ieee754/ldbl-64-128/s_truncl.c
+++ /dev/null
@@ -1,5 +0,0 @@ 
-#include <math_ldbl_opt.h>
-#undef weak_alias
-#define weak_alias(n,a)
-#include <sysdeps/ieee754/ldbl-128/s_truncl.c>
-long_double_symbol (libm, __truncl, truncl);