Re: [Mingw-w64-public] Different behaviour between msvcrt and ucrt compilers wrt -D__USE_MINGW_ANSI_STDIO

2024-11-12 Thread sisyphus
I'm happy enough with the way that the gmp and mpfr libraries are building. GMP has its own fallback (printf/repl_vsnprintf.c) to use when vsnprintf is found to be unavailable or faulty in behaviour. That fallback seems to work quite well for gmp, but mpfr does not adapt perfectly to it. However,

Re: [Mingw-w64-public] Building winpthreads with MSVC tools

2024-11-12 Thread JonY via Mingw-w64-public
On 11/12/24 18:52, Kirill Makurin wrote: Hi, I have made some changes to the patch3, including using LN_S instead of `cp -f` (but see below). First of all, I split it into two different patches. One for Makefile.am and configure.ac, and another for tests/Makefile.am since the changes are not

Re: [Mingw-w64-public] [PATCH 00/15] Finish MinGW-w64 runtime compatibility with ISO C95

2024-11-12 Thread Martin Storsjö
On Tue, 12 Nov 2024, Pali Rohár wrote: - The commit message explanation of _swprintf_c seems weird. The commit message says: _(v)swprintf_c - clears the first wide character in buffer on error (error means that there is no space for nul-term or

Re: [Mingw-w64-public] [PATCH 00/15] Finish MinGW-w64 runtime compatibility with ISO C95

2024-11-12 Thread Pali Rohár
On Tuesday 12 November 2024 23:13:28 Martin Storsjö wrote: > On Tue, 12 Nov 2024, Pali Rohár wrote: > > > > See https://github.com/mstorsjo/llvm-mingw/commits/c95-test for the added > > > tests. At the end, I have two "WIP: test: Waive ..." commits that makes > > > the > > > tests pass, covering

Re: [Mingw-w64-public] [PATCH 00/15] Finish MinGW-w64 runtime compatibility with ISO C95

2024-11-12 Thread Martin Storsjö
On Tue, 12 Nov 2024, Pali Rohár wrote: See https://github.com/mstorsjo/llvm-mingw/commits/c95-test for the added tests. At the end, I have two "WIP: test: Waive ..." commits that makes the tests pass, covering up the issues that I found. These tests are in the form of one large file, test/crt-t

Re: [Mingw-w64-public] [PATCH 00/15] Finish MinGW-w64 runtime compatibility with ISO C95

2024-11-12 Thread Pali Rohár
On Tuesday 12 November 2024 21:30:22 Pali Rohár wrote: > On Tuesday 12 November 2024 12:30:08 Martin Storsjö wrote: > > - The commit message explanation of _swprintf_c seems weird. The commit > > message says: > > > > _(v)swprintf_c - clears the first wide character in buffer on error > >

Re: [Mingw-w64-public] [PATCH 00/15] Finish MinGW-w64 runtime compatibility with ISO C95

2024-11-12 Thread Pali Rohár
On Tuesday 12 November 2024 12:30:08 Martin Storsjö wrote: > On Thu, 24 Oct 2024, Pali Rohár wrote: > > > > While debugging this, I also noted that libc++ fails to build (when using > > > __USE_MINGW_ANSI_STDIO=1) after patch "crt: Add support for C95 > > > (v)swprintf() functions when __USE_MINGW

Re: [Mingw-w64-public] getmainargs changes

2024-11-12 Thread Lasse Collin
On 2024-11-12 Jeremy Drake wrote: > On Tue, 12 Nov 2024, Martin Storsjö wrote: > > > Regarding the above, I wouldn't exactly think that those apps ignore > > argv[] and get the command line some other way - but I'm not > > entirely sure; ideally we'd take it up with them to understand > > exactly

Re: [Mingw-w64-public] getmainargs changes

2024-11-12 Thread Jeremy Drake via Mingw-w64-public
On Tue, 12 Nov 2024, Martin Storsjö wrote: > Regarding the above, I wouldn't exactly think that those apps ignore > argv[] and get the command line some other way - but I'm not entirely > sure; ideally we'd take it up with them to understand exactly what their > setup is and how it works, and how

Re: [Mingw-w64-public] Building winpthreads with MSVC tools

2024-11-12 Thread Kirill Makurin
Hi, I have made some changes to the patch3, including using LN_S instead of `cp -f` (but see below). First of all, I split it into two different patches. One for Makefile.am and configure.ac, and another for tests/Makefile.am since the changes are not directly related. A few days after I subm

Re: [Mingw-w64-public] getmainargs changes

2024-11-12 Thread Lasse Collin
On 2024-11-12 Pali Rohár wrote: > On Monday 11 November 2024 22:10:01 Lasse Collin wrote: > > If permissive mode can be enabled the same way as _dowildcard works, > > then argv[] could be constructed with the same code as in strict > > mode. The current crtexe.c in master has > > > > for (int i

Re: [Mingw-w64-public] getmainargs changes

2024-11-12 Thread LIU Hao
在 2024-11-12 23:17, Lasse Collin 写道: I'm suggesting it because the patch clearly is harmful for some types of apps which don't need it for security reasons. I leave the final decision to MinGW-w64 maintainers. Done now: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/c6857dc Meanwhile, I see

Re: [Mingw-w64-public] getmainargs changes

2024-11-12 Thread Lasse Collin
On 2024-11-12 LIU Hao wrote: > 在 2024-11-12 22:49, Lasse Collin 写道: > > The _exit(255) trick is clearly not an acceptable default. My patch > > should be reverted until a better one is made. It might be that all > > apps that want safe argv[] for main() will need something special on > > Windows (l

Re: [Mingw-w64-public] getmainargs changes

2024-11-12 Thread Martin Storsjö
On Tue, 12 Nov 2024, Lasse Collin wrote: On 2024-11-12 Martin Storsjö wrote: FYI, see https://github.com/msys2/MINGW-packages/issues/22462 where someone ran into issues caused by this. Also see https://ffmpeg.org/pipermail/ffmpeg-devel/2024-November/335936.html where someone else observes othe

Re: [Mingw-w64-public] getmainargs changes

2024-11-12 Thread LIU Hao
在 2024-11-12 22:49, Lasse Collin 写道: I understand only now that many apps use main() but ignore argv[] and instead get the args by some other method. I was too focused on porting apps written for POSIX systems. I'm sorry. It doesn't matter. That's not your fault. The _exit(255) trick is clea

Re: [Mingw-w64-public] getmainargs changes

2024-11-12 Thread Lasse Collin
On 2024-11-12 Martin Storsjö wrote: > FYI, see https://github.com/msys2/MINGW-packages/issues/22462 where > someone ran into issues caused by this. > > Also see > https://ffmpeg.org/pipermail/ffmpeg-devel/2024-November/335936.html where > someone else observes other issues related to this. (The

Re: [Mingw-w64-public] Different behaviour between msvcrt and ucrt compilers wrt -D__USE_MINGW_ANSI_STDIO

2024-11-12 Thread Nakai Yuta
GMP configure checks for the availability of %n format specifier. Because of security reasons, Microsoft has disabled the %n format specifier by default. To use the %n format specifier, _set_printf_count_output(1) must be called. --- Best regards, Yuta -Original Message- From: Martin St

Re: [Mingw-w64-public] Different behaviour between msvcrt and ucrt compilers wrt -D__USE_MINGW_ANSI_STDIO

2024-11-12 Thread Martin Storsjö
On Tue, 12 Nov 2024, sisyphus wrote: (Otherwise the gmp configure step decides that vsnprintf does not work, and an mpfr library built against the resultant gmp library exhibits some buggy behaviour.) The intent is that those stdio functions would be working correctly enough in general on UCR

Re: [Mingw-w64-public] [PATCH] crt: Add _copysignf into all i386 CRT libraries

2024-11-12 Thread Martin Storsjö
On Fri, 8 Nov 2024, Pali Rohár wrote: Function _copysignf is in i386 natively available only in msvcr120 and UCRT. mingw-w64 already provides emulation in crtdll and msvcrt i386 import libraries. Include this emulation also into all other i386 CRT import libraries. Note that function _copysignf

Re: [Mingw-w64-public] [PATCH] crt: Rename purecall.c to _set_purecall_handler.c and fix its inclusion

2024-11-12 Thread Martin Storsjö
On Fri, 8 Nov 2024, Pali Rohár wrote: Source file purecall.c provides emulation of function _set_purecall_handler() so rename this file to _set_purecall_handler.c. This file does not provide function named purecall(). Function _set_purecall_handler() is available since msvcr71.dll, so include s

Re: [Mingw-w64-public] [PATCH 00/15] Finish MinGW-w64 runtime compatibility with ISO C95

2024-11-12 Thread Martin Storsjö
On Thu, 24 Oct 2024, Pali Rohár wrote: While debugging this, I also noted that libc++ fails to build (when using __USE_MINGW_ANSI_STDIO=1) after patch "crt: Add support for C95 (v)swprintf() functions when __USE_MINGW_ANSI_STDIO=0", because there's only a 2 parameter version of swprintf, but it

Re: [Mingw-w64-public] [PATCH v4] headers/intrin-impl: Fix segment accessors

2024-11-12 Thread LIU Hao
在 2024-11-12 15:55, Martin Storsjö 写道: The explanations around the volatile changes seem good to me now, and I trust you on the rest of the x86 specific details here. Thank you very much for the trust! Pushed this one now. -- Best regards, LIU Hao OpenPGP_signature.asc Description: OpenPGP

Re: [Mingw-w64-public] [PATCH 1/2] headers/_mingw: Add macros for conditional `constexpr`

2024-11-12 Thread LIU Hao
在 2024-11-12 15:53, Martin Storsjö 写道: LGTM, these patches look reasonable to me. Thanks. Pushed these two now. -- Best regards, LIU Hao OpenPGP_signature.asc Description: OpenPGP digital signature ___ Mingw-w64-public mailing list Mingw-w64-pub

Re: [Mingw-w64-public] [PATCH v4] headers/intrin-impl: Fix segment accessors

2024-11-12 Thread Martin Storsjö
On Sat, 9 Nov 2024, LIU Hao wrote: Add an explicit `volatile` qualifier for intrinsic functions that write to TEB; do not rely on the implicit volatile semantics, just because they have no output. * If an asm statement reads memory that is not passed with "m", it shall clobber "memory". * I

Re: [Mingw-w64-public] [PATCH 1/2] headers/_mingw: Add macros for conditional `constexpr`

2024-11-12 Thread Martin Storsjö
On Tue, 12 Nov 2024, LIU Hao wrote: -- LGTM, these patches look reasonable to me. // Martin ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public