Change:
Steps to reproduce the behavior: pkgsCross.aarch64-multiplatform.edk2 Full log here: Few last lines: EDK2 package was updated in nixpkgs, and after that cross-compilation from x86_64 to aarch64 stopped working. The issue appeared in latest update commit: The package has no maintainers set in meta. The breaking change was introduced by: I see cross-compilation fixes have been made previously by: Other contributors who have contributed over the past year, I got from and : "Sandro Jäckel" and Please run and paste the result.
Actually I had binfmt for aarch64-linux emulated, I disabled it and now build fails even earlier when it tries to run antlr built for aarch64-linux:
Unable to reproduce: I just cross compiled EDK2 with .
Wait, I had a dinosaur nixpkgs there on a feature branch, testing again.
I concur, antlr is trying to be executed but it's not a binary for the right platform. This seems to be a breakage upstream as they seem to ship their own ANTLR binaries.
I won't have time to tackle it as I have too much on my plate right now.
Any change on looking at this now as we are going towards NixOS 23.11?
Thank you!

Discussion:
, tpmSupport ? false , tlsSupport ? false , debug ? false <del> , sourceDebug ? debug </del> <ins> # Usually, this option is broken, do not use it except if you know what you are # doing. , sourceDebug ? false </ins> }: assert csmSupport -> seabios != null;

"OvmfPkg/OvmfPkgX64.dsc" else if stdenv.hostPlatform.isAarch then "ArmVirtPkg/ArmVirtQemu.dsc" <ins> else if stdenv.hostPlatform.isRiscV then "OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc" </ins> else throw "Unsupported architecture";

cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin ''; <del> postFixup = if stdenv.hostPlatform.isAarch then '' </del> <ins> postFixup = ( if stdenv.hostPlatform.isAarch then '' </ins> mkdir -vp $fd/FV mkdir -vp $fd/AAVMF mv -v $out/FV/QEMU_{EFI,VARS}.fd $fd/FV

# Also add symlinks for Fedora dir layout: https://src.fedoraproject.org/cgit/rpms/edk2.git/tree/edk2.spec ln -s $fd/FV/AAVMF_CODE.fd $fd/AAVMF/QEMU_EFI-pflash.raw ln -s $fd/FV/AAVMF_VARS.fd $fd/AAVMF/vars-template-pflash.raw <del> '' else '' </del> <ins> '' else if stdenv.hostPlatform.isRiscV then '' mkdir -vp $fd/FV mv -v $out/FV/RISCV_VIRT_{CODE,VARS}.fd $fd/FV/ truncate -s 32M $fd/FV/RISCV_VIRT_CODE.fd truncate -s 32M $fd/FV/RISCV_VIRT_VARS.fd '' else '' </ins> mkdir -vp $fd/FV mv -v $out/FV/OVMF{,_CODE,_VARS}.fd $fd/FV <del> ''; </del> <ins> ''); </ins> dontPatchELF = true;

license = lib.licenses.bsd2; inherit (edk2.meta) platforms; maintainers = with lib.maintainers; [ adamcstephens raitobezarius ]; <ins> broken = stdenv.isDarwin; </ins> }; })

"ARM" else if stdenv.isAarch64 then "AARCH64" <ins> else if stdenv.hostPlatform.isRiscV64 then "RISCV64" </ins> else throw "Unsupported architecture";

edk2 = stdenv.mkDerivation rec { pname = "edk2"; <del> version = "202308"; </del> <ins> version = "202311"; </ins> patches = [ # pass targetPrefix as an env var

repo = "edk2"; rev = "edk2-stable${edk2.version}"; fetchSubmodules = true; <del> hash = "sha256-Eoi1xf/hw/Knr7n0f0rgVof7wTgrHkmvV4eJjJV1NhM="; </del> <ins> hash = "sha256-gC/If8U9qo70rGvNl3ld/mmZszwY0w/5Ge/K21mhzYw="; </ins> }; # We don't want EDK2 to keep track of OpenSSL,

''; nativeBuildInputs = [ pythonEnv ]; <del> depsBuildBuild = [ buildPackages.stdenv.cc buildPackages.util-linux buildPackages.bash ]; </del> <ins> depsBuildBuild = [ buildPackages.stdenv.cc buildPackages.bash ]; depsHostHost = [ libuuid ]; </ins> strictDeps = true; # trick taken from https://src.fedoraproject.org/rpms/edk2/blob/08f2354cd280b4ce5a7888aa85cf520e042955c3/f/edk2.spec#_319 <del> ${"GCC5_${targetArch}_PREFIX"}=stdenv.cc.targetPrefix; </del> <ins> ${"GCC5_${targetArch}_PREFIX"} = stdenv.cc.targetPrefix; </ins> makeFlags = [ "-C BaseTools" ];

description = "Intel EFI development kit"; homepage = "https://github.com/tianocore/tianocore.github.io/wiki/EDK-II/"; license = licenses.bsd2; <del> platforms = with platforms; aarch64 ++ arm ++ i686 ++ x86_64; </del> <ins> platforms = with platforms; aarch64 ++ arm ++ i686 ++ x86_64 ++ riscv64; </ins> }; passthru = {