-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[NativeAOT] Build support for linux-bionic-arm / linux-musl-arm #97996
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsContributes to #97729
|
I had to make some local changes unrelated to ARM to get this building, but it does run on an emulator:
|
@@ -43,11 +43,12 @@ The .NET Foundation licenses this file to you under the MIT license. | |||
|
|||
<CrossCompileAbi>gnu</CrossCompileAbi> | |||
<CrossCompileAbi Condition="$(CrossCompileRid.EndsWith('-arm'))">gnueabihf</CrossCompileAbi> | |||
<CrossCompileAbi Condition="$(CrossCompileRid.EndsWith('-arm')) and $(CrossCompileRid.StartsWith('linux-bionic'))">androideabi21</CrossCompileAbi> | |||
<CrossCompileAbi Condition="!$(CrossCompileRid.EndsWith('-arm')) and $(CrossCompileRid.StartsWith('linux-bionic'))">android21</CrossCompileAbi> | |||
|
|||
<TargetTriple /> | |||
<TargetTriple Condition="'$(CrossCompileArch)' != ''">$(CrossCompileArch)-linux-$(CrossCompileAbi)</TargetTriple> | |||
<TargetTriple Condition="'$(CrossCompileArch)' != '' and ($(CrossCompileRid.StartsWith('linux-musl')) or $(CrossCompileRid.StartsWith('alpine')))">$(CrossCompileArch)-alpine-linux-musl</TargetTriple> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add musl at the same time? <CrossCompileAbi Condition="'$(CrossCompileRid)' == 'linux-musl-arm'">musleabihf</CrossCompileAbi>
We can then test with docker run --rm -it cbl-mariner-2.0-cross-arm-alpine
and docker run --rm --platform linux/arm/v7 -it alpine
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should. I just didn't have an environment to test it. :-)
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 🏅
<CrossCompileAbi Condition="$(CrossCompileRid.StartsWith('linux-bionic'))">android21</CrossCompileAbi> | ||
<CrossCompileAbi Condition="'$(CrossCompileRid)' == 'linux-arm'">gnueabihf</CrossCompileAbi> | ||
<CrossCompileAbi Condition="'$(CrossCompileRid)' == 'linux-bionic-arm'">androideabi21</CrossCompileAbi> | ||
<CrossCompileAbi Condition="'$(CrossCompileRid)' == 'linux-musl-arm'">musleabihf</CrossCompileAbi> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this going to be ignored because line 52 will kick in and overwrite the whole TargetTriple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Good catch...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@am11 Do we need to keep the -alpine
vendor part in the triple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, no need for -alpine distro specificity. We can omit it to keep our options open (Void musl, Gentoo musl etc.) :)
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
Outdated
Show resolved
Hide resolved
…e.Unix.targets Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
Contributes to #97729