Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread LIU Hao
在 2022/11/20 23:06, Pali Rohár 写道: Thank you for explaining more details. My simple patch takes this in care and defines also __MSVCRT_VERSION__ to the correct value based on -mcrtdll parameter. Apologies for reading your message only partially. I thought your patch was the same as MSYS2's. It

Re: [Mingw-w64-public] [PATCH] crt: Manually do the linker test for __ImageBase

2022-11-20 Thread LIU Hao
在 2022/11/21 06:44, Martin Storsjö 写道: Instead of using AC_LINK_IFELSE, construct a test file and manually run a compile/linking command. This fixes the linker test when bootstrapping a toolchain from scratch. This matches the previous configure time link test we had, which was removed in 6f53d

Re: [Mingw-w64-public] [PATCH v2] crt: Use only __ImageBase symbol in mingw-w64 code

2022-11-20 Thread Pali Rohár
On Sunday 20 November 2022 23:32:06 Martin Storsjö wrote: > On Sun, 20 Nov 2022, Pali Rohár wrote: > > > So at this point, do you think it's worth to add the complexity of > > > manually > > > expanding the linker test (like what was removed in > > > 6f53dbf6d423fab5a9fc6b3e4b07bdcf66d253b5), or s

[Mingw-w64-public] [PATCH] crt: Manually do the linker test for __ImageBase

2022-11-20 Thread Martin Storsjö
Instead of using AC_LINK_IFELSE, construct a test file and manually run a compile/linking command. This fixes the linker test when bootstrapping a toolchain from scratch. This matches the previous configure time link test we had, which was removed in 6f53dbf6d423fab5a9fc6b3e4b07bdcf66d253b5. See

Re: [Mingw-w64-public] [PATCH v2] crt: Use only __ImageBase symbol in mingw-w64 code

2022-11-20 Thread Martin Storsjö
On Sun, 20 Nov 2022, Pali Rohár wrote: So at this point, do you think it's worth to add the complexity of manually expanding the linker test (like what was removed in 6f53dbf6d423fab5a9fc6b3e4b07bdcf66d253b5), or should we just drop the test? (Alternatively, a manually set --enable-image-base-co

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Martin Storsjö
On Sun, 20 Nov 2022, Pali Rohár wrote: Hello! I would like to propose a new parameter for gcc: -mcrtdll= to allow specifying against which Windows C Runtime library should be binary linked. On Windows there are more crt libraries and currently gcc links to libmsvcrt.a which is in most cases syml

Re: [Mingw-w64-public] [PATCH v2] crt: Use only __ImageBase symbol in mingw-w64 code

2022-11-20 Thread Pali Rohár
On Sunday 20 November 2022 22:56:51 Martin Storsjö wrote: > On Sun, 20 Nov 2022, LIU Hao wrote: > > > 在 2022-11-20 19:23, Pali Rohár 写道: > > > GNU LD provides __ImageBase symbol since 2.19. This is standard windows > > > symbol and should be used instead of custom gnu _image_base__ symbol. > > >

Re: [Mingw-w64-public] [PATCH v2] crt: Use only __ImageBase symbol in mingw-w64 code

2022-11-20 Thread Martin Storsjö
On Sun, 20 Nov 2022, LIU Hao wrote: 在 2022-11-20 19:23, Pali Rohár 写道: GNU LD provides __ImageBase symbol since 2.19. This is standard windows symbol and should be used instead of custom gnu _image_base__ symbol. Detect non-existence of __ImageBase symbol at ./configure time and for compatibil

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread LRN
On 20.11.2022 18:58, Eli Zaretskii wrote: And if your application uses features unavailable in older (or default) crt versions then this make application code simplifier. Also redistributable packages are in most cases installed by Windows update mechanism, which could be marked as system library

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Matthew Brett
Hi, On Sun, Nov 20, 2022 at 3:59 PM Eli Zaretskii wrote: > > > Date: Sun, 20 Nov 2022 16:44:08 +0100 > > From: Pali Rohár > > Cc: g...@gcc.gnu.org, mingw-w64-public@lists.sourceforge.net > > > > > Installing a redistributable is a nuisance, and dependence on non-system > > > libraries might make

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread ralph engels
Mmm yeah i newer seen problems with missing msvcrt.dll either going back as far as win9x there was some other missing runtimes but not that particular one. Den 20-11-2022 kl. 16:58 skrev Eli Zaretskii: Date: Sun, 20 Nov 2022 16:44:08 +0100 From: Pali Rohár Cc: g...@gcc.gnu.org, mingw-w64-publ

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Eli Zaretskii
> Date: Sun, 20 Nov 2022 16:44:08 +0100 > From: Pali Rohár > Cc: g...@gcc.gnu.org, mingw-w64-public@lists.sourceforge.net > > > Installing a redistributable is a nuisance, and dependence on non-system > > libraries might make the program non-free. > > On new windows versions they may be preinsta

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Pali Rohár
On Sunday 20 November 2022 17:23:15 Eli Zaretskii wrote: > > Date: Sun, 20 Nov 2022 16:04:11 +0100 > > From: Pali Rohár > > Cc: g...@gcc.gnu.org, mingw-w64-public@lists.sourceforge.net > > > > On Sunday 20 November 2022 16:45:55 Eli Zaretskii wrote: > > > > Date: Sun, 20 Nov 2022 13:53:48 +0100 >

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Eli Zaretskii
> Date: Sun, 20 Nov 2022 16:04:11 +0100 > From: Pali Rohár > Cc: g...@gcc.gnu.org, mingw-w64-public@lists.sourceforge.net > > On Sunday 20 November 2022 16:45:55 Eli Zaretskii wrote: > > > Date: Sun, 20 Nov 2022 13:53:48 +0100 > > > From: Pali Rohár via Gcc > > > > > Linking a program against a

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Eli Zaretskii
> Date: Sun, 20 Nov 2022 13:53:48 +0100 > From: Pali Rohár via Gcc > > Hello! I would like to propose a new parameter for gcc: -mcrtdll= to > allow specifying against which Windows C Runtime library should be > binary linked. On Windows there are more crt libraries and currently gcc > links to li

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Pali Rohár
On Sunday 20 November 2022 21:36:19 LIU Hao wrote: > 在 2022-11-20 20:53, Pali Rohár 写道: > > Hello! I would like to propose a new parameter for gcc: -mcrtdll= to > > allow specifying against which Windows C Runtime library should be > > binary linked. On Windows there are more crt libraries and curr

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Pali Rohár
On Sunday 20 November 2022 16:45:55 Eli Zaretskii wrote: > > Date: Sun, 20 Nov 2022 13:53:48 +0100 > > From: Pali Rohár via Gcc > > > > Hello! I would like to propose a new parameter for gcc: -mcrtdll= to > > allow specifying against which Windows C Runtime library should be > > binary linked. On

Re: [Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread LIU Hao
在 2022-11-20 20:53, Pali Rohár 写道: Hello! I would like to propose a new parameter for gcc: -mcrtdll= to allow specifying against which Windows C Runtime library should be binary linked. On Windows there are more crt libraries and currently gcc links to libmsvcrt.a which is in most cases symlink t

Re: [Mingw-w64-public] Problems when building NT kernel drivers with GCC / LD

2022-11-20 Thread Pali Rohár
On Saturday 05 November 2022 02:26:52 Pali Rohár wrote: > On Saturday 05 November 2022 01:57:49 Pali Rohár wrote: > > On Monday 31 October 2022 10:55:59 Jan Beulich wrote: > > > On 30.10.2022 02:06, Pali Rohár via Binutils wrote: > > > > * GCC or LD (not sure who) sets memory alignment characterist

[Mingw-w64-public] gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Pali Rohár
Hello! I would like to propose a new parameter for gcc: -mcrtdll= to allow specifying against which Windows C Runtime library should be binary linked. On Windows there are more crt libraries and currently gcc links to libmsvcrt.a which is in most cases symlink to libmsvcrt-os.a (but can be changed,

Re: [Mingw-w64-public] [PATCH v2] crt: Use only __ImageBase symbol in mingw-w64 code

2022-11-20 Thread LIU Hao
在 2022-11-20 19:23, Pali Rohár 写道: GNU LD provides __ImageBase symbol since 2.19. This is standard windows symbol and should be used instead of custom gnu _image_base__ symbol. Detect non-existence of __ImageBase symbol at ./configure time and for compatibility with older GNU LD versions, define

[Mingw-w64-public] [PATCH v2] crt: Use only __ImageBase symbol in mingw-w64 code

2022-11-20 Thread Pali Rohár
GNU LD provides __ImageBase symbol since 2.19. This is standard windows symbol and should be used instead of custom gnu _image_base__ symbol. Detect non-existence of __ImageBase symbol at ./configure time and for compatibility with older GNU LD versions, define __ImageBase symbol as alias to _imag

Re: [Mingw-w64-public] [PATCH] crt: Use only __ImageBase symbol in mingw-w64 code

2022-11-20 Thread LIU Hao
在 2022-11-19 22:42, Pali Rohár 写道: Here is that variant without weak symbols. I have tested that it correctly generate helper symbol __ImageBase for older ld version 2.18. And for new ld version, file __imagebase.c is not compiled at all. This looks good itself. Would you please squash these t