[PATCH] In _IEEE_LIBM mode, use symbol aliases instead of wrapper funcs [v4]

Keith Packard <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
When the math library is compiled to just use bare IEEE_LIBM mode,
many public functions are just wrappers around the __ieee754 version.
Eliminate the extra function by creating a symbol alias for the public
name directly from the ieee754 name.

v2:
	Use __weak_reference macro instead of using
	'__attribute__((weak, alias' to make this code portable
	to non-ELF systems.

v3:
	Use __strong_reference macro instead of __weak_reference to
	avoid changing the symbol in the resulting library. Make the
	use of this and the un-definition of the wrapper functions
	conditional on both the definition of _IEEE_LIBM and
	__strong_reference so that systems without the latter will
	still compile the wrapper functions and work properly.

v4:
	Use HAVE_ALIAS_ATTRIBUTE define instead of just checking for
	__strong_reference. This patch does not include any build
	system changes for this; those will need to be done by someone
	using autotools.

Signed-off-by: Keith Packard <[email protected]>

fixup for reference
---
 newlib/libm/math/e_acos.c       |  4 ++++
 newlib/libm/math/e_acosh.c      |  4 ++++
 newlib/libm/math/e_asin.c       |  4 ++++
 newlib/libm/math/e_atan2.c      |  4 ++++
 newlib/libm/math/e_atanh.c      |  4 ++++
 newlib/libm/math/e_cosh.c       |  4 ++++
 newlib/libm/math/e_exp.c        |  4 ++++
 newlib/libm/math/e_fmod.c       |  4 ++++
 newlib/libm/math/e_hypot.c      |  4 ++++
 newlib/libm/math/e_j0.c         |  8 ++++++++
 newlib/libm/math/e_j1.c         |  8 ++++++++
 newlib/libm/math/e_jn.c         |  8 ++++++++
 newlib/libm/math/e_log.c        |  4 ++++
 newlib/libm/math/e_log10.c      |  4 ++++
 newlib/libm/math/e_pow.c        |  4 ++++
 newlib/libm/math/e_rem_pio2.c   |  4 ++++
 newlib/libm/math/e_remainder.c  |  4 ++++
 newlib/libm/math/e_scalb.c      |  4 ++++
 newlib/libm/math/e_sinh.c       |  4 ++++
 newlib/libm/math/e_sqrt.c       |  4 ++++
 newlib/libm/math/ef_acos.c      |  4 ++++
 newlib/libm/math/ef_acosh.c     |  4 ++++
 newlib/libm/math/ef_asin.c      |  4 ++++
 newlib/libm/math/ef_atan2.c     |  4 ++++
 newlib/libm/math/ef_atanh.c     |  4 ++++
 newlib/libm/math/ef_cosh.c      |  4 ++++
 newlib/libm/math/ef_exp.c       |  4 ++++
 newlib/libm/math/ef_fmod.c      |  4 ++++
 newlib/libm/math/ef_hypot.c     |  4 ++++
 newlib/libm/math/ef_j0.c        |  8 ++++++++
 newlib/libm/math/ef_j1.c        |  8 ++++++++
 newlib/libm/math/ef_jn.c        |  8 ++++++++
 newlib/libm/math/ef_log.c       |  4 ++++
 newlib/libm/math/ef_log10.c     |  4 ++++
 newlib/libm/math/ef_pow.c       |  4 ++++
 newlib/libm/math/ef_rem_pio2.c  |  4 ++++
 newlib/libm/math/ef_remainder.c |  4 ++++
 newlib/libm/math/ef_scalb.c     |  4 ++++
 newlib/libm/math/ef_sinh.c      |  4 ++++
 newlib/libm/math/ef_sqrt.c      |  4 ++++
 newlib/libm/math/el_hypot.c     |  4 ++++
 newlib/libm/math/er_gamma.c     |  4 ++++
 newlib/libm/math/er_lgamma.c    |  4 ++++
 newlib/libm/math/erf_gamma.c    |  4 ++++
 newlib/libm/math/erf_lgamma.c   |  4 ++++
 newlib/libm/math/w_acos.c       |  6 ++----
 newlib/libm/math/w_acosh.c      |  7 +++----
 newlib/libm/math/w_asin.c       |  6 ++----
 newlib/libm/math/w_atanh.c      | 10 ++--------
 newlib/libm/math/w_cosh.c       |  8 +++-----
 newlib/libm/math/w_exp.c        |  6 ++----
 newlib/libm/math/w_fmod.c       |  6 ++----
 newlib/libm/math/w_hypot.c      |  6 ++----
 newlib/libm/math/w_j0.c         | 12 ++++--------
 newlib/libm/math/w_j1.c         | 12 ++++--------
 newlib/libm/math/w_jn.c         | 12 ++++--------
 newlib/libm/math/w_log.c        |  6 ++----
 newlib/libm/math/w_log10.c      |  6 ++----
 newlib/libm/math/w_pow.c        |  6 ++----
 newlib/libm/math/w_remainder.c  |  6 ++----
 newlib/libm/math/w_scalb.c      |  7 +++----
 newlib/libm/math/w_sinh.c       |  6 ++----
 newlib/libm/math/w_sqrt.c       |  6 ++----
 newlib/libm/math/wf_acos.c      |  6 ++----
 newlib/libm/math/wf_acosh.c     |  6 ++----
 newlib/libm/math/wf_asin.c      |  6 ++----
 newlib/libm/math/wf_atanh.c     |  6 ++----
 newlib/libm/math/wf_cosh.c      |  6 ++----
 newlib/libm/math/wf_exp.c       |  6 ++----
 newlib/libm/math/wf_fmod.c      |  6 ++----
 newlib/libm/math/wf_gamma.c     |  6 ++----
 newlib/libm/math/wf_hypot.c     |  6 ++----
 newlib/libm/math/wf_j0.c        | 12 ++++--------
 newlib/libm/math/wf_j1.c        | 12 ++++--------
 newlib/libm/math/wf_jn.c        | 12 ++++--------
 newlib/libm/math/wf_lgamma.c    |  6 ++----
 newlib/libm/math/wf_log.c       |  6 ++----
 newlib/libm/math/wf_log10.c     |  6 ++----
 newlib/libm/math/wf_pow.c       |  6 ++----
 newlib/libm/math/wf_remainder.c |  6 ++----
 newlib/libm/math/wf_scalb.c     |  6 ++----
 newlib/libm/math/wf_sinh.c      |  6 ++----
 newlib/libm/math/wf_sqrt.c      |  6 ++----
 newlib/libm/math/wr_gamma.c     |  6 ++----
 newlib/libm/math/wr_lgamma.c    |  6 ++----
 newlib/libm/math/wrf_gamma.c    |  6 ++----
 newlib/libm/math/wrf_lgamma.c   |  6 ++----
 87 files changed, 303 insertions(+), 197 deletions(-)

diff --git a/newlib/libm/math/e_acos.c b/newlib/libm/math/e_acos.c
index 319b1d56f..d44550008 100644
--- a/newlib/libm/math/e_acos.c
+++ b/newlib/libm/math/e_acos.c
@@ -59,6 +59,10 @@ qS2 =  2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */
 qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */
 qS4 =  7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_acos, acos);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_acos(double x)
 #else
