Skip to content

Fix relocs errors on riscv64 - #111317

Merged
jkotas merged 23 commits into
dotnet:mainfrom
am11:feature/nativeaot/riscv64-port
Jan 17, 2025
Merged

jkotas merged 23 commits into
dotnet:mainfrom
am11:feature/nativeaot/riscv64-port

Conversation

@am11

@am11 am11 commented Jan 12, 2025 •

Copy link
Copy Markdown
Member

This ignores the emitter assertion in AOT mode seen here #106223 (comment). Also, removes JALR redundant reloc (merged with PC reloc).

@ghost ghost added the area-ReadyToRun label Jan 12, 2025
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jan 12, 2025
@am11
am11 requested a review from a team January 12, 2025 16:46
@am11 am11 mentioned this pull request Jan 12, 2025
@am11 am11 added area-NativeAOT-coreclr arch-riscv Related to the RISC-V architecture and removed area-ReadyToRun labels Jan 12, 2025
@dotnet-policy-service

ghost commented Jan 12, 2025

Copy link
Copy Markdown
Contributor

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

Comment thread src/coreclr/jit/emitriscv64.cpp Resolved
@am11
am11 force-pushed the feature/nativeaot/riscv64-port branch from 2dd124f to afa2118 Compare January 12, 2025 22:16
Adeel Mujahid and others added 2 commits January 13, 2025 01:26
Adeel Mujahid and others added 2 commits January 14, 2025 02:03
Co-authored-by: Tomek Sowiński <tomeksowi@gmail.com>
Adeel Mujahid and others added 3 commits January 14, 2025 04:36
@am11

ghost commented Jan 14, 2025

Copy link
Copy Markdown
Member Author

@dotnet/samsung with these patches,
-r linux-riscv64 -p:PublishAot=true -p:SysRoot=/crossrootfs/riscv64 -p:LinkerFlavor=lld

succeeds. Execution throws SIGILL.

With the default linker (LinkerFlavor=bfd), it doesn't publish. bfd throws:

/usr/bin/riscv64-linux-gnu-ld.bfd: tls_CurrentThread: TLS definition in /runtime/artifacts/bin/coreclr/linux.riscv64.Checked/aotsdk/libRuntime.WorkstationGC.a(threadstore.cpp.o) section .tbss mismatches non-TLS reference in /runtime/artifacts/bin/coreclr/linux.riscv64.Checked/aotsdk/libRuntime.WorkstationGC.a(AllocFast.S.o)

Overall it's a progress. We can take this in and continue hackathon in the tracking issue. PTAL.

Comment thread src/coreclr/jit/emitriscv64.cpp Resolved
@clamp03

ghost commented Jan 15, 2025

Copy link
Copy Markdown
Member

@am11 I removed IMAGE_REL_RISCV64_JALR in #97368 because I think its behavior of IMAGE_REL_RISCV64_JALR and IMAGE_REL_RISCV64_PC looks identical in RISCV. Do you have any reason to add IMAGE_REL_RISCV64_JALR?

@am11

ghost commented Jan 15, 2025

Copy link
Copy Markdown
Member Author

Thanks. They are handled the same way in ILC as well, only distinguishing themselves at the JIT interface level. I can remove it if the separate identity is not desired.

@am11
am11 force-pushed the feature/nativeaot/riscv64-port branch from cca299f to 070c3ba Compare January 17, 2025 01:10
@am11
am11 force-pushed the feature/nativeaot/riscv64-port branch from 070c3ba to 8a95da2 Compare January 17, 2025 01:10

ghost 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.

Thanks

@jkotas
jkotas merged commit 0d18978 into dotnet:main Jan 17, 2025
@am11
am11 deleted the feature/nativeaot/riscv64-port branch January 17, 2025 14:16
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-riscv Related to the RISC-V architecture 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