Hi,

This has been a recurring request from users for quite some time;
the math routines provided by mingw-w64 are slower than what
UCRT provides. When using UCRT, there's little reason to not just
use the C99 compliant functions from the UCRT, instead of statically
linking in our own versions from libmingwex.a. (This also reduces
the binary size somewhat.)

To prefer the UCRT functions where applicable, I move functions
from libmingwex.a (which is linked before lib*crt*) into the
individual import libraries where necessary.

I initially made this patchset back in 2019 already, but it felt
quite messy at the time. Since then, the refactorings in
273ef28b85c0a2f789d5a0e0d60d75ef20dc6e73 from 2021 makes this much
less painful, since the object files that get moved from libmingwex.a
into more than one other library get compiled mostly just once
via libmsvcrt_common.a.

This should fix issues such as
https://github.com/mstorsjo/llvm-mingw/issues/361.

// Martin


Martin Storsjö (8):
  crt: Prefer ucrt's math functions over libmingwex, for arch
    independent functions
  crt: Prepare Makefile.am for adding arch specific files to crt
    libraries
  crt: Move -l suffixed functions from libmingwex to libmsvcr* for arm
  crt: Move some x86 specific math functions from libmingwex to
    libmsvcr*
  crt: Move certain x86 math functions to libmsvcr*.a for all x86, and
    to libucrt*.a for x86_32
  crt: Move fabsf and nexttowardf to libmsvcr*.a for all archs, and to
    libucrt*.a for x86
  crt: Move functions missing from ucrt x86_32 to libucrt*.a for x86_32
    and to all libmsvcr*.a
  headers: Don't do inline redirects from <func>f() to <func>() on UCRT

 mingw-w64-crt/Makefile.am                     | 253 ++++++++++++++----
 .../api-ms-win-crt-math-l1-1-0.def.in         |  62 ++---
 mingw-w64-crt/lib-common/ucrtbase.def.in      |  62 ++---
 mingw-w64-headers/crt/math.h                  |  16 +-
 4 files changed, 271 insertions(+), 122 deletions(-)

-- 
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