diff --git a/newlib/libm/math/e_acosh.c b/newlib/libm/math/e_acosh.c
index 27984eb23..08422028e 100644
--- a/newlib/libm/math/e_acosh.c
+++ b/newlib/libm/math/e_acosh.c
@@ -38,6 +38,10 @@ static double
 one	= 1.0,
 ln2	= 6.93147180559945286227e-01;  /* 0x3FE62E42, 0xFEFA39EF */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_acosh, acosh);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_acosh(double x)
 #else
diff --git a/newlib/libm/math/e_asin.c b/newlib/libm/math/e_asin.c
index 4b6f45e15..38c388e64 100644
--- a/newlib/libm/math/e_asin.c
+++ b/newlib/libm/math/e_asin.c
@@ -68,6 +68,10 @@ qS2 =  2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */
 qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */
 qS4 =  7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_asin, asin);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_asin(double x)
 #else
diff --git a/newlib/libm/math/e_atan2.c b/newlib/libm/math/e_atan2.c
index 8e9650f29..7f1ce6393 100644
--- a/newlib/libm/math/e_atan2.c
+++ b/newlib/libm/math/e_atan2.c
@@ -55,6 +55,10 @@ pi_o_2  = 1.5707963267948965580E+00, /* 0x3FF921FB, 0x54442D18 */
 pi      = 3.1415926535897931160E+00, /* 0x400921FB, 0x54442D18 */
 pi_lo   = 1.2246467991473531772E-16; /* 0x3CA1A626, 0x33145C07 */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_atan2, atan2);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_atan2(double y, double x)
 #else
diff --git a/newlib/libm/math/e_atanh.c b/newlib/libm/math/e_atanh.c
index 58ad325f9..e9c5b057c 100644
--- a/newlib/libm/math/e_atanh.c
+++ b/newlib/libm/math/e_atanh.c
@@ -46,6 +46,10 @@ static const double zero = 0.0;
 static double zero = 0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_atanh, atanh);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_atanh(double x)
 #else
diff --git a/newlib/libm/math/e_cosh.c b/newlib/libm/math/e_cosh.c
index a6310bd07..b185cba2e 100644
--- a/newlib/libm/math/e_cosh.c
+++ b/newlib/libm/math/e_cosh.c
@@ -42,6 +42,10 @@ static const double one = 1.0, half=0.5, huge = 1.0e300;
 static double one = 1.0, half=0.5, huge = 1.0e300;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_cosh, cosh);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_cosh(double x)
 #else
diff --git a/newlib/libm/math/e_exp.c b/newlib/libm/math/e_exp.c
index 81ea64dfb..9a41f4750 100644
--- a/newlib/libm/math/e_exp.c
+++ b/newlib/libm/math/e_exp.c
@@ -102,6 +102,10 @@ P4   = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
 P5   =  4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
 
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_exp, exp);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_exp(double x)	/* default IEEE double exp */
 #else
diff --git a/newlib/libm/math/e_fmod.c b/newlib/libm/math/e_fmod.c
index f9739eec2..17dbaae94 100644
--- a/newlib/libm/math/e_fmod.c
+++ b/newlib/libm/math/e_fmod.c
@@ -27,6 +27,10 @@ static const double one = 1.0, Zero[] = {0.0, -0.0,};
 static double one = 1.0, Zero[] = {0.0, -0.0,};
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_fmod, fmod);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_fmod(double x, double y)
 #else
diff --git a/newlib/libm/math/e_hypot.c b/newlib/libm/math/e_hypot.c
index 03f7f51e5..8d256ff65 100644
--- a/newlib/libm/math/e_hypot.c
+++ b/newlib/libm/math/e_hypot.c
@@ -47,6 +47,10 @@
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_hypot, hypot);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_hypot(double x, double y)
 #else
diff --git a/newlib/libm/math/e_j0.c b/newlib/libm/math/e_j0.c
index 13773cbf9..2bbfef3e5 100644
--- a/newlib/libm/math/e_j0.c
+++ b/newlib/libm/math/e_j0.c
@@ -91,6 +91,10 @@ static const double zero = 0.0;
 static double zero = 0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_j0, j0);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_j0(double x) 
 #else
@@ -160,6 +164,10 @@ v02  =  7.60068627350353253702e-05, /* 0x3F13ECBB, 0xF578C6C1 */
 v03  =  2.59150851840457805467e-07, /* 0x3E91642D, 0x7FF202FD */
 v04  =  4.41110311332675467403e-10; /* 0x3DFE5018, 0x3BD6D9EF */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_y0, y0);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_y0(double x) 
 #else
diff --git a/newlib/libm/math/e_j1.c b/newlib/libm/math/e_j1.c
index 098eb569e..afde51d33 100644
--- a/newlib/libm/math/e_j1.c
+++ b/newlib/libm/math/e_j1.c
@@ -92,6 +92,10 @@ static const double zero    = 0.0;
 static double zero    = 0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_j1, j1);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_j1(double x) 
 #else
@@ -161,6 +165,10 @@ static double V0[5] = {
   1.66559246207992079114e-11, /* 0x3DB25039, 0xDACA772A */
 };
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_y1, y1);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_y1(double x) 
 #else
diff --git a/newlib/libm/math/e_jn.c b/newlib/libm/math/e_jn.c
index 1eea27be0..80333bb92 100644
--- a/newlib/libm/math/e_jn.c
+++ b/newlib/libm/math/e_jn.c
@@ -56,6 +56,10 @@ static const double zero  =  0.00000000000000000000e+00;
 static double zero  =  0.00000000000000000000e+00;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_jn, jn);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_jn(int n, double x)
 #else
@@ -216,6 +220,10 @@ static double zero  =  0.00000000000000000000e+00;
 	if(sgn==1) return -b; else return b;
 }
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_yn, yn);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_yn(int n, double x) 
 #else
diff --git a/newlib/libm/math/e_log.c b/newlib/libm/math/e_log.c
index ac4a95068..8f1693533 100644
--- a/newlib/libm/math/e_log.c
+++ b/newlib/libm/math/e_log.c
@@ -89,6 +89,10 @@ static const double zero   =  0.0;
 static double zero   =  0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_log, log);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_log(double x)
 #else
diff --git a/newlib/libm/math/e_log10.c b/newlib/libm/math/e_log10.c
index f7daaa1b2..0671abb3a 100644
--- a/newlib/libm/math/e_log10.c
+++ b/newlib/libm/math/e_log10.c
@@ -64,6 +64,10 @@ static const double zero   =  0.0;
 static double zero   =  0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_log10, log10);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_log10(double x)
 #else
diff --git a/newlib/libm/math/e_pow.c b/newlib/libm/math/e_pow.c
index 6d2a501a1..b898f3eeb 100644
--- a/newlib/libm/math/e_pow.c
+++ b/newlib/libm/math/e_pow.c
@@ -99,6 +99,10 @@ ivln2    =  1.44269504088896338700e+00, /* 0x3FF71547, 0x652B82FE =1/ln2 */
 ivln2_h  =  1.44269502162933349609e+00, /* 0x3FF71547, 0x60000000 =24b 1/ln2*/
 ivln2_l  =  1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_pow, pow);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_pow(double x, double y)
 #else
diff --git a/newlib/libm/math/e_rem_pio2.c b/newlib/libm/math/e_rem_pio2.c
index ddfecba2d..9bae56102 100644
--- a/newlib/libm/math/e_rem_pio2.c
+++ b/newlib/libm/math/e_rem_pio2.c
@@ -82,6 +82,10 @@ pio2_2t =  2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */
 pio2_3  =  2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */
 pio2_3t =  8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_rem_pio2, rem_pio2);
+#endif
+
 #ifdef __STDC__
 	__int32_t __ieee754_rem_pio2(double x, double *y)
 #else
diff --git a/newlib/libm/math/e_remainder.c b/newlib/libm/math/e_remainder.c
index ae7ce649a..f7c5f2d5c 100644
--- a/newlib/libm/math/e_remainder.c
+++ b/newlib/libm/math/e_remainder.c
@@ -31,6 +31,10 @@ static double zero = 0.0;
 #endif
 
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_remainder, remainder);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_remainder(double x, double p)
 #else
diff --git a/newlib/libm/math/e_scalb.c b/newlib/libm/math/e_scalb.c
index 4d8bb8b71..cbb42f590 100644
--- a/newlib/libm/math/e_scalb.c
+++ b/newlib/libm/math/e_scalb.c
@@ -21,6 +21,10 @@
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_scalb, scalb);
+#endif
+
 #ifdef _SCALB_INT
 #ifdef __STDC__
 	double __ieee754_scalb(double x, int fn)
diff --git a/newlib/libm/math/e_sinh.c b/newlib/libm/math/e_sinh.c
index cf7ebfb88..b4f8ba235 100644
--- a/newlib/libm/math/e_sinh.c
+++ b/newlib/libm/math/e_sinh.c
@@ -39,6 +39,10 @@ static const double one = 1.0, shuge = 1.0e307;
 static double one = 1.0, shuge = 1.0e307;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_sinh, sinh);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_sinh(double x)
 #else
diff --git a/newlib/libm/math/e_sqrt.c b/newlib/libm/math/e_sqrt.c
index 78fc52417..7d68312c9 100644
--- a/newlib/libm/math/e_sqrt.c
+++ b/newlib/libm/math/e_sqrt.c
@@ -91,6 +91,10 @@ static	const double	one	= 1.0, tiny=1.0e-300;
 static	double	one	= 1.0, tiny=1.0e-300;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_sqrt, sqrt);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_sqrt(double x)
 #else
diff --git a/newlib/libm/math/ef_acos.c b/newlib/libm/math/ef_acos.c
index f73f97de7..d52b9aa8e 100644
--- a/newlib/libm/math/ef_acos.c
+++ b/newlib/libm/math/ef_acos.c
@@ -35,6 +35,10 @@ qS2 =  2.0209457874e+00, /* 0x4001572d */
 qS3 = -6.8828397989e-01, /* 0xbf303361 */
 qS4 =  7.7038154006e-02; /* 0x3d9dc62e */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_acosf, acosf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_acosf(float x)
 #else
diff --git a/newlib/libm/math/ef_acosh.c b/newlib/libm/math/ef_acosh.c
index 1119c2c86..398aff53f 100644
--- a/newlib/libm/math/ef_acosh.c
+++ b/newlib/libm/math/ef_acosh.c
@@ -24,6 +24,10 @@ static float
 one	= 1.0,
 ln2	= 6.9314718246e-01;  /* 0x3f317218 */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_acoshf, acoshf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_acoshf(float x)
 #else
diff --git a/newlib/libm/math/ef_asin.c b/newlib/libm/math/ef_asin.c
index c49dcbbca..42f8ea7c2 100644
--- a/newlib/libm/math/ef_asin.c
+++ b/newlib/libm/math/ef_asin.c
@@ -37,6 +37,10 @@ qS2 =  2.0209457874e+00, /* 0x4001572d */
 qS3 = -6.8828397989e-01, /* 0xbf303361 */
 qS4 =  7.7038154006e-02; /* 0x3d9dc62e */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_asinf, asinf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_asinf(float x)
 #else
diff --git a/newlib/libm/math/ef_atan2.c b/newlib/libm/math/ef_atan2.c
index d57480b03..cfc3c7c95 100644
--- a/newlib/libm/math/ef_atan2.c
+++ b/newlib/libm/math/ef_atan2.c
@@ -28,6 +28,10 @@ pi_o_2  = 1.5707963705e+00, /* 0x3fc90fdb */
 pi      = 3.1415927410e+00,  /* 0x40490fdb */
 pi_lo   = -8.7422776573e-08; /* 0xb3bbbd2e */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_atan2f, atan2f);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_atan2f(float y, float x)
 #else
diff --git a/newlib/libm/math/ef_atanh.c b/newlib/libm/math/ef_atanh.c
index 74b3d3d6a..d878971bb 100644
--- a/newlib/libm/math/ef_atanh.c
+++ b/newlib/libm/math/ef_atanh.c
@@ -28,6 +28,10 @@ static const float zero = 0.0;
 static float zero = 0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_atanhf, atanhf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_atanhf(float x)
 #else
diff --git a/newlib/libm/math/ef_cosh.c b/newlib/libm/math/ef_cosh.c
index bdce61a00..515bdc61a 100644
--- a/newlib/libm/math/ef_cosh.c
+++ b/newlib/libm/math/ef_cosh.c
@@ -25,6 +25,10 @@ static const float one = 1.0, half=0.5, huge = 1.0e30;
 static float one = 1.0, half=0.5, huge = 1.0e30;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_coshf, coshf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_coshf(float x)
 #else
diff --git a/newlib/libm/math/ef_exp.c b/newlib/libm/math/ef_exp.c
index e817370ac..46d0e24a1 100644
--- a/newlib/libm/math/ef_exp.c
+++ b/newlib/libm/math/ef_exp.c
@@ -40,6 +40,10 @@ P3   =  6.6137559770e-05, /* 0x388ab355 */
 P4   = -1.6533901999e-06, /* 0xb5ddea0e */
 P5   =  4.1381369442e-08; /* 0x3331bb4c */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_expf, expf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_expf(float x)	/* default IEEE double exp */
 #else
diff --git a/newlib/libm/math/ef_fmod.c b/newlib/libm/math/ef_fmod.c
index 53c1ba280..deab04c51 100644
--- a/newlib/libm/math/ef_fmod.c
+++ b/newlib/libm/math/ef_fmod.c
@@ -27,6 +27,10 @@ static const float one = 1.0, Zero[] = {0.0, -0.0,};
 static float one = 1.0, Zero[] = {0.0, -0.0,};
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_fmodf, fmodf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_fmodf(float x, float y)
 #else
diff --git a/newlib/libm/math/ef_hypot.c b/newlib/libm/math/ef_hypot.c
index 9368eb41c..194690ebf 100644
--- a/newlib/libm/math/ef_hypot.c
+++ b/newlib/libm/math/ef_hypot.c
@@ -15,6 +15,10 @@
 
 #include "fdlibm.h"
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_hypotf, hypotf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_hypotf(float x, float y)
 #else
