Skip to content
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] Set up loongarch.loongarch64 architecture #1539

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

haowuge
Copy link
Contributor

@haowuge haowuge commented Dec 5, 2024

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.

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 <[email protected]>
Co-authored-by: xiaoqiang zhao <[email protected]>
Signed-off-by: Haowu Ge <[email protected]>
@haowuge haowuge requested review from bsdimp and bapt as code owners December 5, 2024 11:21
@bsdimp
Copy link
Member

bsdimp commented Dec 5, 2024

So I've taken a quick look. Generally I like it.
However, it's done all as one big commit. There's at least two commits here. (1) all the Makefile related stuff and (2) Adding Loongson target support to clang/lld/etc.
I'll look at it in more detail to see if there's improvements I can suggest. Nothing stood out in my first, admittedly hasity, pass through the patch which is a good sign.

@brooksdavis
Copy link
Contributor

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.

@haowuge
Copy link
Contributor Author

haowuge commented Dec 7, 2024

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,
thank you both.

@haowuge haowuge marked this pull request as draft December 7, 2024 14:11
@brooksdavis
Copy link
Contributor

I will try to create LoongArch ports for LLVM 19, and this pull request will temporarily be turned into a draft, thank you both.

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.

@haowuge
Copy link
Contributor Author

haowuge commented Dec 12, 2024

I will try to create LoongArch ports for LLVM 19, and this pull request will temporarily be turned into a draft, thank you both.

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 also made a simple devel/llvm19 ports patch:
0001-add-clang-LoongArch-Add-FreeBSD-targets-119191-patch.patch

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants