Re: [Mingw-w64-public] [PATCH] crt: Fix v*scanf functions

2022-02-06 Thread Pali Rohár
On Wednesday 26 January 2022 14:45:58 LIU Hao wrote: > 在 1/26/22 04:05, Pali Rohár 写道: > > > > Yes, this is truth. However amd64 asm code already reads more pointers > > from stack (when number of them is smaller then number of arguments > > needed to pass via registers when doing function call),

[Mingw-w64-public] [PATCH] crt: Optimize __ms_vsnprintf() for LTO

2022-02-06 Thread Pali Rohár
Mark _vscprintf() and _scprintf() functions with attribute pure as their return value depends only on passed arguments. In function __ms_vsnprintf() check only for n==0 and move _vscprintf() call at the end of function. This allows LTO to optimize out _vscprintf() call from __ms_vsnprintf() functi

[Mingw-w64-public] [PATCH] crt: Simplify building *crt*.o startup files

2022-02-06 Thread Pali Rohár
MinGW-w64 has same startup files for crtdll.dll and msvcrt.dll and defining -D__CRTDLL__ or -D__MSVCRT__ has no effect on built *crt*.o files, they are same. So build startup files only once and create other as copy from the first one. Also remove -D__CRTDLL__ and -D__MSVCRT__ as they are not used

[Mingw-w64-public] [PATCH v2] crt: Fix v*scanf functions

2022-02-06 Thread Pali Rohár
Currently v*scanf functions are broken and crash when are called with more than 30 arguments in va_list. This is because va_list v*scanf functions are redirected to variadic *scanf functions and this redirect implemented in scanf.S file has fixed limit for 30 arguments. Number of arguments for msv

Re: [Mingw-w64-public] [PATCH] crt: Move crtdll.mri from lib-common/ to lib32/

2022-02-06 Thread LIU Hao
在 2022-02-06 20:35, Pali Rohár 写道: crtdll.mri is used only for building 32-bit version of libcrtdll.a library. --- mingw-w64-crt/Makefile.am | 2 +- mingw-w64-crt/{lib-common => lib32}/crtdll.mri | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename mingw-w64-crt/{

Re: [Mingw-w64-public] [PATCH 1/3] headers: Add vdslun.idl file

2022-02-06 Thread LIU Hao
在 2022-02-04 13:06, Biswapriyo Nath 写道: From d655077eccdf17c288e0f7a7721b4982fa05419c Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Fri, 4 Feb 2022 10:35:06 +0530 Subject: [PATCH 1/3] headers: Add vdslun.idl file Signed-off-by: Biswapriyo Nath --- mingw-w64-headers/Makefile.am|

[Mingw-w64-public] [PATCH v2] crt: Fix libcrtdll.a import library

2022-02-06 Thread Pali Rohár
Import library libcrtdll.a (for crtdll.dll runtime library) compiled during mingw-w64 build process is currently broken and cannot be used for linking executable applications. Trying to do it results in following linker errors: /usr/bin/i686-w64-mingw32-ld: .../i686-w64-mingw32/lib/crt2.o: in f

[Mingw-w64-public] [PATCH] crt: Move crtdll.mri from lib-common/ to lib32/

2022-02-06 Thread Pali Rohár
crtdll.mri is used only for building 32-bit version of libcrtdll.a library. --- mingw-w64-crt/Makefile.am | 2 +- mingw-w64-crt/{lib-common => lib32}/crtdll.mri | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename mingw-w64-crt/{lib-common => lib32}/crtdll.mri (100%) d