Skip to content

Commit 57dd0f9

Browse files
committed
add missing weak references for long double functions
This ensures that all standard long double functions are defined when building with 64-bit long double.
1 parent f052f42 commit 57dd0f9

File tree

15 files changed

+73
-0
lines changed

15 files changed

+73
-0
lines changed

bsdsrc/b_tgamma.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* acknowledged.
3939
*/
4040

41+
#include <float.h>
4142
#include <openlibm_math.h>
4243

4344
#include "mathimpl.h"
@@ -312,3 +313,7 @@ neg_gam(x)
312313
if (sgn < 0) y = -y;
313314
return (M_PI / (y*z));
314315
}
316+
317+
#if (LDBL_MANT_DIG == 53)
318+
openlibm_weak_reference(tgamma, tgammal);
319+
#endif

src/e_acosh.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* acosh(NaN) is NaN without signal.
3030
*/
3131

32+
#include <float.h>
3233
#include <openlibm_math.h>
3334

3435
#include "math_private.h"
@@ -61,3 +62,7 @@ __ieee754_acosh(double x)
6162
return log1p(t+sqrt(2.0*t+t*t));
6263
}
6364
}
65+
66+
#if (LDBL_MANT_DIG == 53)
67+
openlibm_weak_reference(acosh, acoshl);
68+
#endif

src/e_atanh.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
*
3434
*/
3535

36+
#include <float.h>
3637
#include <openlibm_math.h>
3738

3839
#include "math_private.h"
@@ -61,3 +62,7 @@ __ieee754_atanh(double x)
6162
t = 0.5*log1p((x+x)/(one-x));
6263
if(hx>=0) return t; else return -t;
6364
}
65+
66+
#if (LDBL_MANT_DIG == 53)
67+
openlibm_weak_reference(atanh, atanhl);
68+
#endif

src/e_cosh.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* only cosh(0)=1 is exact for finite x.
3636
*/
3737

38+
#include <float.h>
3839
#include <openlibm_math.h>
3940

4041
#include "math_private.h"
@@ -78,3 +79,7 @@ __ieee754_cosh(double x)
7879
/* |x| > overflowthresold, cosh(x) overflow */
7980
return huge*huge;
8081
}
82+
83+
#if (LDBL_MANT_DIG == 53)
84+
openlibm_weak_reference(cosh, coshl);
85+
#endif

src/e_exp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,7 @@ __ieee754_exp(double x) /* default IEEE double exp */
165165
return y*twopk*twom1000;
166166
}
167167
}
168+
169+
#if (LDBL_MANT_DIG == 53)
170+
openlibm_weak_reference(exp, expl);
171+
#endif

src/e_log.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
* to produce the hexadecimal values shown.
6666
*/
6767

68+
#include <float.h>
6869
#include <openlibm_math.h>
6970

7071
#include "math_private.h"
@@ -139,3 +140,7 @@ __ieee754_log(double x)
139140
return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
140141
}
141142
}
143+
144+
#if (LDBL_MANT_DIG == 53)
145+
openlibm_weak_reference(log, logl);
146+
#endif

src/e_log10.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* in not-quite-routine extra precision.
2323
*/
2424

25+
#include <float.h>
2526
#include <openlibm_math.h>
2627

2728
#include "math_private.h"
@@ -86,3 +87,7 @@ __ieee754_log10(double x)
8687

8788
return val_lo + val_hi;
8889
}
90+
91+
#if (LDBL_MANT_DIG == 53)
92+
openlibm_weak_reference(log10, log10l);
93+
#endif

src/e_log2.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* in not-quite-routine extra precision.
2525
*/
2626

27+
#include <float.h>
2728
#include <openlibm_math.h>
2829

2930
#include "math_private.h"
@@ -109,3 +110,7 @@ __ieee754_log2(double x)
109110

110111
return val_lo + val_hi;
111112
}
113+
114+
#if (LDBL_MANT_DIG == 53)
115+
openlibm_weak_reference(log2, log2l);
116+
#endif

src/e_pow.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
* to produce the hexadecimal values shown.
5858
*/
5959

60+
#include <float.h>
6061
#include <openlibm_math.h>
6162

6263
#include "math_private.h"
@@ -310,3 +311,7 @@ __ieee754_pow(double x, double y)
310311
else SET_HIGH_WORD(z,j);
311312
return s*z;
312313
}
314+
315+
#if (LDBL_MANT_DIG == 53)
316+
openlibm_weak_reference(pow, powl);
317+
#endif

src/e_sinh.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* only sinh(0)=0 is exact for finite x.
3333
*/
3434

35+
#include <float.h>
3536
#include <openlibm_math.h>
3637

3738
#include "math_private.h"
@@ -72,3 +73,7 @@ __ieee754_sinh(double x)
7273
/* |x| > overflowthresold, sinh(x) overflow */
7374
return x*shuge;
7475
}
76+
77+
#if (LDBL_MANT_DIG == 53)
78+
openlibm_weak_reference(sinh, sinhl);
79+
#endif

0 commit comments

Comments
 (0)