Skip to content

[LoongArch64] Add nativeaot support on LoongArch64.#103889

Merged
jkotas merged 11 commits into
dotnet:mainfrom
sunlijun-610:main2
Jul 6, 2024
Merged

[LoongArch64] Add nativeaot support on LoongArch64.#103889
jkotas merged 11 commits into
dotnet:mainfrom
sunlijun-610:main2

Conversation

@sunlijun-610

Copy link
Copy Markdown
Contributor

This PR adds nativeaot support on LoongArch64.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 24, 2024
@sunlijun-610

Copy link
Copy Markdown
Contributor Author

Hi, @MichalStrehovsky @shushanhf
Could you please review this PR? Thanks!

Comment thread src/native/external/llvm-libunwind/src/Registers.hpp Outdated
Comment thread src/native/external/llvm-libunwind/src/CompactUnwinder.hpp Outdated
Comment thread src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/JitHelper.cs
Comment thread src/coreclr/nativeaot/Runtime/PalRedhawk.h Outdated
Comment thread src/coreclr/nativeaot/Runtime/PalRedhawkCommon.h Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/PInvoke.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/PInvoke.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/unix/UnwindHelpers.cpp Outdated
Comment thread src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/JitHelper.cs
Comment thread src/native/external/llvm-libunwind/src/CompactUnwinder.hpp Outdated
Comment thread src/native/external/llvm-libunwind/src/Registers.hpp Outdated
Comment thread src/native/external/llvm-libunwind/src/Registers.hpp
Comment thread src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/Dwarf/DwarfCie.cs Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/ExceptionHandling.S Outdated
Comment thread src/coreclr/nativeaot/Runtime/unix/unixasmmacrosloongarch64.inc Outdated
Comment thread src/coreclr/nativeaot/Runtime/loongarch64/AllocFast.S Outdated
@sunlijun-610

Copy link
Copy Markdown
Contributor Author

Excuse me for giving you so much trouble. Cause this is my first time submitting code, I made many low-level mistakes. Thanks very much for your reviews and guidance on me!
I’ve submitted the second patch correcting the mistakes.
Thanks!

@filipnavara

Copy link
Copy Markdown
Member

Excuse me for giving you so much trouble. Cause this is my first time submitting code, I made many low-level mistakes. Thanks very much for your reviews and guidance on me!

No trouble at all. The purpose of the review process is to find those mistakes and it seems to work reasonably well here.

Side-note: I skimmed over most of the PR changes and looked for things that bit me during the linux-arm / win-x86 ports. The object writer part looks alright save for one comment.

…r/ElfObjectWriter.cs

Co-authored-by: Filip Navara <filip.navara@gmail.com>
@jkotas

jkotas commented Jun 26, 2024

Copy link
Copy Markdown
Member

No trouble at all.

+1

This change is a lot of lines that touching number of different areas. It tends to be better to split changes like this into multiple smaller PRs. For example:

  • Runtime assembly code (*.S) file
  • Changes in ObjectWriter component
  • Everything else

If you prefer to continue with the PR as is, it is certainly fine - but it is likely to take longer to get it in compared if it is broken into multiple smaller PRs.

@sunlijun-610

sunlijun-610 commented Jun 26, 2024

Copy link
Copy Markdown
Contributor Author

This change is a lot of lines that touching number of different areas. It tends to be better to split changes like this into multiple smaller PRs.

OK, got it. I'll split this PR into multiple smaller PRs as soon as possible. Thanks!

@sunlijun-610

Copy link
Copy Markdown
Contributor Author

After splitting, part-1 has been submitted to new PR: #104066

@sunlijun-610

sunlijun-610 commented Jun 27, 2024

Copy link
Copy Markdown
Contributor Author

After splitting:
Part-2 has been submitted to new PR: #104084
Part-3 has been submitted to new PR: #104087
Part-4 has been submitted to this PR, covering the previous, and it's the last PR.

Comment thread src/coreclr/nativeaot/Runtime/startup.cpp Outdated
Comment thread src/coreclr/nativeaot/Runtime/unix/PalRedhawkInline.h Outdated
Comment thread src/coreclr/nativeaot/Runtime/EHHelpers.cpp Outdated
Comment thread src/coreclr/nativeaot/Runtime/EHHelpers.cpp Outdated
Comment thread src/coreclr/nativeaot/Runtime/startup.cpp Outdated
Comment thread src/coreclr/nativeaot/Runtime/startup.cpp Outdated
Comment thread src/coreclr/nativeaot/Runtime/startup.cpp Outdated

@shushanhf shushanhf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
Thanks

@shushanhf shushanhf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sorry for mistake click.
@sunlijun-610 please test these PRs based on the new PRs.
Thanks

Comment thread src/coreclr/nativeaot/Runtime/PalRedhawkCommon.h Outdated
Comment thread src/coreclr/nativeaot/Runtime/PalRedhawk.h Outdated
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@sunlijun-610

sunlijun-610 commented Jul 4, 2024

Copy link
Copy Markdown
Contributor Author

@sunlijun-610 please test these PRs based on the new PRs.

I've tested based on the new PRs and the latest commit, and no new failure cases added.
Thanks!

Comment thread src/coreclr/nativeaot/Runtime/PalRedhawkCommon.h
Comment thread src/coreclr/nativeaot/Runtime/gcenv.ee.cpp Outdated

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM modulo one last nit

@jkotas

jkotas commented Jul 5, 2024

Copy link
Copy Markdown
Member

/azp run runtime-nativeaot-outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jkotas

jkotas commented Jul 6, 2024

Copy link
Copy Markdown
Member

Filled #104500 on windows-arm64 Release NativeAOT_Libs failure

@jkotas jkotas merged commit aee78d3 into dotnet:main Jul 6, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-loongarch64 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.

6 participants