Re: Problems when building NT kernel drivers with GCC / LD

2024-04-07 Thread Pali Rohár via Gcc
On Sunday 07 January 2024 02:55:09 Pali Rohár wrote: > Hello, I would like to remind that the first gcc bug from the list in > previous email has not received any comment yet. It is this one: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108849 > Do you need some more details, or something else

Re: Problems when building NT kernel drivers with GCC / LD

2024-01-06 Thread Pali Rohár via Gcc
Hello, I would like to remind that the first gcc bug from the list in previous email has not received any comment yet. It is this one: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108849 Do you need some more details, or something else for it?

[PATCH v2] Add MinGW option -mcrtdll= for choosing C RunTime DLL library

2023-06-14 Thread Pali Rohár via Gcc-patches
It adjust preprocess, compile and link flags, which allows to change default -lmsvcrt library by another provided by MinGW runtime. gcc/ * config/i386/mingw-w64.h (CPP_SPEC): Adjust for -mcrtdll=. (REAL_LIBGCC_SPEC): New define. * config/i386/mingw.opt: Add mcrtdll= *

Re: [PATCH] Add MinGW option -mcrtdll= for choosing C RunTime DLL library

2023-06-13 Thread Pali Rohár via Gcc-patches
On Monday 12 June 2023 23:13:00 Jonathan Yong wrote: > On 6/12/23 01:26, LIU Hao wrote: > > 在 2023/6/12 07:08, Jonathan Yong 写道: > > > +preprocessor is done. MinGW import library @code{msvcrt} is just a > > > +symlink (or file copy) to the other MinGW CRT import library > > > > I suggest a change

[PATCH] Add MinGW option -mcrtdll= for choosing C RunTime DLL library

2023-05-27 Thread Pali Rohár via Gcc-patches
It adjust preprocess, compile and link flags, which allows to change default -lmsvcrt library by another provided by MinGW runtime. gcc/ * config/i386/mingw-w64.h (CPP_SPEC): Adjust for -mcrtdll=. (REAL_LIBGCC_SPEC): New define. * config/i386/mingw.opt: Add mcrtdll= *

Re: gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2023-05-06 Thread Pali Rohár via Gcc
On Friday 21 April 2023 18:23:28 Pali Rohár wrote: > On Sunday 04 December 2022 20:48:30 LIU Hao wrote: > > 在 2022-12-04 20:16, Pali Rohár via Gcc 写道: > > > Hello! I would like to ask gcc people, what do you think about such > > > proposed -mcrtdll= parameter?

Re: gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2023-04-21 Thread Pali Rohár via Gcc
On Sunday 04 December 2022 20:48:30 LIU Hao wrote: > 在 2022-12-04 20:16, Pali Rohár via Gcc 写道: > > Hello! I would like to ask gcc people, what do you think about such > > proposed -mcrtdll= parameter? > > > > There are lot of unofficial gcc patches which implement t

Re: Problems when building NT kernel drivers with GCC / LD

2023-04-12 Thread Pali Rohár via Gcc
On Wednesday 12 April 2023 10:53:32 Nick Clifton wrote: > Hi Pali, > > > > Hello! Just for a record, I filled individual issues to bugzilla: > > > https://sourceware.org/bugzilla/show_bug.cgi?id=30004 > > > https://sourceware.org/bugzilla/show_bug.cgi?id=30139 > > >

Re: Problems when building NT kernel drivers with GCC / LD

2023-04-01 Thread Pali Rohár via Gcc
On Monday 20 February 2023 19:25:22 Pali Rohár wrote: > On Tuesday 03 January 2023 11:06:26 Nick Clifton wrote: > > Hi Pali, > > > > > Hello! I would like to remind this thread for gcc/binutils developers. > > > Most of these issues are still present and cause problems for compiling > > > native

Re: Problems when building NT kernel drivers with GCC / LD

2023-02-20 Thread Pali Rohár via Gcc
On Tuesday 03 January 2023 11:06:26 Nick Clifton wrote: > Hi Pali, > > > Hello! I would like to remind this thread for gcc/binutils developers. > > Most of these issues are still present and cause problems for compiling > > native PE binary. If you have questions or you need any other information

Re: Problems when building NT kernel drivers with GCC / LD

