Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-21 Thread Martin Storsjö
On Fri, 21 Jan 2022, LIU Hao wrote: This seems easy to reproduce in MSYS2: ``` lh_mouse@lhmouse-pc ~/Desktop $ cat conftest.c extern int snprintf(char*, unsigned, const char*, ...); int main(void) { char temp[42]; snprintf(temp, 10, ""); } lh_mouse@lhmouse-pc ~/Desktop $ gcc conft

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-21 Thread LIU Hao
在 2022-01-21 18:51, Martin Storsjö 写道: That's strange, as _set_errno should be provided by libmingwex.a, which should be implicitly linked in at this stage? I tried bootstrapping a cross gcc toolchain with mingw-w64 898141aa957b99812f2f4d2cf89255798d578d54 targeting i686, with GCC 11.2.0, an

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-21 Thread Martin Storsjö
On Fri, 21 Jan 2022, LIU Hao wrote: Bootstrapping GCC now fails with this error: That's strange - I ``` gcc -c -DHAVE_CONFIG_H -g -D__USE_MINGW_ANSI_STDIO=1 -I. -I../../gcc/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic -D_GNU_SOU

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-21 Thread LIU Hao
Bootstrapping GCC now fails with this error: ``` gcc -c -DHAVE_CONFIG_H -g -D__USE_MINGW_ANSI_STDIO=1 -I. -I../../gcc/libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic -D_GNU_SOURCE ../../gcc/libiberty/vfork.c -o vfork.o ../../gcc/libiber

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-17 Thread Jacek Caban
On 1/16/22 23:51, Martin Storsjö wrote: On Sat, 15 Jan 2022, Pali Rohár wrote: In attachment are updated patches which adds these redirects and usage of F_NON_I386() macro. With these redirects it is possible to compile target mingw applications also with those gcc linker flags -Wl,--disable-au

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-16 Thread Martin Storsjö
On Sat, 15 Jan 2022, Pali Rohár wrote: In attachment are updated patches which adds these redirects and usage of F_NON_I386() macro. With these redirects it is possible to compile target mingw applications also with those gcc linker flags -Wl,--disable-auto-import -Wl,--disable-runtime-pseudo-re

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-15 Thread Pali Rohár
On Friday 14 January 2022 01:36:10 Pali Rohár wrote: > On Thursday 13 January 2022 23:22:10 Martin Storsjö wrote: > > On Wed, 12 Jan 2022, Pali Rohár wrote: > > > > > Original MSVC 6.0 msvcrt.dll library does not provide _vscprintf() > > > function. MinGW-w64 __ms_snprintf() and __ms_vsnprintf() i

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-14 Thread Martin Storsjö
On Fri, 14 Jan 2022, Pali Rohár wrote: Thank you very much for information! Could you point me where I can find source code of that mingw runtime pseudo relocations fixer? It is in mingw-w64 or in libgcc code base? It's here: https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-crt/c

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-14 Thread Pali Rohár
On Friday 14 January 2022 13:45:38 Martin Storsjö wrote: > On Fri, 14 Jan 2022, Pali Rohár wrote: > > > On Thursday 13 January 2022 23:22:10 Martin Storsjö wrote: > > > On Wed, 12 Jan 2022, Pali Rohár wrote: > > > > > > > Original MSVC 6.0 msvcrt.dll library does not provide _vscprintf() > > > >

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-14 Thread Martin Storsjö
On Fri, 14 Jan 2022, Pali Rohár wrote: On Thursday 13 January 2022 23:22:10 Martin Storsjö wrote: On Wed, 12 Jan 2022, Pali Rohár wrote: Original MSVC 6.0 msvcrt.dll library does not provide _vscprintf() function. MinGW-w64 __ms_snprintf() and __ms_vsnprintf() implementations call _vscprintf(

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-13 Thread Pali Rohár
On Thursday 13 January 2022 23:22:10 Martin Storsjö wrote: > On Wed, 12 Jan 2022, Pali Rohár wrote: > > > Original MSVC 6.0 msvcrt.dll library does not provide _vscprintf() > > function. MinGW-w64 __ms_snprintf() and __ms_vsnprintf() implementations > > call _vscprintf() function. So include fallb

Re: [Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-13 Thread Martin Storsjö
On Wed, 12 Jan 2022, Pali Rohár wrote: Original MSVC 6.0 msvcrt.dll library does not provide _vscprintf() function. MinGW-w64 __ms_snprintf() and __ms_vsnprintf() implementations call _vscprintf() function. So include fallback _vscprintf() implementation into MinGW-w64 crt code to allow applicat

[Mingw-w64-public] [PATCH 1/2] crt: Add fallback _vscprintf() implementation

2022-01-13 Thread Pali Rohár
Original MSVC 6.0 msvcrt.dll library does not provide _vscprintf() function. MinGW-w64 __ms_snprintf() and __ms_vsnprintf() implementations call _vscprintf() function. So include fallback _vscprintf() implementation into MinGW-w64 crt code to allow applications to use snprintf() with original MSVC