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

Publishing for linux-bionix-x64 using NativeAOT fails #95223

Closed
emmauss opened this issue Nov 25, 2023 · 5 comments · Fixed by #95312
Closed

Publishing for linux-bionix-x64 using NativeAOT fails #95223

emmauss opened this issue Nov 25, 2023 · 5 comments · Fixed by #95312

Comments

@emmauss
Copy link

emmauss commented Nov 25, 2023

Description

Publishing a .net class library with the linux-bionic-x64 rid using NativeAOT fails with a clang error. Publishing with linux-bionic-arm64 works fine. The following is the command output with both targets;

D:\natTest>dotnet publish . -r linux-bionic-arm64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  Restored D:\natTest\natTest.csproj (in 360 ms).
  natTest -> D:\natTest\bin\Release\net8.0\linux-bionic-arm64\natTest.dll
  Generating native code
  natTest -> D:\natTest\bin\Release\net8.0\linux-bionic-arm64\publish\

D:\natTest>dotnet publish . -r linux-bionic-x64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  Restored D:\natTest\natTest.csproj (in 304 ms).
  natTest -> D:\natTest\bin\Release\net8.0\linux-bionic-x64\natTest.dll
  Generating native code
lld : error : unknown argument: --version-script=obj\Release\net8.0\linux-bionic-x64\native\natTest.exports [D:\natTest\natTest.csproj]
lld : error : unknown argument: -rpath [D:\natTest\natTest.csproj]
lld : error : unknown argument: --build-id=sha1 [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: --eh-frame-hdr [D:\natTest\natTest.csproj]
lld : error : unknown argument: --discard-all [D:\natTest\natTest.csproj]
lld : error : unknown argument: -T [D:\natTest\natTest.csproj]
clang : error : linker command failed with exit code 1 (use -v to see invocation) [D:\natTest\natTest.csproj]
C:\nuget\packages\microsoft.dotnet.ilcompiler\8.0.0\build\Microsoft.NETCore.Native.targets(364,5): error MSB3073: The command ""clang" "obj\Release\net8.0\linux-bionic-x
64\native\natTest.o" -o "bin\Release\net8.0\linux-bionic-x64\native\natTest.so" -Wl,--version-script=obj\Release\net8.0\linux-bionic-x64\native\natTest.exports -gz=zlib
-fuse-ld=lld C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libbootstrapperdll.o C:\nuget\packages\mi
crosoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libRuntime.WorkstationGC.a C:\nuget\packages\microsoft.netcore.app.runtime
.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libeventpipe-disabled.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.
0.0/runtimes/linux-bionic-x64/\native\libstdc++compat.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\nativ
e\libSystem.Native.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.IO.Compression.Native.a
 C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.Security.Cryptography.Native.OpenSsl.a -g -
Wl,-rpath,"$ORIGIN" -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -llog -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--
gc-sections -Wl,-T,"obj\Release\net8.0\linux-bionic-x64\native\sections.ld"" exited with code 1. [D:\natTest\natTest.csproj]

A reproduction can be found here, https://github.com/emmauss/natTest .

Reproduction Steps

  1. Create a Class Library project
  2. Set the following project properties;
<NativeLib>Shared</NativeLib>
<InvariantGlobalization>true</InvariantGlobalization>
<PublishAot>true</PublishAot>
  1. Set the top of the PATH environmental variable to the android ndk: set path=C:\Android\android-sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\bin;%path%
  2. Publish with linux-bionic-x64 target: dotnet publish . -r linux-bionic-x64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true

Expected behavior

Publishing with linux-bionic-x64 should succeed like linux-bionic-arm64 does.

Actual behavior

clang fails with this error;

lld : error : unknown argument: -rpath [D:\natTest\natTest.csproj]
lld : error : unknown argument: --build-id=sha1 [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: --eh-frame-hdr [D:\natTest\natTest.csproj]
lld : error : unknown argument: --discard-all [D:\natTest\natTest.csproj]
lld : error : unknown argument: -T [D:\natTest\natTest.csproj]
clang : error : linker command failed with exit code 1 (use -v to see invocation) [D:\natTest\natTest.csproj]
C:\nuget\packages\microsoft.dotnet.ilcompiler\8.0.0\build\Microsoft.NETCore.Native.targets(364,5): error MSB3073: The command ""clang" "obj\Release\net8.0\linux-bionic-x
64\native\natTest.o" -o "bin\Release\net8.0\linux-bionic-x64\native\natTest.so" -Wl,--version-script=obj\Release\net8.0\linux-bionic-x64\native\natTest.exports -gz=zlib
-fuse-ld=lld C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libbootstrapperdll.o C:\nuget\packages\mi
crosoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libRuntime.WorkstationGC.a C:\nuget\packages\microsoft.netcore.app.runtime
.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libeventpipe-disabled.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.
0.0/runtimes/linux-bionic-x64/\native\libstdc++compat.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\nativ
e\libSystem.Native.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.IO.Compression.Native.a
 C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.Security.Cryptography.Native.OpenSsl.a -g -
Wl,-rpath,"$ORIGIN" -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -llog -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--
gc-sections -Wl,-T,"obj\Release\net8.0\linux-bionic-x64\native\sections.ld"" exited with code 1. [D:\natTest\natTest.csproj]

Regression?

No response

Known Workarounds

No response

Configuration

OS: Windows 11 x86-64
.Net Version: 8.0.0 Release

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 25, 2023
@ghost
Copy link

ghost commented Nov 25, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Publishing a .net class library with the linux-bionic-x64 rid using NativeAOT fails with a clang error. Publishing with linux-bionic-arm64 works fine. The following is the command output with both targets;

D:\natTest>dotnet publish . -r linux-bionic-arm64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  Restored D:\natTest\natTest.csproj (in 360 ms).
  natTest -> D:\natTest\bin\Release\net8.0\linux-bionic-arm64\natTest.dll
  Generating native code
  natTest -> D:\natTest\bin\Release\net8.0\linux-bionic-arm64\publish\

D:\natTest>dotnet publish . -r linux-bionic-x64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  Restored D:\natTest\natTest.csproj (in 304 ms).
  natTest -> D:\natTest\bin\Release\net8.0\linux-bionic-x64\natTest.dll
  Generating native code
lld : error : unknown argument: --version-script=obj\Release\net8.0\linux-bionic-x64\native\natTest.exports [D:\natTest\natTest.csproj]
lld : error : unknown argument: -rpath [D:\natTest\natTest.csproj]
lld : error : unknown argument: --build-id=sha1 [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: --eh-frame-hdr [D:\natTest\natTest.csproj]
lld : error : unknown argument: --discard-all [D:\natTest\natTest.csproj]
lld : error : unknown argument: -T [D:\natTest\natTest.csproj]
clang : error : linker command failed with exit code 1 (use -v to see invocation) [D:\natTest\natTest.csproj]
C:\nuget\packages\microsoft.dotnet.ilcompiler\8.0.0\build\Microsoft.NETCore.Native.targets(364,5): error MSB3073: The command ""clang" "obj\Release\net8.0\linux-bionic-x
64\native\natTest.o" -o "bin\Release\net8.0\linux-bionic-x64\native\natTest.so" -Wl,--version-script=obj\Release\net8.0\linux-bionic-x64\native\natTest.exports -gz=zlib
-fuse-ld=lld C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libbootstrapperdll.o C:\nuget\packages\mi
crosoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libRuntime.WorkstationGC.a C:\nuget\packages\microsoft.netcore.app.runtime
.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libeventpipe-disabled.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.
0.0/runtimes/linux-bionic-x64/\native\libstdc++compat.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\nativ
e\libSystem.Native.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.IO.Compression.Native.a
 C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.Security.Cryptography.Native.OpenSsl.a -g -
Wl,-rpath,"$ORIGIN" -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -llog -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--
gc-sections -Wl,-T,"obj\Release\net8.0\linux-bionic-x64\native\sections.ld"" exited with code 1. [D:\natTest\natTest.csproj]

A reproduction can be found here, https://github.com/emmauss/natTest .

Reproduction Steps

  1. Create a Class Library project
  2. Set the following project properties;
<NativeLib>Shared</NativeLib>
<InvariantGlobalization>true</InvariantGlobalization>
<PublishAot>true</PublishAot>
  1. Set the top of the PATH environmental variable to the android ndk: set path=C:\Android\android-sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\bin;%path%
  2. Publish with linux-bionic-x64 target: dotnet publish . -r linux-bionic-x64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true

Expected behavior

Publishing with linux-bionic-x64 should succeed like linux-bionic-arm64 does.

Actual behavior

clang fails with this error;

lld : error : unknown argument: -rpath [D:\natTest\natTest.csproj]
lld : error : unknown argument: --build-id=sha1 [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: --eh-frame-hdr [D:\natTest\natTest.csproj]
lld : error : unknown argument: --discard-all [D:\natTest\natTest.csproj]
lld : error : unknown argument: -T [D:\natTest\natTest.csproj]
clang : error : linker command failed with exit code 1 (use -v to see invocation) [D:\natTest\natTest.csproj]
C:\nuget\packages\microsoft.dotnet.ilcompiler\8.0.0\build\Microsoft.NETCore.Native.targets(364,5): error MSB3073: The command ""clang" "obj\Release\net8.0\linux-bionic-x
64\native\natTest.o" -o "bin\Release\net8.0\linux-bionic-x64\native\natTest.so" -Wl,--version-script=obj\Release\net8.0\linux-bionic-x64\native\natTest.exports -gz=zlib
-fuse-ld=lld C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libbootstrapperdll.o C:\nuget\packages\mi
crosoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libRuntime.WorkstationGC.a C:\nuget\packages\microsoft.netcore.app.runtime
.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libeventpipe-disabled.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.
0.0/runtimes/linux-bionic-x64/\native\libstdc++compat.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\nativ
e\libSystem.Native.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.IO.Compression.Native.a
 C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.Security.Cryptography.Native.OpenSsl.a -g -
Wl,-rpath,"$ORIGIN" -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -llog -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--
gc-sections -Wl,-T,"obj\Release\net8.0\linux-bionic-x64\native\sections.ld"" exited with code 1. [D:\natTest\natTest.csproj]

Regression?

No response

Known Workarounds

No response

Configuration

OS: Windows 11 x86-64
.Net Version: 8.0.0 Release

Other information

No response

Author: emmauss
Assignees: -
Labels:

untriaged, area-NativeAOT-coreclr

Milestone: -

@ghost
Copy link

ghost commented Nov 25, 2023

Tagging subscribers to 'arch-android': @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

Publishing a .net class library with the linux-bionic-x64 rid using NativeAOT fails with a clang error. Publishing with linux-bionic-arm64 works fine. The following is the command output with both targets;

D:\natTest>dotnet publish . -r linux-bionic-arm64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  Restored D:\natTest\natTest.csproj (in 360 ms).
  natTest -> D:\natTest\bin\Release\net8.0\linux-bionic-arm64\natTest.dll
  Generating native code
  natTest -> D:\natTest\bin\Release\net8.0\linux-bionic-arm64\publish\

D:\natTest>dotnet publish . -r linux-bionic-x64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true
MSBuild version 17.8.3+195e7f5a3 for .NET
  Determining projects to restore...
  Restored D:\natTest\natTest.csproj (in 304 ms).
  natTest -> D:\natTest\bin\Release\net8.0\linux-bionic-x64\natTest.dll
  Generating native code
lld : error : unknown argument: --version-script=obj\Release\net8.0\linux-bionic-x64\native\natTest.exports [D:\natTest\natTest.csproj]
lld : error : unknown argument: -rpath [D:\natTest\natTest.csproj]
lld : error : unknown argument: --build-id=sha1 [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: --eh-frame-hdr [D:\natTest\natTest.csproj]
lld : error : unknown argument: --discard-all [D:\natTest\natTest.csproj]
lld : error : unknown argument: -T [D:\natTest\natTest.csproj]
clang : error : linker command failed with exit code 1 (use -v to see invocation) [D:\natTest\natTest.csproj]
C:\nuget\packages\microsoft.dotnet.ilcompiler\8.0.0\build\Microsoft.NETCore.Native.targets(364,5): error MSB3073: The command ""clang" "obj\Release\net8.0\linux-bionic-x
64\native\natTest.o" -o "bin\Release\net8.0\linux-bionic-x64\native\natTest.so" -Wl,--version-script=obj\Release\net8.0\linux-bionic-x64\native\natTest.exports -gz=zlib
-fuse-ld=lld C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libbootstrapperdll.o C:\nuget\packages\mi
crosoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libRuntime.WorkstationGC.a C:\nuget\packages\microsoft.netcore.app.runtime
.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libeventpipe-disabled.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.
0.0/runtimes/linux-bionic-x64/\native\libstdc++compat.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\nativ
e\libSystem.Native.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.IO.Compression.Native.a
 C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.Security.Cryptography.Native.OpenSsl.a -g -
Wl,-rpath,"$ORIGIN" -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -llog -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--
gc-sections -Wl,-T,"obj\Release\net8.0\linux-bionic-x64\native\sections.ld"" exited with code 1. [D:\natTest\natTest.csproj]

A reproduction can be found here, https://github.com/emmauss/natTest .

Reproduction Steps

  1. Create a Class Library project
  2. Set the following project properties;
<NativeLib>Shared</NativeLib>
<InvariantGlobalization>true</InvariantGlobalization>
<PublishAot>true</PublishAot>
  1. Set the top of the PATH environmental variable to the android ndk: set path=C:\Android\android-sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\bin;%path%
  2. Publish with linux-bionic-x64 target: dotnet publish . -r linux-bionic-x64 -p:DisableUnsupportedError=true -p:PublishAotUsingRuntimePack=true

Expected behavior

Publishing with linux-bionic-x64 should succeed like linux-bionic-arm64 does.

Actual behavior

clang fails with this error;

lld : error : unknown argument: -rpath [D:\natTest\natTest.csproj]
lld : error : unknown argument: --build-id=sha1 [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: -z [D:\natTest\natTest.csproj]
lld : error : unknown argument: --eh-frame-hdr [D:\natTest\natTest.csproj]
lld : error : unknown argument: --discard-all [D:\natTest\natTest.csproj]
lld : error : unknown argument: -T [D:\natTest\natTest.csproj]
clang : error : linker command failed with exit code 1 (use -v to see invocation) [D:\natTest\natTest.csproj]
C:\nuget\packages\microsoft.dotnet.ilcompiler\8.0.0\build\Microsoft.NETCore.Native.targets(364,5): error MSB3073: The command ""clang" "obj\Release\net8.0\linux-bionic-x
64\native\natTest.o" -o "bin\Release\net8.0\linux-bionic-x64\native\natTest.so" -Wl,--version-script=obj\Release\net8.0\linux-bionic-x64\native\natTest.exports -gz=zlib
-fuse-ld=lld C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libbootstrapperdll.o C:\nuget\packages\mi
crosoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libRuntime.WorkstationGC.a C:\nuget\packages\microsoft.netcore.app.runtime
.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libeventpipe-disabled.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.
0.0/runtimes/linux-bionic-x64/\native\libstdc++compat.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\nativ
e\libSystem.Native.a C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.IO.Compression.Native.a
 C:\nuget\packages\microsoft.netcore.app.runtime.nativeaot.linux-bionic-x64\8.0.0/runtimes/linux-bionic-x64/\native\libSystem.Security.Cryptography.Native.OpenSsl.a -g -
Wl,-rpath,"$ORIGIN" -Wl,--build-id=sha1 -Wl,--as-needed -Wl,-e0x0 -pthread -ldl -lz -llog -lm -shared -Wl,-z,relro -Wl,-z,now -Wl,--eh-frame-hdr -Wl,--discard-all -Wl,--
gc-sections -Wl,-T,"obj\Release\net8.0\linux-bionic-x64\native\sections.ld"" exited with code 1. [D:\natTest\natTest.csproj]

Regression?

No response

Known Workarounds

No response

Configuration

OS: Windows 11 x86-64
.Net Version: 8.0.0 Release

Other information

No response

Author: emmauss
Assignees: -
Labels:

os-android, untriaged, area-NativeAOT-coreclr

Milestone: -

@agocke agocke added this to AppModel Nov 27, 2023
@agocke agocke added this to the 9.0.0 milestone Nov 27, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Nov 27, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Nov 28, 2023
@am11
Copy link
Member

am11 commented Nov 28, 2023

I think <LinkerArg Include="--target=x86_64-linux-android21" /> in your csproj file will fix workaround this issue.

Possible fix for upstream #95312

@MichalStrehovsky
Copy link
Member

I think <LinkerArg Include="--target=x86_64-linux-android21" /> in your csproj file will fix workaround this issue.

It will only get you one step further to hit #93942.

MichalStrehovsky added a commit to MichalStrehovsky/runtime that referenced this issue Nov 28, 2023
Fixes dotnet#93942. Works around dotnet#95223 (a better but more risky fix is in dotnet#95312, so I'm not going to resolve that with this PR).

The first issue is that we don't consider x64 Windows (or x64 Linux) to x64 Bionic build a crossbuild. The crossbuild detection only looks at architecture, not at the OS. The fix is very conservative so that we can backport to 8.0. Bionic is always a crossbuild.

The second part is a port of dotnet/corert#8323 to x64. It is a lot less work than on arm64 because x64 Linux already has to assume `INLINE_GETTHREAD` could be a call so everything is setup for it.

I tested this all on a x64 Bionic hello world. I also ran all of smoke tests on x64 Linux with `FEATURE_EMULATED_TLS` enabled. All of this looks very non-risky so I'm going to ask for a backport.
MichalStrehovsky added a commit that referenced this issue Nov 29, 2023
Fixes #93942. Works around #95223 (a better but more risky fix is in #95312, so I'm not going to resolve that with this PR).

The first issue is that we don't consider x64 Windows (or x64 Linux) to x64 Bionic build a crossbuild. The crossbuild detection only looks at architecture, not at the OS. The fix is very conservative so that we can backport to 8.0. Bionic is always a crossbuild.

The second part is a port of dotnet/corert#8323 to x64. It is a lot less work than on arm64 because x64 Linux already has to assume `INLINE_GETTHREAD` could be a call so everything is setup for it.

I tested this all on a x64 Bionic hello world. I also ran all of smoke tests on x64 Linux with `FEATURE_EMULATED_TLS` enabled. All of this looks very non-risky so I'm going to ask for a backport.
github-actions bot pushed a commit that referenced this issue Nov 29, 2023
Fixes #93942. Works around #95223 (a better but more risky fix is in #95312, so I'm not going to resolve that with this PR).

The first issue is that we don't consider x64 Windows (or x64 Linux) to x64 Bionic build a crossbuild. The crossbuild detection only looks at architecture, not at the OS. The fix is very conservative so that we can backport to 8.0. Bionic is always a crossbuild.

The second part is a port of dotnet/corert#8323 to x64. It is a lot less work than on arm64 because x64 Linux already has to assume `INLINE_GETTHREAD` could be a call so everything is setup for it.

I tested this all on a x64 Bionic hello world. I also ran all of smoke tests on x64 Linux with `FEATURE_EMULATED_TLS` enabled. All of this looks very non-risky so I'm going to ask for a backport.
@MichalStrehovsky
Copy link
Member

This is fixed (and the other bug too) in the latest .NET 9 builds. I'm trying to get this backported to 8.0. If #95382 merges, this should be available in the February .NET 8 servicing release.

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Dec 1, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants