You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NativeAOT] How to compile linux-musl-arm64 shared libraries on Ubuntu( x64) #106029
area-NativeAOT-coreclrin-prThere is an active PR which will close this issue when it is mergedquestionAnswer questions and provide assistance, not an issue with source code or documentation.
I want to compile a shared library for the arm64 platform that libc is musl.
But I only have ubuntu (wsl) on x86
I found a cross-platform compiler: aarch64-linux-musl-cross
However, dotnet's publish command does not recognize the compiler, it seems that it only recognizes clang and gcc
area-NativeAOT-coreclrin-prThere is an active PR which will close this issue when it is mergedquestionAnswer questions and provide assistance, not an issue with source code or documentation.
Activity
dotnet-policy-service commentedon Aug 6, 2024
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.
MichalStrehovsky commentedon Aug 7, 2024
If you have a correctly configured cross toolchain, adding
-p:CppCompilerAndLinker=aarch64-linux-musl-gccshould be all that's needed.You might want to also look at https://www.nuget.org/packages/PublishAotCross#readme-body-tab.
CeSun commentedon Aug 7, 2024
Thank you.

PublishAotCross is a good project, But I encountered a new problem, maybe I need add an issue?
EXEC : error : unsupported linker arg: -e0x0MichalStrehovsky commentedon Aug 7, 2024
Can you try finding clang.cmd in your NuGet package cache (the contents should look like this: https://github.com/MichalStrehovsky/PublishAotCross/blob/master/src/clang.cmd) and add
set args=%args:-Wl,-e0x0 =%after line 20? If that works, we can just upstream it to PublishAotCross.CeSun commentedon Aug 7, 2024
It worked!
Add space in shared lib entrypoint option (dotnet#106073)