diff --git a/newlib/libm/math/ef_j0.c b/newlib/libm/math/ef_j0.c
index 866cfcf96..8883a7665 100644
--- a/newlib/libm/math/ef_j0.c
+++ b/newlib/libm/math/ef_j0.c
@@ -46,6 +46,10 @@ static const float zero = 0.0;
 static float zero = 0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_j0f, j0f);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_j0f(float x) 
 #else
@@ -115,6 +119,10 @@ v02  =  7.6006865129e-05, /* 0x389f65e0 */
 v03  =  2.5915085189e-07, /* 0x348b216c */
 v04  =  4.4111031494e-10; /* 0x2ff280c2 */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_y0f, y0f);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_y0f(float x) 
 #else
diff --git a/newlib/libm/math/ef_j1.c b/newlib/libm/math/ef_j1.c
index 01bd24cf1..2db8ac7b8 100644
--- a/newlib/libm/math/ef_j1.c
+++ b/newlib/libm/math/ef_j1.c
@@ -47,6 +47,10 @@ static const float zero    = 0.0;
 static float zero    = 0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_j1f, j1f);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_j1f(float x) 
 #else
@@ -116,6 +120,10 @@ static float V0[5] = {
   1.6655924903e-11, /* 0x2d9281cf */
 };
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_y1f, y1f);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_y1f(float x) 
 #else
diff --git a/newlib/libm/math/ef_jn.c b/newlib/libm/math/ef_jn.c
index e872c09c7..8275b361e 100644
--- a/newlib/libm/math/ef_jn.c
+++ b/newlib/libm/math/ef_jn.c
@@ -29,6 +29,10 @@ static const float zero  =  0.0000000000e+00;
 static float zero  =  0.0000000000e+00;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_jnf, jnf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_jnf(int n, float x)
 #else
@@ -166,6 +170,10 @@ static float zero  =  0.0000000000e+00;
 	if(sgn==1) return -b; else return b;
 }
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_ynf, ynf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_ynf(int n, float x) 
 #else
diff --git a/newlib/libm/math/ef_log.c b/newlib/libm/math/ef_log.c
index 8dc902478..eb425f009 100644
--- a/newlib/libm/math/ef_log.c
+++ b/newlib/libm/math/ef_log.c
@@ -38,6 +38,10 @@ static const float zero   =  0.0;
 static float zero   =  0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_logf, logf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_logf(float x)
 #else
diff --git a/newlib/libm/math/ef_log10.c b/newlib/libm/math/ef_log10.c
index 5ab23c43f..fef1bca33 100644
--- a/newlib/libm/math/ef_log10.c
+++ b/newlib/libm/math/ef_log10.c
@@ -31,6 +31,10 @@ static const float zero   =  0.0;
 static float zero   =  0.0;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_log10f, log10f);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_log10f(float x)
 #else
diff --git a/newlib/libm/math/ef_pow.c b/newlib/libm/math/ef_pow.c
index 524e3f9b0..204086791 100644
--- a/newlib/libm/math/ef_pow.c
+++ b/newlib/libm/math/ef_pow.c
@@ -57,6 +57,10 @@ ivln2    =  1.4426950216e+00, /* 0x3fb8aa3b =1/ln2 */
 ivln2_h  =  1.4426879883e+00, /* 0x3fb8aa00 =16b 1/ln2*/
 ivln2_l  =  7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_powf, powf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_powf(float x, float y)
 #else
diff --git a/newlib/libm/math/ef_rem_pio2.c b/newlib/libm/math/ef_rem_pio2.c
index f1191d09f..16de1d025 100644
--- a/newlib/libm/math/ef_rem_pio2.c
+++ b/newlib/libm/math/ef_rem_pio2.c
@@ -95,6 +95,10 @@ pio2_2t =  6.0770999344e-11, /* 0x2e85a308 */
 pio2_3  =  6.0770943833e-11, /* 0x2e85a300 */
 pio2_3t =  6.1232342629e-17; /* 0x248d3132 */
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_rem_pio2f, rem_pio2f);
+#endif
+
 #ifdef __STDC__
 	__int32_t __ieee754_rem_pio2f(float x, float *y)
 #else
diff --git a/newlib/libm/math/ef_remainder.c b/newlib/libm/math/ef_remainder.c
index 23d29d05a..11aa38166 100644
--- a/newlib/libm/math/ef_remainder.c
+++ b/newlib/libm/math/ef_remainder.c
@@ -22,6 +22,10 @@ static float zero = 0.0;
 #endif
 
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_remainderf, remainderf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_remainderf(float x, float p)
 #else
diff --git a/newlib/libm/math/ef_scalb.c b/newlib/libm/math/ef_scalb.c
index 8d973b1e7..d727ff5a8 100644
--- a/newlib/libm/math/ef_scalb.c
+++ b/newlib/libm/math/ef_scalb.c
@@ -16,6 +16,10 @@
 #include "fdlibm.h"
 #include <limits.h>
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_scalbf, scalbf);
+#endif
+
 #ifdef _SCALB_INT
 #ifdef __STDC__
 	float __ieee754_scalbf(float x, int fn)
diff --git a/newlib/libm/math/ef_sinh.c b/newlib/libm/math/ef_sinh.c
index a61b17294..b19b0a7b1 100644
--- a/newlib/libm/math/ef_sinh.c
+++ b/newlib/libm/math/ef_sinh.c
@@ -15,6 +15,10 @@
 
 #include "fdlibm.h"
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_sinhf, sinhf);
+#endif
+
 #ifdef __STDC__
 static const float one = 1.0, shuge = 1.0e37;
 #else
diff --git a/newlib/libm/math/ef_sqrt.c b/newlib/libm/math/ef_sqrt.c
index 80e7f360e..8b9b6dc49 100644
--- a/newlib/libm/math/ef_sqrt.c
+++ b/newlib/libm/math/ef_sqrt.c
@@ -21,6 +21,10 @@ static	const float	one	= 1.0, tiny=1.0e-30;
 static	float	one	= 1.0, tiny=1.0e-30;
 #endif
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_sqrtf, sqrtf);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_sqrtf(float x)
 #else
diff --git a/newlib/libm/math/el_hypot.c b/newlib/libm/math/el_hypot.c
index 737cde36b..de8899cdc 100644
--- a/newlib/libm/math/el_hypot.c
+++ b/newlib/libm/math/el_hypot.c
@@ -6,6 +6,10 @@
 
 #include "fdlibm.h"
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_hypotl, hypotl);
+#endif
+
 long double
 __ieee754_hypotl (long double x, long double y)
 {
diff --git a/newlib/libm/math/er_gamma.c b/newlib/libm/math/er_gamma.c
index 3c0e241e5..d88390530 100644
--- a/newlib/libm/math/er_gamma.c
+++ b/newlib/libm/math/er_gamma.c
@@ -21,6 +21,10 @@
 
 #include "fdlibm.h"
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_gamma_r, gamma_r);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_gamma_r(double x, int *signgamp)
 #else
diff --git a/newlib/libm/math/er_lgamma.c b/newlib/libm/math/er_lgamma.c
index 386a8a73b..fd4a6aaad 100644
--- a/newlib/libm/math/er_lgamma.c
+++ b/newlib/libm/math/er_lgamma.c
@@ -209,6 +209,10 @@ static double zero=  0.00000000000000000000e+00;
 }
 
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_lgamma_r, lgamma_r);
+#endif
+
 #ifdef __STDC__
 	double __ieee754_lgamma_r(double x, int *signgamp)
 #else
diff --git a/newlib/libm/math/erf_gamma.c b/newlib/libm/math/erf_gamma.c
index 9e529dce0..b4bfde188 100644
--- a/newlib/libm/math/erf_gamma.c
+++ b/newlib/libm/math/erf_gamma.c
@@ -23,6 +23,10 @@
 
 #include "fdlibm.h"
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_gammaf_r, gammaf_r);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_gammaf_r(float x, int *signgamp)
 #else
diff --git a/newlib/libm/math/erf_lgamma.c b/newlib/libm/math/erf_lgamma.c
index 3c6ba02af..775b54370 100644
--- a/newlib/libm/math/erf_lgamma.c
+++ b/newlib/libm/math/erf_lgamma.c
@@ -144,6 +144,10 @@ static float zero=  0.0000000000e+00;
 }
 
 
+#if defined(_IEEE_LIBM) && defined(HAVE_ALIAS_ATTRIBUTE)
+__strong_reference(__ieee754_lgammaf_r, lgammaf_r);
+#endif
+
 #ifdef __STDC__
 	float __ieee754_lgammaf_r(float x, int *signgamp)
 #else
diff --git a/newlib/libm/math/w_acos.c b/newlib/libm/math/w_acos.c
index eb3e20111..908fe4bf7 100644
--- a/newlib/libm/math/w_acos.c
+++ b/newlib/libm/math/w_acos.c
@@ -70,6 +70,7 @@ MATHREF
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifndef _DOUBLE_IS_32BITS
 
 #ifdef __STDC__
@@ -79,9 +80,6 @@ MATHREF
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_acos(x);
-#else
 	double z;
        	struct exception exc;
        	z = __ieee754_acos(x);
@@ -103,7 +101,7 @@ MATHREF
 	    return exc.retval; 
 	} else
 	    return z;
-#endif
 }
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
+#endif /* defined(_IEEE_LIBM) */
diff --git a/newlib/libm/math/w_acosh.c b/newlib/libm/math/w_acosh.c
index ac15bb1bd..01813ac3f 100644
--- a/newlib/libm/math/w_acosh.c
+++ b/newlib/libm/math/w_acosh.c
@@ -76,6 +76,8 @@ MATHREF
 #include "fdlibm.h"
 #include <errno.h>
 
+
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifndef _DOUBLE_IS_32BITS
 
 #ifdef __STDC__
@@ -85,9 +87,6 @@ MATHREF
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_acosh(x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_acosh(x);
@@ -109,7 +108,7 @@ MATHREF
 	    return exc.retval; 
 	} else
 	    return z;
-#endif
 }
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
+#endif /* defined(_IEEE_LIBM) */
diff --git a/newlib/libm/math/w_asin.c b/newlib/libm/math/w_asin.c
index 9964d75b0..bbdb9ddab 100644
--- a/newlib/libm/math/w_asin.c
+++ b/newlib/libm/math/w_asin.c
@@ -76,6 +76,7 @@ MATHREF
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double asin(double x)		/* wrapper asin */
 #else
@@ -83,9 +84,6 @@ MATHREF
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_asin(x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_asin(x);
@@ -107,7 +105,7 @@ MATHREF
 	    return exc.retval; 
 	} else
 	    return z;
-#endif
 }
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
+#endif
diff --git a/newlib/libm/math/w_atanh.c b/newlib/libm/math/w_atanh.c
index a87e23cc4..43bd1a4ce 100644
--- a/newlib/libm/math/w_atanh.c
+++ b/newlib/libm/math/w_atanh.c
@@ -74,6 +74,7 @@ QUICKREF
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifndef _DOUBLE_IS_32BITS
 
 #ifdef __STDC__
@@ -83,9 +84,6 @@ QUICKREF
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_atanh(x);
-#else
 	double z,y;
 	struct exception exc;
 	z = __ieee754_atanh(x);
@@ -122,11 +120,7 @@ QUICKREF
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
-
-
-
-
+#endif
diff --git a/newlib/libm/math/w_cosh.c b/newlib/libm/math/w_cosh.c
index e5b08df00..5c481cd4d 100644
--- a/newlib/libm/math/w_cosh.c
+++ b/newlib/libm/math/w_cosh.c
@@ -60,8 +60,9 @@ QUICKREF
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifndef _DOUBLE_IS_32BITS
- 
+
 #ifdef __STDC__
 	double cosh(double x)		/* wrapper cosh */
 #else
@@ -69,9 +70,6 @@ QUICKREF
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_cosh(x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_cosh(x);
@@ -102,7 +100,7 @@ QUICKREF
 	    return exc.retval; 
 	} else
 	    return z;
-#endif
 }
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
+#endif
diff --git a/newlib/libm/math/w_exp.c b/newlib/libm/math/w_exp.c
index 0c4467712..bfdc96c73 100644
--- a/newlib/libm/math/w_exp.c
+++ b/newlib/libm/math/w_exp.c
@@ -58,6 +58,7 @@ PORTABILITY
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 static const double
 #else
@@ -73,9 +74,6 @@ u_threshold= -7.45133219101941108420e+02;  /* 0xc0874910, 0xD52D3051 */
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_exp(x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_exp(x);
@@ -123,8 +121,8 @@ u_threshold= -7.45133219101941108420e+02;  /* 0xc0874910, 0xD52D3051 */
 	    } 
 	} 
 	return z;
-#endif
 }
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
+#endif
 #endif /* __OBSOLETE_MATH */
diff --git a/newlib/libm/math/w_fmod.c b/newlib/libm/math/w_fmod.c
index df11dc34c..7a8b416c6 100644
--- a/newlib/libm/math/w_fmod.c
+++ b/newlib/libm/math/w_fmod.c
@@ -58,6 +58,7 @@ PORTABILITY
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double fmod(double x, double y)	/* wrapper fmod */
 #else
@@ -65,9 +66,6 @@ PORTABILITY
 	double x,y;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_fmod(x,y);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_fmod(x,y);
@@ -93,7 +91,7 @@ PORTABILITY
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/newlib/libm/math/w_hypot.c b/newlib/libm/math/w_hypot.c
index 533702277..47831192b 100644
--- a/newlib/libm/math/w_hypot.c
+++ b/newlib/libm/math/w_hypot.c
@@ -55,6 +55,7 @@ PORTABILITY
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double hypot(double x, double y)/* wrapper hypot */
 #else
@@ -62,9 +63,6 @@ PORTABILITY
 	double x,y;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_hypot(x,y);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_hypot(x,y);
@@ -96,7 +94,7 @@ PORTABILITY
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/newlib/libm/math/w_j0.c b/newlib/libm/math/w_j0.c
index ab05dbdeb..6b1288c4c 100644
--- a/newlib/libm/math/w_j0.c
+++ b/newlib/libm/math/w_j0.c
@@ -94,6 +94,7 @@ None of the Bessel functions are in ANSI C.
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double j0(double x)		/* wrapper j0 */
 #else
@@ -101,9 +102,6 @@ None of the Bessel functions are in ANSI C.
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_j0(x);
-#else
 	struct exception exc;
 	double z = __ieee754_j0(x);
 	if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
@@ -124,9 +122,10 @@ None of the Bessel functions are in ANSI C.
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double y0(double x)		/* wrapper y0 */
 #else
@@ -134,9 +133,6 @@ None of the Bessel functions are in ANSI C.
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_y0(x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_y0(x);
@@ -183,8 +179,8 @@ None of the Bessel functions are in ANSI C.
 	    return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
 
diff --git a/newlib/libm/math/w_j1.c b/newlib/libm/math/w_j1.c
index ba7df1566..23c289963 100644
--- a/newlib/libm/math/w_j1.c
+++ b/newlib/libm/math/w_j1.c
@@ -20,6 +20,7 @@
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double j1(double x)		/* wrapper j1 */
 #else
@@ -27,9 +28,6 @@
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_j1(x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_j1(x);
@@ -51,9 +49,10 @@
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double y1(double x)		/* wrapper y1 */
 #else
@@ -61,9 +60,6 @@
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_y1(x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_y1(x);
@@ -110,8 +106,8 @@
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
 
diff --git a/newlib/libm/math/w_jn.c b/newlib/libm/math/w_jn.c
index 6cadc9a01..f8d072bd6 100644
--- a/newlib/libm/math/w_jn.c
+++ b/newlib/libm/math/w_jn.c
@@ -42,6 +42,7 @@
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double jn(int n, double x)	/* wrapper jn */
 #else
@@ -49,9 +50,6 @@
 	double x; int n;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_jn(n,x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_jn(n,x);
@@ -74,9 +72,10 @@
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double yn(int n, double x)	/* wrapper yn */
 #else
@@ -84,9 +83,6 @@
 	double x; int n;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_yn(n,x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_yn(n,x);
@@ -135,7 +131,7 @@
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/newlib/libm/math/w_log.c b/newlib/libm/math/w_log.c
index 5f66d26ad..088dd2129 100644
--- a/newlib/libm/math/w_log.c
+++ b/newlib/libm/math/w_log.c
@@ -54,6 +54,7 @@ PORTABILITY
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double log(double x)		/* wrapper log */
 #else
@@ -61,9 +62,6 @@ PORTABILITY
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_log(x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_log(x);
@@ -103,8 +101,8 @@ PORTABILITY
 	if (exc.err != 0)
            errno = exc.err;
         return exc.retval; 
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
 #endif /* __OBSOLETE_MATH */
diff --git a/newlib/libm/math/w_log10.c b/newlib/libm/math/w_log10.c
index 3b436d539..baa33cb55 100644
--- a/newlib/libm/math/w_log10.c
+++ b/newlib/libm/math/w_log10.c
@@ -50,6 +50,7 @@ PORTABILITY
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double log10(double x)		/* wrapper log10 */
 #else
@@ -57,9 +58,6 @@ PORTABILITY
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_log10(x);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_log10(x);
@@ -102,7 +100,7 @@ PORTABILITY
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/newlib/libm/math/w_pow.c b/newlib/libm/math/w_pow.c
index 9d1e396a5..6252fab7c 100644
--- a/newlib/libm/math/w_pow.c
+++ b/newlib/libm/math/w_pow.c
@@ -57,6 +57,7 @@ PORTABILITY
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double pow(double x, double y)	/* wrapper pow */
 #else
@@ -64,9 +65,6 @@ PORTABILITY
 	double x,y;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return  __ieee754_pow(x,y);
-#else
 	double z;
 #ifndef HUGE_VAL 
 #define HUGE_VAL inf
@@ -204,8 +202,8 @@ PORTABILITY
             return exc.retval; 
         } 
 	return z;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
 #endif /* __OBSOLETE_MATH */
diff --git a/newlib/libm/math/w_remainder.c b/newlib/libm/math/w_remainder.c
index 5b13390f9..9a7f901e4 100644
--- a/newlib/libm/math/w_remainder.c
+++ b/newlib/libm/math/w_remainder.c
@@ -46,6 +46,7 @@ PORTABILITY
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double remainder(double x, double y)	/* wrapper remainder */
 #else
@@ -53,9 +54,6 @@ PORTABILITY
 	double x,y;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_remainder(x,y);
-#else
 	double z;
 	struct exception exc;
 	z = __ieee754_remainder(x,y);
@@ -78,8 +76,8 @@ PORTABILITY
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
 
diff --git a/newlib/libm/math/w_scalb.c b/newlib/libm/math/w_scalb.c
index c32496892..9a75ba30a 100644
--- a/newlib/libm/math/w_scalb.c
+++ b/newlib/libm/math/w_scalb.c
@@ -22,6 +22,8 @@
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
+
 #ifdef __STDC__
 #ifdef _SCALB_INT
 	double scalb(double x, int fn)		/* wrapper scalb */
@@ -37,9 +39,6 @@
 #endif
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_scalb(x,fn);
-#else
 	double z;
 #ifndef HUGE_VAL 
 #define HUGE_VAL inf
@@ -88,7 +87,7 @@
 	if(!finite(fn)) errno = ERANGE;
 #endif
 	return z;
-#endif 
 }
+#endif 
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/newlib/libm/math/w_sinh.c b/newlib/libm/math/w_sinh.c
index 340a7112d..c878adcaf 100644
--- a/newlib/libm/math/w_sinh.c
+++ b/newlib/libm/math/w_sinh.c
@@ -66,6 +66,7 @@ QUICKREF
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double sinh(double x)		/* wrapper sinh */
 #else
@@ -73,9 +74,6 @@ QUICKREF
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_sinh(x);
-#else
 	double z; 
 	struct exception exc;
 	z = __ieee754_sinh(x);
@@ -106,7 +104,7 @@ QUICKREF
             return exc.retval;
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/newlib/libm/math/w_sqrt.c b/newlib/libm/math/w_sqrt.c
index 61d42fcec..f2e33daa8 100644
--- a/newlib/libm/math/w_sqrt.c
+++ b/newlib/libm/math/w_sqrt.c
@@ -47,6 +47,7 @@ PORTABILITY
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifndef _DOUBLE_IS_32BITS
 
 #ifdef __STDC__
@@ -56,9 +57,6 @@ PORTABILITY
 	double x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_sqrt(x);
-#else
 	struct exception exc;
 	double z;
 	z = __ieee754_sqrt(x);
@@ -82,7 +80,7 @@ PORTABILITY
 	  return exc.retval; 
 	} else
 	    return z;
-#endif
 }
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
+#endif /* defined(_IEEE_LIBM) */
diff --git a/newlib/libm/math/wf_acos.c b/newlib/libm/math/wf_acos.c
index 8154c795e..cc631f2a4 100644
--- a/newlib/libm/math/wf_acos.c
+++ b/newlib/libm/math/wf_acos.c
@@ -20,11 +20,9 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 	float acosf(float x)		/* wrapper acosf */
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_acosf(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_acosf(x);
@@ -46,8 +44,8 @@
 	    return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_acosh.c b/newlib/libm/math/wf_acosh.c
index fc8ec3a0a..e8686b513 100644
--- a/newlib/libm/math/wf_acosh.c
+++ b/newlib/libm/math/wf_acosh.c
@@ -21,6 +21,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float acoshf(float x)		/* wrapper acoshf */
 #else
@@ -28,9 +29,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_acoshf(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_acoshf(x);
@@ -52,8 +50,8 @@
 	    return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_asin.c b/newlib/libm/math/wf_asin.c
index 385de5499..282702a4a 100644
--- a/newlib/libm/math/wf_asin.c
+++ b/newlib/libm/math/wf_asin.c
@@ -22,6 +22,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float asinf(float x)		/* wrapper asinf */
 #else
@@ -29,9 +30,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_asinf(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_asinf(x);
@@ -53,8 +51,8 @@
 	    return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_atanh.c b/newlib/libm/math/wf_atanh.c
index 565630411..dc5abdc72 100644
--- a/newlib/libm/math/wf_atanh.c
+++ b/newlib/libm/math/wf_atanh.c
@@ -19,6 +19,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float atanhf(float x)		/* wrapper atanhf */
 #else
@@ -26,9 +27,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_atanhf(x);
-#else
 	float z,y;
 	struct exception exc;
 	z = __ieee754_atanhf(x);
@@ -65,8 +63,8 @@
             return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_cosh.c b/newlib/libm/math/wf_cosh.c
index 02eb12472..73ef0214a 100644
--- a/newlib/libm/math/wf_cosh.c
+++ b/newlib/libm/math/wf_cosh.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float coshf(float x)		/* wrapper coshf */
 #else
@@ -27,9 +28,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_coshf(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_coshf(x);
@@ -60,8 +58,8 @@
 	    return (float)exc.retval;
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_exp.c b/newlib/libm/math/wf_exp.c
index f16af1d1b..21199a88d 100644
--- a/newlib/libm/math/wf_exp.c
+++ b/newlib/libm/math/wf_exp.c
@@ -21,6 +21,7 @@
 #if __OBSOLETE_MATH
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 static const float
 #else
@@ -36,9 +37,6 @@ u_threshold= -1.0397208405e+02;  /* 0xc2cff1b5 */
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_expf(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_expf(x);
@@ -86,8 +84,8 @@ u_threshold= -1.0397208405e+02;  /* 0xc2cff1b5 */
 	    } 
 	} 
 	return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_fmod.c b/newlib/libm/math/wf_fmod.c
index 030ca3e7a..d471ccb61 100644
--- a/newlib/libm/math/wf_fmod.c
+++ b/newlib/libm/math/wf_fmod.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float fmodf(float x, float y)	/* wrapper fmodf */
 #else
@@ -27,9 +28,6 @@
 	float x,y;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_fmodf(x,y);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_fmodf(x,y);
@@ -55,8 +53,8 @@
             return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_gamma.c b/newlib/libm/math/wf_gamma.c
index 1204f3999..5d066814a 100644
--- a/newlib/libm/math/wf_gamma.c
+++ b/newlib/libm/math/wf_gamma.c
@@ -18,6 +18,7 @@
 #include <reent.h>
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float gammaf(float x)
 #else
@@ -25,9 +26,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_gammaf_r(x,&(_REENT_SIGNGAM(_REENT)));
-#else
         float y;
 	struct exception exc;
         y = __ieee754_gammaf_r(x,&(_REENT_SIGNGAM(_REENT)));
@@ -75,8 +73,8 @@
 	    return (float)exc.retval; 
         } else
             return y;
+}
 #endif
-}             
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_hypot.c b/newlib/libm/math/wf_hypot.c
index c04ace110..4869394a2 100644
--- a/newlib/libm/math/wf_hypot.c
+++ b/newlib/libm/math/wf_hypot.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float hypotf(float x, float y)	/* wrapper hypotf */
 #else
@@ -27,9 +28,6 @@
 	float x,y;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_hypotf(x,y);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_hypotf(x,y);
@@ -61,8 +59,8 @@
             return (float)exc.retval;
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_j0.c b/newlib/libm/math/wf_j0.c
index 1f7f5ede5..8940b90f4 100644
--- a/newlib/libm/math/wf_j0.c
+++ b/newlib/libm/math/wf_j0.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float j0f(float x)		/* wrapper j0f */
 #else
@@ -27,9 +28,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_j0f(x);
-#else
 	struct exception exc;
 	float z = __ieee754_j0f(x);
 	if(_LIB_VERSION == _IEEE_ || isnan(x)) return z;
@@ -50,9 +48,10 @@
             return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float y0f(float x)		/* wrapper y0f */
 #else
@@ -60,9 +59,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_y0f(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_y0f(x);
@@ -109,8 +105,8 @@
             return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_j1.c b/newlib/libm/math/wf_j1.c
index b91962881..b33502619 100644
--- a/newlib/libm/math/wf_j1.c
+++ b/newlib/libm/math/wf_j1.c
@@ -21,6 +21,7 @@
 #include <errno.h>
 
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float j1f(float x)		/* wrapper j1f */
 #else
@@ -28,9 +29,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_j1f(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_j1f(x);
@@ -52,9 +50,10 @@
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float y1f(float x)		/* wrapper y1f */
 #else
@@ -62,9 +61,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_y1f(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_y1f(x);
@@ -111,8 +107,8 @@
             return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_jn.c b/newlib/libm/math/wf_jn.c
index 837b6b703..8a3325af7 100644
--- a/newlib/libm/math/wf_jn.c
+++ b/newlib/libm/math/wf_jn.c
@@ -17,6 +17,7 @@
 #include <errno.h>
 
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float jnf(int n, float x)	/* wrapper jnf */
 #else
@@ -24,9 +25,6 @@
 	float x; int n;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_jnf(n,x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_jnf(n,x);
@@ -49,9 +47,10 @@
             return exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float ynf(int n, float x)	/* wrapper ynf */
 #else
@@ -59,9 +58,6 @@
 	float x; int n;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_ynf(n,x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_ynf(n,x);
@@ -110,8 +106,8 @@
             return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_lgamma.c b/newlib/libm/math/wf_lgamma.c
index f1bf0c019..c944b3a11 100644
--- a/newlib/libm/math/wf_lgamma.c
+++ b/newlib/libm/math/wf_lgamma.c
@@ -18,6 +18,7 @@
 #include <reent.h>
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float lgammaf(float x)
 #else
@@ -25,9 +26,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_lgammaf_r(x,&(_REENT_SIGNGAM(_REENT)));
-#else
         float y;
 	struct exception exc;
         y = __ieee754_lgammaf_r(x,&(_REENT_SIGNGAM(_REENT)));
@@ -69,8 +67,8 @@
             return (float)exc.retval; 
         } else
             return y;
-#endif
 }             
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_log.c b/newlib/libm/math/wf_log.c
index 07be8d63c..d8fd7f993 100644
--- a/newlib/libm/math/wf_log.c
+++ b/newlib/libm/math/wf_log.c
@@ -21,6 +21,7 @@
 #if __OBSOLETE_MATH
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float logf(float x)		/* wrapper logf */
 #else
@@ -28,9 +29,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_logf(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_logf(x);
@@ -69,8 +67,8 @@
 	if (exc.err != 0)
            errno = exc.err;
         return (float)exc.retval; 
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_log10.c b/newlib/libm/math/wf_log10.c
index 11c595637..51ab4aa34 100644
--- a/newlib/libm/math/wf_log10.c
+++ b/newlib/libm/math/wf_log10.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float log10f(float x)		/* wrapper log10f */
 #else
@@ -27,9 +28,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_log10f(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_log10f(x);
@@ -71,8 +69,8 @@
             return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_pow.c b/newlib/libm/math/wf_pow.c
index f753b5226..c17981643 100644
--- a/newlib/libm/math/wf_pow.c
+++ b/newlib/libm/math/wf_pow.c
@@ -21,6 +21,7 @@
 #if __OBSOLETE_MATH
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float powf(float x, float y)	/* wrapper powf */
 #else
@@ -28,9 +29,6 @@
 	float x,y;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return  __ieee754_powf(x,y);
-#else
 	float z;
 	struct exception exc;
 	z=__ieee754_powf(x,y);
@@ -164,8 +162,8 @@
             return (float)exc.retval; 
         }
 	return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_remainder.c b/newlib/libm/math/wf_remainder.c
index f38c23785..3adf8f3be 100644
--- a/newlib/libm/math/wf_remainder.c
+++ b/newlib/libm/math/wf_remainder.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float remainderf(float x, float y)	/* wrapper remainder */
 #else
@@ -27,9 +28,6 @@
 	float x,y;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_remainderf(x,y);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_remainderf(x,y);
@@ -52,8 +50,8 @@
             return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_scalb.c b/newlib/libm/math/wf_scalb.c
index d2c3cd2aa..7ef24567a 100644
--- a/newlib/libm/math/wf_scalb.c
+++ b/newlib/libm/math/wf_scalb.c
@@ -22,6 +22,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 #ifdef _SCALB_INT
 	float scalbf(float x, int fn)		/* wrapper scalbf */
@@ -37,9 +38,6 @@
 #endif
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_scalbf(x,fn);
-#else
 	float z;
 #ifndef HUGE_VAL 
 #define HUGE_VAL inf
@@ -88,8 +86,8 @@
 	if(!finitef(fn)) errno = ERANGE;
 #endif
 	return z;
-#endif 
 }
+#endif 
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_sinh.c b/newlib/libm/math/wf_sinh.c
index 80c7a8e6e..3671e7bb4 100644
--- a/newlib/libm/math/wf_sinh.c
+++ b/newlib/libm/math/wf_sinh.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float sinhf(float x)		/* wrapper sinhf */
 #else
@@ -27,9 +28,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_sinhf(x);
-#else
 	float z; 
 	struct exception exc;
 	z = __ieee754_sinhf(x);
@@ -60,8 +58,8 @@
             return (float)exc.retval;
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wf_sqrt.c b/newlib/libm/math/wf_sqrt.c
index 4536ba0ac..56ed008aa 100644
--- a/newlib/libm/math/wf_sqrt.c
+++ b/newlib/libm/math/wf_sqrt.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float sqrtf(float x)		/* wrapper sqrtf */
 #else
@@ -27,9 +28,6 @@
 	float x;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_sqrtf(x);
-#else
 	float z;
 	struct exception exc;
 	z = __ieee754_sqrtf(x);
@@ -54,8 +52,8 @@
 	    return (float)exc.retval; 
 	} else
 	    return z;
-#endif
 }
+#endif
 
 #ifdef _DOUBLE_IS_32BITS
 
diff --git a/newlib/libm/math/wr_gamma.c b/newlib/libm/math/wr_gamma.c
index 0092ed02c..0e4a27da1 100644
--- a/newlib/libm/math/wr_gamma.c
+++ b/newlib/libm/math/wr_gamma.c
@@ -20,6 +20,7 @@
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double gamma_r(double x, int *signgamp) /* wrapper lgamma_r */
 #else
@@ -27,9 +28,6 @@
 	double x; int *signgamp;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_gamma_r(x,signgamp);
-#else
         double y;
 	struct exception exc;
         y = __ieee754_gamma_r(x,signgamp);
@@ -70,7 +68,7 @@
 	    return exc.retval; 
         } else
             return y;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/newlib/libm/math/wr_lgamma.c b/newlib/libm/math/wr_lgamma.c
index c59c1cce9..e3b18d078 100644
--- a/newlib/libm/math/wr_lgamma.c
+++ b/newlib/libm/math/wr_lgamma.c
@@ -20,6 +20,7 @@
 
 #ifndef _DOUBLE_IS_32BITS
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	double lgamma_r(double x, int *signgamp) /* wrapper lgamma_r */
 #else
@@ -27,9 +28,6 @@
 	double x; int *signgamp;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_lgamma_r(x,signgamp);
-#else
         double y;
 	struct exception exc;
         y = __ieee754_lgamma_r(x,signgamp);
@@ -71,7 +69,7 @@
             return exc.retval; 
         } else
             return y;
-#endif
 }
