Aarch64 PE GNU toolchain

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Aarch64 PE GNU toolchain

Post by nexos »

Hello,
I going to be make a UEFI bootloader for my Raspberry Pi 3, as there are some OVMF images I found that work on it. My only problem is that there seems to be no aarch64-mingw32 toolchain in GCC and Binutils. Has anybody ever built an Aarch64 Mingw32 toolchain? If so, please tell me how! I tried building clang, but my machine kept running out of memory, even after adjusting link and job counts (and I have 8 GB of RAM!). I also am not willing to use GNU-EFI.
Thanks,
nexos
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
Octocontrabass
Member
Member
Posts: 5567
Joined: Mon Mar 25, 2013 7:01 pm

Re: Aarch64 PE GNU toolchain

Post by Octocontrabass »

nexos wrote:I tried building clang,
Why? Clang is already a cross-compiler.

Install the Clang package provided by your distro and try this:

Code: Select all

clang -o program.efi program.c -ffreestanding -nostdlib -mno-stack-arg-probe --target=aarch64-unknown-windows -fuse-ld=lld-link -Wl,-entry:efi_main -Wl,-subsystem:efi_application
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Aarch64 PE GNU toolchain

Post by nexos »

Octocontrabass wrote:
nexos wrote:I tried building clang,
Why? Clang is already a cross-compiler.

Install the Clang package provided by your distro and try this:

Code: Select all

clang -o program.efi program.c -ffreestanding -nostdlib -mno-stack-arg-probe --target=aarch64-unknown-windows -fuse-ld=lld-link -Wl,-entry:efi_main -Wl,-subsystem:efi_application
That is true, that skipped my mind #-o .
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
Post Reply