Skip to content

[LoongArch64] Fix ld.lld relocation 'R_LARCH_PCALA_LO12' error when building NativeAOT testcases. - #114616

Merged
jkotas merged 1 commit into
dotnet:mainfrom
LuckyXu-HF:main-LA64
Apr 17, 2025
Merged

jkotas merged 1 commit into
dotnet:mainfrom
LuckyXu-HF:main-LA64

Conversation

@LuckyXu-HF

Copy link
Copy Markdown
Contributor

Fix the build error of the NativeAOT smoke tests which is mentioned in #104661 (comment)

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 14, 2025
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Apr 14, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@LuckyXu-HF

Copy link
Copy Markdown
Contributor Author

This commit fixed the building of NAOT smoke tests which is mentioned in #104661 (comment) :

Another issue is, while compiling smoke tests SharedLibrary, it will report errors like
ld.lld : error : relocation R_LARCH_PCALA_LO12 cannot be used against symbol 'memmove'; recompile with -fPIC [runtime/src/tests/nativeaot/SmokeTests/SharedLibrary/SharedLibrary.csproj] [runtime/src/tests/build.proj].

The ld.bfd should report errors when linking illegal symbol, but it doesn't, we have reported this to the LD team.
And the ld.lld behavior of reporting errors is what we expect.

@LuckyXu-HF

Copy link
Copy Markdown
Contributor Author

Hi @shushanhf @jakobbotsch , could you please review this PR? Thanks.

@am11

am11 commented Apr 14, 2025 •

Copy link
Copy Markdown
Member

Nice!

The ld.bfd should report errors when linking illegal symbol, but it doesn't, we have reported this to the LD team.

My takeaway from reading a few posts on https://maskray.me/blog/, there's no perfect linker; it's a balance between best effort to unblock people and nitpicking on what constitutes illegal. So it pays to collect diagnostics from both lld and bfd (and if feasible, gold and mold too) and aim to make all of them happy. 😅

@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

@LuckyXu-HF

Copy link
Copy Markdown
Contributor Author

Hi @jakobbotsch @jkotas could you please help to review this PR? Thanks.

@jkotas

jkotas commented Apr 17, 2025

Copy link
Copy Markdown
Member

/ba-g DeadLetter

@jkotas
jkotas merged commit ff61917 into dotnet:main Apr 17, 2025
@LuckyXu-HF
LuckyXu-HF deleted the main-LA64 branch April 18, 2025 00:58
@github-actions github-actions Bot locked and limited conversation to collaborators May 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-loongarch64 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI 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.

5 participants