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

Change assembler to clang in android MonoAOT #110393

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

jkurdek
Copy link
Member

@jkurdek jkurdek commented Dec 4, 2024

Android NDK 27 does not ship with an assembler. The recommendation is to use clang. This PR makes MonoAOT compiler use clang assembler when building android.

Related PR bumping version of NDK to 27: dotnet/dotnet-buildtools-prereqs-docker#1278

Changes were verified here: #110196

Copy link
Contributor

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

@jkurdek
Copy link
Member Author

jkurdek commented Dec 5, 2024

/azp run runtime-android, runtime-androidemulator

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@jkurdek
Copy link
Member Author

jkurdek commented Dec 5, 2024

/azp run runtime-android, runtime-androidemulator

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@@ -141,19 +149,6 @@
<AndroidLibraryMinApiLevel Condition="'$(AndroidLibraryMinApiLevel)' == ''">21</AndroidLibraryMinApiLevel>
</PropertyGroup>

<NdkToolFinderTask
Copy link
Member

Choose a reason for hiding this comment

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

Did you happen to test library mode with this change?

Copy link
Member

Choose a reason for hiding this comment

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

+1 :) ?

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 had an offline discussion with @steveisok about this. We agree that this should be handled as a follow up: #110757

@jkurdek
Copy link
Member Author

jkurdek commented Dec 13, 2024

Android fails are unrelated :)

Comment on lines 115 to 126
<PropertyGroup>
<_Triple Condition="'$(TargetArchitecture)' == 'arm'">armv7-linux-gnueabi</_Triple>
<_Triple Condition="'$(TargetArchitecture)' == 'arm64'">aarch64-linux-android</_Triple>
<_Triple Condition="'$(TargetArchitecture)' == 'x86'">i686-linux-android</_Triple>
<_Triple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-linux-android</_Triple>
</PropertyGroup>

<PropertyGroup>
<_LdName>clang</_LdName>
<_LdOptions>-fuse-ld=lld</_LdOptions>
<_AsName>clang</_AsName>
</PropertyGroup>
Copy link
Member

Choose a reason for hiding this comment

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

Can we extract these settings to a common .props file so that we don't specify them in the AndroidSampleApp again?

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -141,19 +149,6 @@
<AndroidLibraryMinApiLevel Condition="'$(AndroidLibraryMinApiLevel)' == ''">21</AndroidLibraryMinApiLevel>
</PropertyGroup>

<NdkToolFinderTask
Copy link
Member

Choose a reason for hiding this comment

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

+1 :) ?

src/mono/msbuild/android/build/AndroidBuild.targets Outdated Show resolved Hide resolved
@ivanpovazan
Copy link
Member

When testing, did we run runtime-extra-platforms?
Just want to make sure that running runtime-android and runtime-androidemulator have the same coverage?

@jkurdek
Copy link
Member Author

jkurdek commented Dec 16, 2024

/azp run runtime-extra-platforms

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jkurdek
Copy link
Member Author

jkurdek commented Dec 18, 2024

/azp run runtime-extra-platforms, runtime-android, runtime-androidemulator

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@ivanpovazan ivanpovazan left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

PS Having a sample app reuse AndroidBuild.targets configuration can be done in a separate PR

@jkurdek
Copy link
Member Author

jkurdek commented Dec 18, 2024

/ba-g test failures unrelated, android lines pass

@jkurdek jkurdek merged commit 5e52384 into dotnet:main Dec 18, 2024
198 of 210 checks passed
@jkurdek
Copy link
Member Author

jkurdek commented Dec 18, 2024

/backport to release/9.0-staging

Copy link
Contributor

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/12395728413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants