We can use the UCRT provided version of these functions, thus
move them away from libmingwex and into the libmsvcr* specific
libraries instead.

Leave the -l suffixed ones, for long doubles, where we can't use
the UCRT version on x86.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-crt/Makefile.am                     | 58 ++++++++++++-------
 .../api-ms-win-crt-math-l1-1-0.def.in         | 20 +++----
 mingw-w64-crt/lib-common/ucrtbase.def.in      | 20 +++----
 3 files changed, 58 insertions(+), 40 deletions(-)

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 8324d2f83..8d7c060c4 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -195,7 +195,32 @@ src_msvcrt_common=\
   math/tgamma.c math/tgammaf.c
 
 # Arch specific files included in all libmsvcr*.a on x86
-src_msvcrt_common_add_x86=
+src_msvcrt_common_add_x86=\
+  math/x86/acosh.c math/x86/acoshf.c \
+  math/x86/asinh.c math/x86/asinhf.c \
+  math/x86/atan2.c \
+  math/x86/atanh.c math/x86/atanhf.c \
+  math/x86/ceil.S \
+  math/x86/cos.c \
+  math/x86/exp.c \
+  math/x86/exp2.S math/x86/exp2f.S \
+  math/x86/expm1.c math/x86/expm1f.c \
+  math/x86/floor.S \
+  math/x86/fmod.c \
+  math/x86/ilogb.S math/x86/ilogbf.S \
+  math/x86/ldexp.c \
+  math/x86/log.c \
+  math/x86/log1p.S math/x86/log1pf.S \
+  math/x86/log2.S math/x86/log2f.S \
+  math/x86/logb.c math/x86/logbf.c \
+  math/x86/nearbyint.S math/x86/nearbyintf.S \
+  math/x86/pow.c \
+  math/x86/remainder.S math/x86/remainderf.S \
+  math/x86/remquo.S math/x86/remquof.S \
+  math/x86/rint.c math/x86/rintf.c \
+  math/x86/scalbn.S math/x86/scalbnf.S \
+  math/x86/sin.c \
+  math/x86/trunc.S math/x86/truncf.S
 
 # Arch specific files included in all libmsvcr*.a on x86_32
 src_msvcrt_common_add_x86_32=\
@@ -710,26 +735,19 @@ src_libmingwex_x86=\
   math/cbrtl.c              math/erfl.c               math/fdiml.c             
 math/fmal.c               math/fmaxl.c              \
   math/fminl.c              math/llrintl.c            math/llroundl.c          
 math/lrintl.c             math/lroundl.c            \
   math/rintl.c              math/roundl.c             math/tgammal.c           
 math/truncl.c             \
-  math/x86/_chgsignl.S      math/x86/acosf.c          math/x86/acosh.c         
 math/x86/acosl.c          math/x86/acosh.def.h      \
-  math/x86/acoshf.c         math/x86/acoshl.c         math/x86/asinf.c         
 math/x86/asinh.c          math/x86/asinl.c          \
-  math/x86/asinhf.c         math/x86/asinhl.c         math/x86/atan2f.c        
 math/x86/atan2.c          math/x86/atan2l.c         \
-  math/x86/atanf.c          math/x86/atanh.c          math/x86/atanl.c         
 math/x86/atanhf.c         math/x86/atanhl.c         \
-  math/x86/ceil.S           math/x86/ceilf.S          math/x86/ceill.S         
 math/x86/copysignl.S      math/x86/cos.c            \
+  math/x86/_chgsignl.S      math/x86/acosf.c          math/x86/acosh.def.h     
 math/x86/acoshl.c         math/x86/acosl.c          \
+  math/x86/asinf.c          math/x86/asinhl.c         math/x86/asinl.c         
 math/x86/atan2f.c         math/x86/atan2l.c         \
+  math/x86/atanf.c          math/x86/atanhl.c         math/x86/atanl.c         
 \
+  math/x86/ceilf.S          math/x86/ceill.S          math/x86/copysignl.S     
 \
   math/x86/cos.def.h        math/x86/cosf.c           math/x86/cosl.c          
 math/x86/cosl_internal.S  math/x86/cossin.c         \
-  math/x86/exp.c            math/x86/exp.def.h        math/x86/expl.c          
 math/x86/exp2.S           math/x86/exp2f.S          \
-  math/x86/exp2l.S          math/x86/expm1.c          math/x86/expm1.def.h     
 math/x86/expm1f.c         math/x86/expm1l.c         \
-  math/x86/fastmath.h       math/x86/floor.S          math/x86/floorf.S        
 math/x86/floorl.S         math/x86/fmod.c           \
-  math/x86/fmodf.c          math/x86/fmodl.c          math/x86/fucom.c         
 math/x86/ilogb.S          \
-  math/x86/ilogbf.S         math/x86/ilogbl.S         math/x86/internal_logl.S 
 math/x86/ldexp.c          math/x86/ldexpl.c         \
-  math/x86/log.c            math/x86/log.def.h        math/x86/log10l.S        
 math/x86/log1p.S          math/x86/log1pf.S         \
-  math/x86/log1pl.S         math/x86/log2.S           math/x86/log2f.S         
 math/x86/log2l.S          math/x86/logb.c           \
-  math/x86/logbf.c          math/x86/logbl.c          math/x86/logl.c          
 math/x86/nearbyint.S      math/x86/nearbyintf.S     \
-  math/x86/nearbyintl.S     math/x86/pow.c            math/x86/pow.def.h       
 math/x86/powl.c           math/x86/remainder.S      \
-  math/x86/remainderf.S     math/x86/remainderl.S     math/x86/remquo.S        
 math/x86/remquof.S        math/x86/remquol.S        \
-  math/x86/rint.c           math/x86/rintf.c          \
-  math/x86/scalbn.S         math/x86/scalbnf.S        math/x86/scalbnl.S       
 math/x86/sin.c            math/x86/sin.def.h        \
-  math/x86/sinf.c           math/x86/sinl.c           math/x86/sinl_internal.S 
 math/x86/tanf.c           math/x86/tanl.S           \
-  math/x86/trunc.S          math/x86/truncf.S
+  math/x86/exp2l.S          math/x86/exp.def.h        math/x86/expl.c          
 math/x86/expm1.def.h      math/x86/expm1l.c         \
+  math/x86/fastmath.h       math/x86/floorf.S         math/x86/floorl.S        
 \
+  math/x86/fmodf.c          math/x86/fmodl.c          math/x86/fucom.c         
 \
+  math/x86/ilogbl.S         math/x86/internal_logl.S  math/x86/ldexpl.c        
 \
+  math/x86/log.def.h        math/x86/log10l.S         math/x86/log1pl.S        
 math/x86/log2l.S          \
+  math/x86/logbl.c          math/x86/logl.c           math/x86/nearbyintl.S    
 math/x86/pow.def.h        math/x86/powl.c           \
+  math/x86/remainderl.S     math/x86/remquol.S        math/x86/scalbnl.S       
 math/x86/sin.def.h        \
+  math/x86/sinf.c           math/x86/sinl.c           math/x86/sinl_internal.S 
 math/x86/tanf.c           math/x86/tanl.S
 
 
 src_libmingwex32=$(src_libmingwex_x86)
diff --git a/mingw-w64-crt/lib-common/api-ms-win-crt-math-l1-1-0.def.in 
b/mingw-w64-crt/lib-common/api-ms-win-crt-math-l1-1-0.def.in
index dfac503b1..e4e5407b9 100644
--- a/mingw-w64-crt/lib-common/api-ms-win-crt-math-l1-1-0.def.in
+++ b/mingw-w64-crt/lib-common/api-ms-win-crt-math-l1-1-0.def.in
@@ -158,7 +158,7 @@ asinh
 asinhf
 asinhl F_X86_ANY(DATA)
 atan
-atan2 F_X86_ANY(DATA)
+atan2
 F_NON_I386(atan2f F_X86_ANY(DATA))
 F_ARM_ANY(atan2l == atan2)
 F_NON_I386(atanf F_X86_ANY(DATA))
@@ -199,7 +199,7 @@ ccosh
 ccoshf
 ccoshl
 ccosl
-ceil F_X86_ANY(DATA)
+ceil
 F_NON_I386(ceilf F_X86_ANY(DATA))
 F_ARM_ANY(ceill == ceil)
 cexp
@@ -220,7 +220,7 @@ conjl
 copysign
 copysignf
 copysignl F_X86_ANY(DATA)
-cos F_X86_ANY(DATA)
+cos
 F_NON_I386(cosf F_X86_ANY(DATA))
 F_ARM_ANY(cosl == cos)
 cosh
@@ -255,7 +255,7 @@ erfcf
 erfcl F_X86_ANY(DATA)
 erff
 erfl F_X86_ANY(DATA)
-exp F_X86_ANY(DATA)
+exp
 exp2
 exp2f
 exp2l F_X86_ANY(DATA)
@@ -269,7 +269,7 @@ F_ARM_ANY(fabsf)
 fdim
 fdimf
 fdiml F_X86_ANY(DATA)
-floor F_X86_ANY(DATA)
+floor
 F_NON_I386(floorf F_X86_ANY(DATA))
 F_ARM_ANY(floorl == floor)
 fma
@@ -281,7 +281,7 @@ fmaxl F_X86_ANY(DATA)
 fmin
 fminf
 fminl F_X86_ANY(DATA)
-fmod F_X86_ANY(DATA)
+fmod
 F_NON_I386(fmodf F_X86_ANY(DATA))
 F_ARM_ANY(fmodl == fmod)
 frexp
@@ -289,7 +289,7 @@ hypot
 ilogb
 ilogbf
 ilogbl F_X86_ANY(DATA)
-ldexp F_X86_ANY(DATA)
+ldexp
 ; The UCRT lgamma functions don't set/provide the signgam variable like
 ; the mingw ones do. Therefore prefer the libmingwex version instead.
 lgamma DATA
@@ -301,7 +301,7 @@ llrintl F_X86_ANY(DATA)
 llround
 llroundf
 llroundl F_X86_ANY(DATA)
-log F_X86_ANY(DATA)
+log
 log10
 F_NON_I386(log10f F_X86_ANY(DATA))
 F_ARM_ANY(log10l == log10)
@@ -341,7 +341,7 @@ nexttowardl F_X86_ANY(DATA)
 norm
 normf
 norml
-pow F_X86_ANY(DATA)
+pow
 F_NON_I386(powf F_X86_ANY(DATA))
 F_ARM_ANY(powl == pow)
 remainder
@@ -362,7 +362,7 @@ scalblnl F_X86_ANY(DATA)
 scalbn
 scalbnf
 scalbnl F_X86_ANY(DATA)
-sin F_X86_ANY(DATA)
+sin
 F_NON_I386(sinf F_X86_ANY(DATA))
 F_ARM_ANY(sinl == sin)
 ; if we implement sinh, we can set it DATA only.
diff --git a/mingw-w64-crt/lib-common/ucrtbase.def.in 
b/mingw-w64-crt/lib-common/ucrtbase.def.in
index a9a7d8215..d493280a6 100644
--- a/mingw-w64-crt/lib-common/ucrtbase.def.in
+++ b/mingw-w64-crt/lib-common/ucrtbase.def.in
@@ -2194,7 +2194,7 @@ asinh
 asinhf
 asinhl F_X86_ANY(DATA)
 atan
-atan2 F_X86_ANY(DATA)
+atan2
 F_NON_I386(atan2f F_X86_ANY(DATA))
 F_ARM_ANY(atan2l == atan2)
 F_NON_I386(atanf F_X86_ANY(DATA))
@@ -2245,7 +2245,7 @@ ccosh
 ccoshf
 ccoshl
 ccosl
-ceil F_X86_ANY(DATA)
+ceil
 F_NON_I386(ceilf F_X86_ANY(DATA))
 F_ARM_ANY(ceill == ceil)
 cexp
@@ -2269,7 +2269,7 @@ conjl
 copysign
 copysignf
 copysignl F_X86_ANY(DATA)
-cos F_X86_ANY(DATA)
+cos
 F_NON_I386(cosf F_X86_ANY(DATA))
 F_ARM_ANY(cosl == cos)
 cosh
@@ -2306,7 +2306,7 @@ erfcl F_X86_ANY(DATA)
 erff
 erfl F_X86_ANY(DATA)
 exit
-exp F_X86_ANY(DATA)
+exp
 exp2
 exp2f
 exp2l F_X86_ANY(DATA)
@@ -2341,7 +2341,7 @@ fgetpos
 fgets
 fgetwc
 fgetws
-floor F_X86_ANY(DATA)
+floor
 F_NON_I386(floorf F_X86_ANY(DATA))
 F_ARM_ANY(floorl == floor)
 fma
@@ -2353,7 +2353,7 @@ fmaxl F_X86_ANY(DATA)
 fmin
 fminf
 fminl F_X86_ANY(DATA)
-fmod F_X86_ANY(DATA)
+fmod
 F_NON_I386(fmodf F_X86_ANY(DATA))
 F_ARM_ANY(fmodl == fmod)
 fopen
@@ -2415,7 +2415,7 @@ iswupper
 iswxdigit
 isxdigit
 labs
-ldexp F_X86_ANY(DATA)
+ldexp
 ldiv
 ; The UCRT lgamma functions don't set/provide the signgam variable like
 ; the mingw ones do. Therefore prefer the libmingwex version instead.
@@ -2431,7 +2431,7 @@ llround
 llroundf
 llroundl F_X86_ANY(DATA)
 localeconv
-log F_X86_ANY(DATA)
+log
 log10
 F_NON_I386(log10f F_X86_ANY(DATA))
 F_ARM_ANY(log10l == log10)
@@ -2491,7 +2491,7 @@ norm
 normf
 norml
 perror
-pow F_X86_ANY(DATA)
+pow
 F_NON_I386(powf F_X86_ANY(DATA))
 F_ARM_ANY(powl == pow)
 putc
@@ -2534,7 +2534,7 @@ F_X64(setjmp)
 setlocale
 setvbuf
 signal
-sin F_X86_ANY(DATA)
+sin
 F_NON_I386(sinf F_X86_ANY(DATA))
 F_ARM_ANY(sinl == sin)
 ; if we implement sinh, we can set it DATA only.
-- 
2.34.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to