From: Yixun Lan <dlan@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [RFC] Plans for a Gentoo/LoongArch port
Date: Thu, 12 Aug 2021 17:55:10 +0800 [thread overview]
Message-ID: <YRTv/tHjno0oNkDw@ofant> (raw)
In-Reply-To: <b008ca13-896a-0a8f-3e9d-1be07cdd65d4@xen0n.name>
HI Xuerui:
This must be a *HUGE* project and gonna put lots of effort in to it!
So, first, good luck to you with all my best wishes!~
On 00:39 Thu 12 Aug , WANG Xuerui wrote:
> Hi everyone,
>
> I'm your average Gentoo user who obviously thought his sleeping time is more
> than enough, and just decided to start porting Gentoo to LoongArch. As this
> is such a niche architecture with no upstreamed support so far, I'm posting
> this to announce my intent and gather advice on how to best push this.
>
> I'll first give some background material to help people gain context, then
> describe my porting plan. This is going to be a bit long; apologizes for
> that.
>
>
> Note: I'm not affiliated with Loongson in any way; I'm just doing this in my
> spare time (once meant for some quality sleep).
>
>
> ## A bit of introduction on the LoongArch
>
> LoongArch, as its name implies, is the brand-new ISA developed by the
> Loongson Corporation, incompatible with MIPS which was implemented by
> all previous Loongson processors. Currently only the base ISA specification
> is publicly available; it has fixed-length 32-bit instructions, vastly more
> instruction formats (39 distinct formats in the base ISA alone!), and its
> instruction semantics mostly resemble RISC-V, with a bit of MIPS R6 here and
> there. It is capable of 64-bit operations, obviously.
>
> ISA documentation: https://github.com/loongson/LoongArch-Documentation
> ELF psABI draft: https://github.com/loongson/LoongArch-Documentation/pull/3
>
> The draft ABI is undergoing fierce review, and is subject to change,
> especially the relocation types. Other parts like the register
> convention and
> data layout is unlikely to change much, though.
>
> There is little code upstreamed for basic software (GNU toolchain, QEMU,
> Linux and the like), but many are open-sourced already. Nevertheless, the
> code quality is still very much inferior, and much of it is obviously based
> on respective MIPS support. There is continuous debate inside and outside
> Loongson on this matter, too.
>
Didn't do any investigation, but if I read correctly, also see here [1]
The fundamental pieces of softwares are open-sourced but *NOT* yet upstreamed
So, I'd say, let's wait till it's actually accepted by upstream,
before pushing to downsteam (Gentoo here). Sure, you're free to send
a pull-request for review/comment, but collect peices under your own overlay
would be a good idea ( in my humble opition ).
> Kernel ABI and glibc code seems to be inspired by RISC-V, but still some
> parts show MIPS heritage. The kernel bits are being reviewed on the
> linux-arch
> mailing list.
>
> All of the projects above can be accessed at https://github.com/loongson.
>
> Loongson 3A5000 is the first LoongArch CPU; the Lemote A2101 board with this
> CPU can be bought in China for ~4000 CNY already.
>
>
> ## Gentoo porting plans
>
> I'm planning to take ARCH=loongarch for the port; and support the LP64 ABI
> first. I'd like to support both LP64 and ILP32 ABIs, but that's not a
> priority.
>
start with LP64 would be good idea, so same as RISC-V here.
> The ABI flag might be named "ABI_LOONGARCH" but that's IMO a bit long (pun
> semi-intended); ARCH=loong and ABI_LOONG might be better, I'm open to
> suggestions.
>
> Because much of the ABI and even some toolchain internals are going through
> VERY fierce debate and rework, obviously the port will remain experimental
> for a long time. Some minimal support should get in tree though; doing so
> would ease a lot of pain for experimentation. I already hacked my way to
> generate working crossdev toolchains, and is halfway towards a rootfs with
> working Python (and Portage). I've already independently ported strace, and
> plan to do the same to libffi in the coming days which would give me Python.
>
> I'll do all work in my own loongson-overlay first, and upstream these when
> appropriate. Eventually I hope to have working crossdev, qemu-user emulation
> and proper catalyst support.
>
>
sounds a good plan, first start with making cross compiling work, then try to
populate a mini rootfs (kernel, glibc, base system), then python, portage
> And that's about all; the message is getting long! Your opinions are
> welcome,
> and thanks again for following along.
>
>
[1] https://github.com/gentoo/portage/pull/740#issuecomment-895021854
--
Yixun Lan (dlan)
Gentoo Linux Developer
GPG Key ID AABEFD55
next prev parent reply other threads:[~2021-08-12 9:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-11 16:39 [gentoo-dev] [RFC] Plans for a Gentoo/LoongArch port WANG Xuerui
2021-08-11 18:13 ` William Hubbs
2021-08-12 1:21 ` WANG Xuerui
2021-08-12 6:00 ` Michał Górny
2021-08-12 6:39 ` Ulrich Mueller
2021-08-24 3:30 ` WANG Xuerui
2021-08-24 8:46 ` Ulrich Mueller
2021-08-24 10:01 ` WANG Xuerui
2021-08-24 12:17 ` Ulrich Mueller
2021-08-12 9:55 ` Yixun Lan [this message]
2021-08-13 5:56 ` WANG Xuerui
2021-10-07 12:46 ` WANG Xuerui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YRTv/tHjno0oNkDw@ofant \
--to=dlan@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox