-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[LoongArch64] Set up loongarch.loongarch64 architecture #1539
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
base: main
Are you sure you want to change the base?
Conversation
This is the initial set up for LoongArch64. The current plan is for this arch to remain experimental for FreeBSD 15. This is our amateur learning project, and we will gradually improve it over time. (More to follow momentarily.) Co-authored-by: yu shan wei <mpysw@vip.163.com> Co-authored-by: xiaoqiang zhao <zxq_yx_007@163.com> Signed-off-by: Haowu Ge <gehaowu@bitmoe.com>
|
So I've taken a quick look. Generally I like it. |
|
Somewhat echoing @bsdimp, I'd like to see a PR that adds general support and works with CROSS_TOOLCHAIN before we add build time to the default toolchain build. IMO in-tree compiler support ranks close to last in bringup priorities. Once we're a bit further along I'd be happy to add LoongArch to FREEBSD_BACKENDS in devel/llvm19. |
We originally hoped to merge into the basic system to reduce the pressure of tracking the main branch. I will try to create LoongArch ports for LLVM 19, and this pull request will temporarily be turned into a draft, |
You shouldn't need to do anything to make the existing devel/llvm19 package work as it includes all non-experimental backends. If you wanted llvm19-lite to work I'd need to add LoongArch to the list of FreeBSD arches, but that's mostly a long term CI thing. |
We have several patches for loongarch FreeBSD, so the devel/llvm19 package needs to be patched. We attempted to submit the patches to the LLVM project llvm/llvm-project#119191 , and the upstream suggested that FreeBSD should have more specialized personnel review it. Could you please help check if the patches meet the requirements? Thank you. |
|
So this issue came up at the Developer summit today. There was some interest in this port, but we had two questions: (1) is there a loongson qemu recipe we can use to test the loongson stuff? and (2) what's the loongsoon ecosystem look like in China? How many companies make this chip? How many sell the servers? Is it available in the US and Europe? |
It looks like we were too slow on this, and things were merged... My apologies for not suggesting someone... We're thinking that if we can create a Loongson qemu recipe we can test things with, and we test boot in qemu, we can land this patch, once it's updated. We'll do that just after the 15 branch and reevaluate where we are with the architecture and it's ecosystem when 16 is branched in a couple of years... this might be a good compromise to give the port a chance to mature before re@ starts producing releases for it. We can do daily snapshots to shake out installer bugs. If it's super popular, we can maybe MFC it... |
Hi @bsdimp, happy to assist you with the questions above...
For the state of community support and basic information on this architecture, I recommend taking a look at Areweloongyet?. |
Hi @bsdimp, The LoongArchLinux ported by employees of Loongson (previously maintained internally and now handed over to the community, so it may not be the latest version) provides a QEMU image version. It can be started using the following methods: reference: build command line The FreeBSD loader_simp.efi boot method: Start loader: reference: |


This is the initial set up for LoongArch64.
The current plan is for this arch to remain experimental for FreeBSD 15.
This is our amateur learning project, and we will gradually improve it over time.
Regarding the modifications related to the contrib/llvm-project section,
my colleague will submit a pull request to the llvm-project later.
A simple GitHub Actions build test: https://github.com/haowuge/freebsd-src/actions/runs/12178365925/job/33968197600
If you have better suggestions for the code, please let me know,
and we are happy to improve it until compliant code is provided.