http://bugs.winehq.org/show_bug.cgi?id=58191
Bug ID: 58191 Summary: dwrite tests fail to compile with mingw-gcc 15 due to attempt to link to truncf Product: Wine Version: 10.6 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: dwrite Assignee: wine-bugs@winehq.org Reporter: stefan@codeweavers.com Distribution: ---
Since my system updated mingw to gcc 15.1, Wine fails to build:
/usr/libexec/gcc/x86_64-w64-mingw32/ld: dlls/dwrite/tests/x86_64-windows/layout.o: in function `test_pixelsnapping': /home/stefan/build/_wine64/../../src/wine/dlls/dwrite/tests/layout.c:4782:(.text$test_pixelsnapping+0x312): undefined reference to `truncf'
$ x86_64-w64-mingw32-gcc --version x86_64-w64-mingw32-gcc (Gentoo 15.1.0 p55) 15.1.0
Windows 11's msvcrt.dll indeed does not export trunc(), truncf() or truncl(), although ucrtbase.dll does. So adding the exports to our msvcrt would fix the build but break running the tests on Windows.
The line in question doesn't call truncf. It calls floor(), which newer gcc apparently lowers to truncf. Building the file in question with -O0 of -fno-builtin-floor fixes the problem.