Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native AOT - Unrecognized command-line option #39819

Open
DragonSeason opened this issue Mar 27, 2024 · 0 comments
Open

Native AOT - Unrecognized command-line option #39819

DragonSeason opened this issue Mar 27, 2024 · 0 comments
Labels
Area-NativeAOT Native AOT compilation untriaged Request triage from a team member

Comments

@DragonSeason
Copy link

DragonSeason commented Mar 27, 2024

Operating system:
Debian GNU/Linux 11 (bullseye), 64-bit

(Same outputs are generated with a freshly created project)

I wanted to try and publish my project with Native AOT for linux-arm64. I also tried with linux-x64.
My command input with linux-arm64:

$dotnet publish -c Release -r linux-arm64 "code/DLL/DLL.csproj" -p:IncludeNativeLibrariesForSelfExtract=false -f net8.0

Console output:

myUser:~/Dokumente/Projects/myProject$ dotnet publish -c Release -r linux-arm64 "code/DLL/DLL.csproj" -p:IncludeNativeLibrariesForSelfExtract=false -f net8.0
MSBuild-Version 17.9.6+a4ecab324 für .NET
  Wiederherzustellende Projekte werden ermittelt...
  "/home/myUser/Dokumente/Projects/myProject/code/DLL/DLL.csproj" wiederhergestellt (in "1,1 sec").
  DLL -> /home/myUser/Dokumente/Projects/myProject/code/DLL/bin/Release/net8.0/linux-arm64/DLL.dll
gcc : error : unrecognized command-line option ‘--target=aarch64-linux-gnu’ [/home/myUser/Dokumente/Projects/myProject/code/DLL/DLL.csproj::TargetFramework=net8.0]
/home/myUser/.nuget/packages/microsoft.dotnet.ilcompiler/8.0.3/build/Microsoft.NETCore.Native.targets(367,5): error MSB3073: Der Befehl ""gcc" "obj/Release/net8.0/linux-arm64/native/DLL.o" -o "bin/Release/net8.0/linux-arm64/native/DLL.so" -Wl,--version-script=obj/Release/net8.0/linux-arm64/native/DLL.exports -Wl,--export-dynamic -gz=zlib -fuse-ld=bfd /home/myUser/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.3/sdk/libbootstrapperdll.o /home/myUser/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.3/sdk/libRuntime.WorkstationGC.a /home/myUser/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.3/sdk/libeventpipe-disabled.a /home/myUser/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.3/sdk/libstdc++compat.a /home/myUser/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.3/framework/libSystem.Native.a /home/myUser/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.3/framework/libSystem.IO.Compression.Native.a /home/myUser/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.3/framework/libSystem.Net.Security.Native.a /home/myUser/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.3/framework/libSystem.Security.Cryptography.Native.OpenSsl.a --target=aarch64-linux-gnu -g -Wl,-rpath,'$ORIGIN' -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -lrt -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--gc-sections" wurde mit dem Code 1 beendet. [/home/myUser/Dokumente/Projects/myProject/code/DLL/DLL.csproj::TargetFramework=net8.0]

My command input with linux-x64:

$ dotnet publish -c Release -r linux-x64 "code/DLL/DLL.csproj" -p:IncludeNativeLibrariesForSelfExtract=false -f net8.0

Console output:

DLL -> /home/myUser/Dokumente/Projects/myProject/code/DLL/bin/Release/net8.0/linux-x64/DLL.dll
  Generating native code
  /usr/bin/ld.bfd: cannot find -lz
collect2 : error : ld returned 1 exit status [/home/myUser/Dokumente/Projects/myProject/code/DLL/DLL.csproj::TargetFramework=net8.0]
/home/myUser/.nuget/packages/microsoft.dotnet.ilcompiler/8.0.3/build/Microsoft.NETCore.Native.targets(367,5): error MSB3073: Der Befehl ""gcc" "obj/Release/net8.0/linux-x64/native/DLL.o" -o "bin/Release/net8.0/linux-x64/native/DLL.so" -Wl,--version-script=obj/Release/net8.0/linux-x64/native/DLL.exports -Wl,--export-dynamic -gz=zlib -fuse-ld=bfd /home/myUser/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.3/sdk/libbootstrapperdll.o /home/myUser/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.3/sdk/libRuntime.WorkstationGC.a /home/myUser/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.3/sdk/libeventpipe-disabled.a /home/myUser/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.3/sdk/libstdc++compat.a /home/myUser/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.3/framework/libSystem.Native.a /home/myUser/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.3/framework/libSystem.IO.Compression.Native.a /home/myUser/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.3/framework/libSystem.Net.Security.Native.a /home/myUser/.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler/8.0.3/framework/libSystem.Security.Cryptography.Native.OpenSsl.a -g -Wl,-rpath,'$ORIGIN' -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -lrt -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--gc-sections" wurde mit dem Code 1 beendet. [/home/myUser/Dokumente/Projects/myProject/code/DLL/DLL.csproj::TargetFramework=net8.0]
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NativeAOT Native AOT compilation untriaged Request triage from a team member labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NativeAOT Native AOT compilation untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant