dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.75k stars 1.07k forks source link

AARCH64 Aot build fail on linux with `unrecognised emulation mode: aarch64linux` #40916

Open Coloryr opened 6 months ago

Coloryr commented 6 months ago

Describe the bug

AARCH64 Aot build fail on linux with sdk 8.0.300

  /usr/bin/ld.bfd: unrecognised emulation mode: aarch64linux
  Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe
clang : error : linker command failed with exit code 1 (use -v to see invocation) [/home/runner/work/ColorMC/ColorMC/src/ColorMC.Launcher/ColorMC.Launcher.csproj]
/home/runner/.nuget/packages/microsoft.dotnet.ilcompiler/8.0.5/build/Microsoft.NETCore.Native.targets(366,5): error MSB3073: The command ""clang" "obj/Release/net8.0/linux-arm64/native/ColorMC.Launcher.o" -o "bin/Release/net8.0/linux-arm64/native/ColorMC.Launcher" -Wl,--version-script=obj/Release/net8.0/linux-arm64/native/ColorMC.Launcher.exports -Wl,--export-dynamic -gz=zlib -fuse-ld=bfd /home/runner/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.5/sdk/libbootstrapper.o /home/runner/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.5/sdk/libRuntime.WorkstationGC.a /home/runner/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.5/sdk/libeventpipe-disabled.a /home/runner/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.5/sdk/libstdc++compat.a /home/runner/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.5/framework/libSystem.Native.a /home/runner/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.5/framework/libSystem.Globalization.Native.a /home/runner/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.5/framework/libSystem.IO.Compression.Native.a /home/runner/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.5/framework/libSystem.Net.Security.Native.a /home/runner/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.5/framework/libSystem.Security.Cryptography.Native.OpenSsl.a --target=aarch64-linux-gnu -g -Wl,-rpath,'$ORIGIN' -Wl,--build-id=sha1 -Wl,--as-needed -pthread -ldl -lz -lrt -lm -pie -Wl,-pie -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--gc-sections" exited with code 1. [/home/runner/work/ColorMC/ColorMC/src/ColorMC.Launcher/ColorMC.Launcher.csproj]

To Reproduce

Exceptions (if any)

Further technical details

In github action https://github.com/Coloryr/ColorMC/actions/runs/9105565070/job/25031348502#step:6:629

shallowtek commented 6 months ago

I am having issues with deploying my Native AOT app to AKS. The AKS Node gives "exec format error" with Ubuntu Linux arm64 OS on Node. When I specified the app in the .csproj to use linux-arm64 runtime, during publish I get the "unrecognised emulation mode: aarch64linux".