Page 1 of 1

Aarch64 PE GNU toolchain

Posted: Fri Jul 02, 2021 9:58 am
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

Re: Aarch64 PE GNU toolchain

Posted: Fri Jul 02, 2021 2:06 pm
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

Re: Aarch64 PE GNU toolchain

Posted: Fri Jul 02, 2021 2:40 pm
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 .