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

[NativeAOT] Build support for linux-bionic-arm / linux-musl-arm #97996

Merged
merged 5 commits into from
Feb 12, 2024

Conversation

filipnavara
Copy link
Member

Contributes to #97729

@filipnavara filipnavara requested review from am11 and removed request for MichalStrehovsky February 5, 2024 19:07
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Feb 5, 2024
@ghost
Copy link

ghost commented Feb 5, 2024

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

Issue Details

Contributes to #97729

Author: filipnavara
Assignees: -
Labels:

community-contribution, area-NativeAOT-coreclr

Milestone: -

@filipnavara
Copy link
Member Author

I had to make some local changes unrelated to ARM to get this building, but it does run on an emulator:

generic:/data/local/tmp # ./consoleapp
WARNING: linker: /data/local/tmp/consoleapp: unsupported flags DT_FLAGS_1=0x8000001
Hello, World!
generic:/data/local/tmp # uname -a
Linux localhost 3.10.0+ #255 SMP PREEMPT Fri May 19 11:50:06 PDT 2017 armv7l
generic:/data/local/tmp #

@@ -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>
Copy link
Member

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.

Copy link
Member Author

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. :-)

@filipnavara filipnavara changed the title [NativeAOT] Build support for linux-bionic-arm [NativeAOT] Build support for linux-bionic-arm / linux-musl-arm Feb 5, 2024
Copy link
Member

@am11 am11 left a 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>
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. Good catch...

Copy link
Member Author

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?

Copy link
Member

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.) :)

…e.Unix.targets

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@MichalStrehovsky
Copy link
Member

/azp run runtime-nativeaot-outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky MichalStrehovsky merged commit 9699f39 into dotnet:main Feb 12, 2024
123 of 126 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants