-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add linux-riscv64 nativeaot runtime build #110688
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
@tomeksowi @sirntar Please review and test this PR in SRPOL? Thank you. |
This is bulk of change which just builds. Line 125 in 3aa1ec5
is not changed because that breaks the build in similar way as #108973 (requires LKG apphost). I think after this bulk of change is merged (need to make sure it doesn't break anyone's workflow), we can make smaller fixes once we figure out a way to test nativeaot runtime on community platforms. |
c01dc7b is being scheduled for building and testingGIT: Release-build FAILEDCloning into '/go-agent/pipelines/Release-build/runtime'...
Updating files: 14% (8701/59681)
Updating files: 15% (8953/59681)
Updating files: 16% (9549/59681)
Updating files: 17% (10146/59681)
Updating files: 18% (10743/59681)
Updating files: 19% (11340/59681)
Updating files: 20% (11937/59681)
Updating files: 21% (12534/59681)
Updating files: 22% (13130/59681)
Updating files: 23% (13727/59681)
Updating files: 24% (14324/59681)
Updating files: 25% (14921/59681)
Updating files: 26% (15518/59681)
Updating files: 27% (16114/59681)
Updating files: 28% (16711/59681)
Updating files: 29% (17308/59681)
Updating files: 30% (17905/59681)
Updating files: 31% (18502/59681)
Updating files: 32% (19098/59681)
Updating files: 32% (19410/59681)
Updating files: 33% (19695/59681)
Updating files: 34% (20292/59681)
Updating files: 35% (20889/59681)
Updating files: 36% (21486/59681)
Updating files: 37% (22082/59681)
Updating files: 38% (22679/59681)
Updating files: 39% (23276/59681)
Updating files: 40% (23873/59681)
Updating files: 41% (24470/59681)
Updating files: 42% (25067/59681)
Updating files: 43% (25663/59681)
Updating files: 44% (26260/59681)
Updating files: 45% (26857/59681)
Updating files: 46% (27454/59681)
Updating files: 47% (28051/59681)
Updating files: 48% (28647/59681)
Updating files: 49% (29244/59681)
Updating files: 50% (29841/59681)
Updating files: 51% (30438/59681)
Updating files: 51% (30671/59681)
Updating files: 52% (31035/59681)
Updating files: 53% (31631/59681)
Updating files: 54% (32228/59681)
Updating files: 55% (32825/59681)
Updating files: 56% (33422/59681)
Updating files: 57% (34019/59681)
Updating files: 58% (34615/59681)
Updating files: 59% (35212/59681)
Updating files: 60% (35809/59681)
Updating files: 61% (36406/59681)
Updating files: 62% (37003/59681)
Updating files: 63% (37600/59681)
Updating files: 64% (38196/59681)
Updating files: 65% (38793/59681)
Updating files: 66% (39390/59681)
Updating files: 67% (39987/59681)
Updating files: 68% (40584/59681)
Updating files: 69% (41180/59681)
Updating files: 70% (41777/59681)
Updating files: 71% (42374/59681)
Updating files: 72% (42971/59681)
Updating files: 73% (43568/59681)
Updating files: 74% (44164/59681)
Updating files: 75% (44761/59681)
Updating files: 76% (45358/59681)
Updating files: 77% (45955/59681)
Updating files: 77% (46219/59681)
Updating files: 78% (46552/59681)
Updating files: 79% (47148/59681)
Updating files: 80% (47745/59681)
Updating files: 81% (48342/59681)
Updating files: 82% (48939/59681)
Updating files: 83% (49536/59681)
Updating files: 84% (50133/59681)
Updating files: 85% (50729/59681)
Updating files: 86% (51326/59681)
Updating files: 87% (51923/59681)
Updating files: 88% (52520/59681)
Updating files: 89% (53117/59681)
Updating files: 90% (53713/59681)
Updating files: 91% (54310/59681)
Updating files: 91% (54552/59681)
Updating files: 92% (54907/59681)
Updating files: 93% (55504/59681)
Updating files: 94% (56101/59681)
Updating files: 95% (56697/59681)
Updating files: 96% (57294/59681)
Updating files: 97% (57891/59681)
Updating files: 98% (58488/59681)
Updating files: 99% (59085/59681)
Updating files: 100% (59681/59681)
Updating files: 100% (59681/59681), done. |
RISC-V Release-CLR-QEMU: 9440 / 9461 (99.78%)
Release-CLR-QEMU.md, Release-CLR-QEMU.xml, testclr_output.tar.gz RISC-V Release-FX-QEMU: 603280 / 643384 (93.77%)
Release-FX-QEMU.md, Release-FX-QEMU.xml, testfx_output.tar.gz Build information and commandsGIT: # CORE_LIBS_BUILD_CMD
runtime/build.sh --arch riscv64 --cross -c Release -s libs /p:EnableSourceLink=false
# CORE_BUILD_CMD
runtime/build.sh --arch riscv64 --cross -c Release -s clr+libs+host /p:EnableSourceLink=false
# TESTCLR_BUILD_CMD
runtime/src/tests/build.sh -riscv64 -cross -Release -priority1 -p:UsePublishedCrossgen2=false -p:UseLocalAppHostPack=true
# TESTCLR_CMD
python3 riscv-CI/goci/agent/TestRunner/run.py --core_root ./coreclr.Release/Tests/Core_Root --testhost ./testhost.Release --atest ./coreclr.Release --test ./ --log_dir ./logs --timeout 2700 --log_level DEBUG --xunit xunit.Release
# TESTCLR_RUN
/godata/pipelines/Release-CLR-QEMU/logs/run_tests.log
cp -R /godata/pipelines/Release-CLR-QEMU/xunit.Release "/_PATH_/_WITH_/_TEST_"/ ; cd "/_PATH_/_WITH_/_TEST_" && ROOTFS_DIR=/crossrootfs/riscv64 QEMU_LD_PREFIX=/crossrootfs/riscv64 __TestDotNetCmd=/godata/pipelines/Release-CLR-QEMU/testhost.Release/dotnet CORE_ROOT=/godata/pipelines/Release-CLR-QEMU/coreclr.Release/Tests/Core_Root /usr/bin/time -f "exec_time: %e" ./_TEST_BINARY_
# TESTFX_BUILD_CMD
runtime/build.sh --arch riscv64 --cross -c Release -rc Release -hc Release -lc Release -s libs.tests --testscope innerloop /p:EnableSourceLink=false /p:UseLocalAppHostPack=true
# TESTFX_CMD
unknown command
# TESTFX_RUN
unknown command
# TEST_ENV
DOTNET_JitStress=;DOTNET_JitStressRegs=;DOTNET_GCStress=;DOTNET_JITMinOpts=;DOTNET_TailcallStress=;DOTNET_TieredCompilation=
RISC-V Release-CLR-VF2: 9440 / 9461 (99.78%)
Release-CLR-VF2.md, Release-CLR-VF2.xml, testclr_output.tar.gz RISC-V Release-FX-VF2: 572716 / 609386 (93.98%)
Build information and commandsGIT: # CORE_LIBS_BUILD_CMD
runtime/build.sh --arch riscv64 --cross -c Release -s libs /p:EnableSourceLink=false
# CORE_BUILD_CMD
runtime/build.sh --arch riscv64 --cross -c Release -s clr+libs+host /p:EnableSourceLink=false
# TESTCLR_BUILD_CMD
runtime/src/tests/build.sh -riscv64 -cross -Release -priority1 -p:UsePublishedCrossgen2=false -p:UseLocalAppHostPack=true
# TESTCLR_CMD
python3 riscv-CI/goci/agent/TestRunner/run.py --core_root ./coreclr.Release/Tests/Core_Root --testhost ./testhost.Release --atest ./coreclr.Release --test ./ --log_dir ./logs --timeout 2700 --log_level DEBUG --xunit xunit.Release
# TESTCLR_RUN
/var/lib/go-agent/pipelines/Release-CLR-VF2/logs/run_tests.log
cp -R /var/lib/go-agent/pipelines/Release-CLR-VF2/xunit.Release "/_PATH_/_WITH_/_TEST_"/ ; cd "/_PATH_/_WITH_/_TEST_" && __TestDotNetCmd=/var/lib/go-agent/pipelines/Release-CLR-VF2/testhost.Release/dotnet CORE_ROOT=/var/lib/go-agent/pipelines/Release-CLR-VF2/coreclr.Release/Tests/Core_Root /usr/bin/time -f "exec_time: %e" ./_TEST_BINARY_
# TESTFX_BUILD_CMD
runtime/build.sh --arch riscv64 --cross -c Release -rc Release -hc Release -lc Release -s libs.tests --testscope innerloop /p:EnableSourceLink=false /p:UseLocalAppHostPack=true
# TESTFX_CMD
unknown command
# TESTFX_RUN
unknown command
# TEST_ENV
DOTNET_JitStress=;DOTNET_JitStressRegs=;DOTNET_GCStress=;DOTNET_JITMinOpts=;DOTNET_TailcallStress=;DOTNET_TieredCompilation=
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments. Thanks for this bring-up!
Co-authored-by: Tomek Sowiński <tomeksowi@gmail.com>
a312a0f
to
bd3641b
Compare
Thanks for the review @tomeksowi, I have addressed the feedback. 🙂 |
Co-authored-by: Tomasz Sowiński <tomeksowi@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good, I left some nitpicking comments, but the current solution is fine too. I don't see any more bugs other than those already pointed out by @tomeksowi
Anyway, thanks for this great contribution 🥉
*I will do additional tests later, but CI shows that there are no regressions.
// Not tested | ||
encoder.EmitBreak(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks correct, but I will test it manually later
Co-authored-by: Tymoteusz Wenerski <tymoteusz.wenerski@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a build unblocking PR it looks ok, we can fix more if/when we actually start using NativeAOT.
{ | ||
uint32_t instr = *pInstr; | ||
|
||
if (((instr & STW_PAIR_MASK) == STW_PAIR_BITS) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be something like TrailingEpilogueInstructionsCount but detecting stores instead of loads.
Co-authored-by: Tomasz Sowiński <tomeksowi@gmail.com>
1850935
to
d006373
Compare
@jkotas please review this. Trying to avoid more merge conflicts emerging from new PRs. |
This change enables NativeAOT build support on Linux-RISCV64, leveraging the LA64 port https://github.com/dotnet/runtime/pulls?q=sort%3Aupdated-desc+is%3Apr+label%3Aarch-loongarch64+label%3Aarea-NativeAOT-coreclr+is%3Aclosed. While the build setup is functional, it has not yet been tested. This submission primarily aims to share the code changes required to achieve a successful build. Comprehensive testing and validation are contingent on resolving community-supported platform build processes, which are currently blocked on #105004.
Huge props to @sunlijun-610 for helping out with this. 🎉
Contributes to #106223, #84834