ProgrammerJ1
ProgrammerJ1

Reputation: 21

How to I build gnu-efi, for mingw-w64

I am new to the gnu-efi development process. I am using windows 11, and GCC 13.1.0 (with POSIX threads) + LLVM/Clang/LLD/LLDB 16.0.5 + MinGW-w64 11.0.0 (UCRT) - release 5 (Latest), Win64. So far I have managed to install the zip, and install make for the msys2 mingw-w64 terminal. I am now trying to build the files with the makefile in the root directory. It is able to compile most of the files, but when it reaches the ctors.S, it generate the following errors.

C:/Users/[my username]/gnu-efi/lib/ctors.S:11: Error: junk at end of line, first unrecognized character is `,'
C:/Users/[my username]/gnu-efi/lib/ctors.S:18: Error: junk at end of line, first unrecognized character is `,'
C:/Users/[my username]/gnu-efi/lib/ctors.S:25: Error: junk at end of line, first unrecognized character is `,'
C:/Users/[my username]/gnu-efi/lib/ctors.S:32: Error: junk at end of line, first unrecognized character is `,'

Why does it do this. I have tried changing the section names for the first line, and used sasm to test the assembly process. I have tried looking at the documentation for gas and changing the syntax to that, yet it still generated the error. Can someone guide me as to why this is happening, and how to fix this error? Thank you. Note: I am using the mingw-w64 version of the as.

Thank you to Hossien Tahazid for helping the edit. My bad.

Update: I have tried using the mingw-w64 compiler on linux. It did not work. However, when I used the native linux compiler, the assembler worked completely. No errors generated.

Thank you to ssbssa for linking me to that bug. IS there a way for me to build edk2 on windows for mingw-w64, that way I can use visual studio code, is there a way to build it on Linux, convert the files to mingw-w64 suitable files, and then use those, or is there some other solution?

Update: I tried linking against only a part of the library, and it did not work. I've decided to stop trying to build gnu-efi for mingw-w64 until something is found, and shut up and use linux.

Upvotes: 0

Views: 329

Answers (1)

J. Doe
J. Doe

Reputation: 184

This seems to be an issue when using the url

https://git.code.sf.net/p/gnu-efi/code

to clone the gnu-efi code. Theres a more up to date version which fixes the ctors error on msys64 using the new url

https://github.com/ncroxon/gnu-efi

You might also want to have a look at https://github.com/pbatard/uefi-simple which works with msys64, its Makefile is very useful.

Upvotes: 0

Related Questions