+#endif
 
 #endif /* defined(_DOUBLE_IS_32BITS) */
diff --git a/newlib/libm/math/wrf_gamma.c b/newlib/libm/math/wrf_gamma.c
index ae285f564..c47bf5c0d 100644
--- a/newlib/libm/math/wrf_gamma.c
+++ b/newlib/libm/math/wrf_gamma.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float gammaf_r(float x, int *signgamp) /* wrapper lgammaf_r */
 #else
@@ -27,9 +28,6 @@
 	float x; int *signgamp;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_gammaf_r(x,signgamp);
-#else
         float y;
 	struct exception exc;
         y = __ieee754_gammaf_r(x,signgamp);
@@ -70,5 +68,5 @@
 	    return (float)exc.retval; 
         } else
             return y;
-#endif
 }             
+#endif
diff --git a/newlib/libm/math/wrf_lgamma.c b/newlib/libm/math/wrf_lgamma.c
index 73985e271..6bbecc4a4 100644
--- a/newlib/libm/math/wrf_lgamma.c
+++ b/newlib/libm/math/wrf_lgamma.c
@@ -20,6 +20,7 @@
 #include "fdlibm.h"
 #include <errno.h>
 
+#if !defined(_IEEE_LIBM) || !defined(HAVE_ALIAS_ATTRIBUTE)
 #ifdef __STDC__
 	float lgammaf_r(float x, int *signgamp) /* wrapper lgammaf_r */
 #else
@@ -27,9 +28,6 @@
 	float x; int *signgamp;
 #endif
 {
-#ifdef _IEEE_LIBM
-	return __ieee754_lgammaf_r(x,signgamp);
-#else
         float y;
 	struct exception exc;
         y = __ieee754_lgammaf_r(x,signgamp);
@@ -71,5 +69,5 @@
             return (float)exc.retval; 
         } else
             return y;
-#endif
 }             
+#endif
-- 
2.19.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.