-
Notifications
You must be signed in to change notification settings - Fork 353
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
[LoongArch64] add build-config for LoongArch64. #8271
Merged
+5
−1
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@shushanhf, updating this file alone is not enough as we will also need setup bits in
build-rootfs.sh
.The build-rootf.sh is then used in https://github.com/dotnet/dotnet-buildtools-prereqs-docker/ repo, to produce the cross-build docker container for various platforms/architectures (e.g.
ubuntu-18.04-cross-arm-alpine-xxx
,ubuntu-18.04-cross-illumos-xxx
etc. full list of tags). This makes it easier for anyone (including runtime CI pipelines) to consume the container and build product.Are all packages listed in
build-rootfs.sh
script available on loongarch64, and which distro will you be targeting? I am asking because for Debian riscv64 architecture, I am still waiting on a patch from lldb team for System-V support (meanwhile I unset lldb like s390x below). Other than that, riscv64 is still in Debian ports so I had to modify this script a little to addsid
support (dotnet/runtime@main...am11:feature/riscv-rootfs, still WIP as I'm also waiting for llvm 13.0.1, which has a default fix for .NET ML dependencies, so I can remove theTODO
).For local testing:
then in runtime repo, pass cross arg:
ROOTFS_DIR=$(pwd)/.tools/rootfs/loongarch64 ./build.sh clr -cross -arch loongarch64 ...
(in the docker container, that ROOTFS_DIR will have a set path/crossrootfs/loongarch64
)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.
Thanks!
I will commit LoongArch64 to this.
https://hub.fastgit.org/shushanhf/arcade/blob/main/eng/common/cross/build-rootfs.sh
We can supply ubuntu20.04. Now we are preparing qemu supporting LoongArch64.
That means we have to supply a LoongArch64 rootfs tar-file and including a cross-compiler ?
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.
If we are on loongarch64 host, and building for loongarch64, then
toolchain.cmake
is not involved. I imagine it is your case, where you are locally using the baremetal loongarch64 machine. This cmake script is only involved when we cross compile the .NET runtime or SDK (e.g. in the CI where we only have x64 or arm64 host, so arm32, x86, s380x etc. binaries are cross-compiled then sent to remote machines with real hardware for testing). See https://github.com/dotnet/runtime/blob/b338078/eng/native/gen-buildsys.sh#L82 (the outer condition isif [[ "$CROSSCOMPILE" == "1" ]]
).build-rootfs.sh
is a helper script which integrates seamlessly with rest of the engineering stack. If we can arrange the debootstrap setup for loongarch64 (e.g. I found some discussion here: https://gitlab.summer-ospp.ac.cn/summer2021/210080299/-/blob/main/week12_report.md), it would be nice, because after that we can request for a docker container (e.g. a PR like dotnet/dotnet-buildtools-prereqs-docker#324 with addition of qemu-loongarch64 package). With that docker container it will make things easier for everyone to build runtime for loongarch64 on any system where docker is installed.Long story short, it is not required to have a cross compiler right now (it can be added later), and then we can update both toolchain.cmake and build-rootfs.sh together (as there might be other changes needed in toolchain.cmake, right now we can't test it or tell for sure).
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.
Yes, now we just test and run all dotnet on our LoongArch64-linux machine.
Thanks.
Here is a link page for qemu and toolchain, https://github.com/loongson/build-tools.
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.
By the way, do you need the real hardware of LoongArch64 for testing ?
If you need, we can supply the LoongArch64 machine for you.
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.
I do know that question for not for me, but why do not ask. Can I get free treat? At least I can guarantee that I make NativeAOT work on this platform.
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.
Agree. @shushanhf Could you please revert changes in toolchain.cmake so that we can get the rest of the changes in this PR merged?
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.
@am11 If incremental infrastructure changes are ok, what do you feel about following future plan for cross-compile. That should be treated as stop-gap measurements in case debootstrap MR would take long time to be merged or other organizational issues arise.
Right now GCC and CLang cannot produce LoongArch64 execuables from released version and work just starting. so debootstrap is not enough (isn't it?). That mean that temporary cross compilation can be achieved via other means, like @shushanhf suggests above:
Is this alternative viable for the future?
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.
Yes, complimentary a desktop host.
Ok, I will do it right now.
I had prepared a cross-comiler on x64-linux for LoongArch64.
If you needed, I can give you.
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.
Although our company had finished all the comilers (gcc、clang、.NET、JVM、browser ...) and some tools liking docker, it still needs a little time to be accepted by the upstream.
There is another way for cross-compiling.
We can supply a docker image and a docker source suppling the related softwares before you get them from the upstream, liking getting the docker images about LoongArch64 from the docker-hub.