2

I'm trying to build a UEFI binary in stable Rust, so I don't use the x86_64-unknown-uefi target as it requires the Nightly toolchain. To do so, I created .cargo/config.toml:

[build]
target = "x86_64-pc-windows-gnu"

[target.x86_64-pc-windows-gnu]
rustflags = [
    "-C", "link-args=/nologo /nxcompat /nodefaultlib /entry:efi_main /subsystem:efi_application",
    "-C", "code-model=large",
    "-C", "prefer-dynamic=n",
    "-C", "no-redzone=y",
    "-C", "panic=abort",
    "-C", "linker=lld-link",
]

Building succeeds on my local machine but fails on GitHub Actions (log). The x86_64-w64-mingw32-ld is still used even if I specify lld-link as a linker.

How do I force cargo to use lld-link?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
toku-sa-n
  • 798
  • 1
  • 8
  • 27

0 Answers0