2022-12-26 Thread Pali Rohár via Gcc
Hello! I would like to remind this thread for gcc/binutils developers. Most of these issues are still present and cause problems for compiling native PE binary. If you have questions or you need any other information please let me know. On Sunday 30 October 2022 02:06:11 Pali Rohár wrote: >

Re: gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-12-04 Thread Pali Rohár via Gcc
On Sunday 20 November 2022 13:53:48 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

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

2022-11-26 Thread Pali Rohár via Gcc
On Monday 21 November 2022 13:21:53 LIU Hao wrote: > 在 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

Re: Problems when building NT kernel drivers with GCC / LD

2022-11-26 Thread Pali Rohár via Gcc
On Monday 21 November 2022 08:24:36 Jan Beulich wrote: > On 20.11.2022 14:10, Pali Rohár wrote: > > 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

Re: gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Pali Rohár via Gcc
> Date: Sun, 20 Nov 2022 13:53:48 +0100 > > > > From: Pali Rohár via Gcc > > > > > > > Linking a program against a specific runtime means the produced binary > > > will > > > not run on Windows systems older than the one where it was linke

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

2022-11-20 Thread Pali Rohár via Gcc
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

Re: gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread Pali Rohár via Gcc
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 libra

Re: Problems when building NT kernel drivers with GCC / LD

2022-11-20 Thread Pali Rohár via Gcc
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

gcc parameter -mcrtdll= for choosing Windows C RunTime DLL library

2022-11-20 Thread 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 libmsvcrt.a which is in most cases symlink to libmsvcrt-os.a (but can be

Re: Problems when building NT kernel drivers with GCC / LD

2022-11-04 Thread Pali Rohár via Gcc
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 characteristics > > > (IMAGE_SCN_ALIGN_MASK) into the sections of PE

Re: Problems when building NT kernel drivers with GCC / LD

2022-11-04 Thread Pali Rohár via Gcc
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 characteristics > > (IMAGE_SCN_ALIGN_MASK) into the sections of PE executable binary. > > These characteristics should be only in

Problems when building NT kernel drivers with GCC / LD

2022-10-29 Thread Pali Rohár via Gcc
Hello! I tried to develop simple NT kernel driver and build it via GNU GCC, LD and mingw-w64 ecosystem but due to issues with compiler and linker, it is not possible to generate final .sys binary without adding workarounds or postprocessing resulted PE .sys binary. I'm sending this email to all

Re: Error: attempt to get value of unresolved symbol `L0'

2022-10-16 Thread Pali Rohár via Gcc
On Tuesday 11 October 2022 19:07:55 Pali Rohár wrote: > On Tuesday 11 October 2022 15:33:59 Nick Clifton wrote: > > Hi Pali, Hi Richard, > > > > > Having file name and line number would be also useful as it took me > > > some time to figure out where is the issue... > > > > Right - I have tried

Re: Error: attempt to get value of unresolved symbol `L0'

2022-10-11 Thread Pali Rohár via Gcc
On Tuesday 11 October 2022 15:33:59 Nick Clifton wrote: > Hi Pali, Hi Richard, > > > Having file name and line number would be also useful as it took me > > some time to figure out where is the issue... > > Right - I have tried a little harder and come up with a follow up patch. > This is now

Re: Error: attempt to get value of unresolved symbol `L0'

2022-10-11 Thread Pali Rohár via Gcc
On Tuesday 11 October 2022 11:37:03 Nick Clifton wrote: > Hi Pali, Hi Richard, > > > Interesting... Another test case which is working fine: > > > >kernoffs: > >.word 0x4 - (. - 0x0) > > This works because this expression can be converted into an instruction > and a relocation in

Re: Error: attempt to get value of unresolved symbol `L0'

2022-10-11 Thread Pali Rohár via Gcc
On Tuesday 11 October 2022 08:46:58 Richard Biener wrote: > On Mon, Oct 10, 2022 at 7:19 PM Pali Rohár via Gcc wrote: > > > > Hello! > > > > During development and debugging of U-Boot bootloader I got strange > > error from ARM GNU assembler, which lo

Error: attempt to get value of unresolved symbol `L0'

2022-10-10 Thread Pali Rohár via Gcc
Hello! During development and debugging of U-Boot bootloader I got strange error from ARM GNU assembler, which looks like a bug in binutils or gcc. Below is simplified code which can trigger it: $ cat test.S kernoffs: .word KERNEL_OFFSET - (. - CONFIG_SYS_TEXT_BASE) $