loongarch64 架构开始进行加入Debian 流程

提出

2021/5/11 17:41:35 +0800,zhangjialing zhangjialing@loongson.cn在Debian邮件列表debian-devel上说:

hello

We have a new architecture , We have compiled a lot of packages.Now the system can work normally .

We want to submit to debian like RISC-V. Please What documents(or others) can we refer to.

I want to know the submission process and documents.I know RISC-V has done it ,but I do not know how to begain and what can referance.

Please help me . thank you !!!

回应

2021/5/11 10:30:28 +0000,Debian开发人员 Paul Wise pabs@debian.org 首先给出了回应:

I think you are talking about LoongArch? I read that CPUs supporting
it can also run MIPS, ARM, RISC-V and x86 binaries. Are there any
advantages to a new port instead of the existing binaries?

Loongson unveils LoongArch CPU instruction set architecture for processors made in China - CNX Software

I would suggest to read the PortTemplate wiki page. Each item on it
should be completed for LoongArch to eventually become a viable Debian
port. Once you have read through it, followed each of the links and
you know the new Debian architecture names for LoongArch, you can
create new wiki pages for each of the architectures, then fill out the
template as you complete each item. Currently only the ia64 wiki page
was organised like this, other architecture wiki pages grew
organically.

PortTemplate - Debian Wiki
Ports - Debian Wiki


bye,
pabs

PaulWise - Debian Wiki

2021/5/11 12:36:42 +0200,另一位 Debian 开发人员 Helmut Grohne helmut@subdivi.de 给出了他的建议:

Hi,

I think that recent port bootstrapping efforts have been performed using
HelmutGrohne/rebootstrap - Debian Wiki.

Please follow up on this email thread with the following information:

  • What is the gnu triplet used for the port?
  • How many bits? Endianess?
  • What is the state of binutils support?
  • What is the state of gcc support?
  • What is the state of linux support?
  • What is the state of glibc support?
  • Do you have a preferred architecture name already?

When describing “what is the state of … support?”, please tell:

  • If the support is upstreamed, since which version?
  • If not, are patches posted? Where?
  • If not, is support implemented in some fork? Where?

Once we got answers to all these, I suppose that extending rebootstrap
to support your architecture is the next step. Once finished, you get to
manually fill in the gaps and roughly end up with something close to
build-essential. Using that, you’ll set up a native build system and
build the rest of the archive. In the process, you’ll break build
dependency cycles using various means. The most common ones are nocheck
builds and cross compilation.

If you do irc, join #debian-bootstrap on oftc. Cross-bootstrap related
matters are best directed at debian-cross@lists.debian.org.

Helmut

参考资料

https://lists.debian.org/debian-devel/2021/05/msg00052.html

LoongArch的推出感觉也是无奈之举,这个架构的分量不是太足啊,而且总感觉在片上做指令翻译这条路有点怪怪的

后续行动

2021/5/19 15:22:32 +0800, zhangjialing zhangjialing@loongson.cn在Debian邮件列表debian-devel上回应说:

Hi ,

The upsteam work is working on, But it is slow ,We can provide the patch and the apt repo.

在 2021/5/11 12:36:42 +0200, Helmut Grohne 写道:

Hi,

I think that recent port bootstrapping efforts have been performed using
HelmutGrohne/rebootstrap - Debian Wiki.
Please follow up on this email thread with the following information:

  • What is the gnu triplet used for the port?

loongarch64-linux-gnu

  • How many bits? Endianess?

64 bits,Little Endian

  • What is the state of binutils support?

2.31.1-16 , patch can provide

  • What is the state of gcc support?

gcc 4:8.3.0-1

gcc-8 8.3.0-6

patch can provide

  • What is the state of linux support?

4.19.167,patch can provide

  • What is the state of glibc support

2.28-10,patch can provide

  • Do you have a preferred architecture name already?

loongarch64

2021/5/19 12:47:22 +0200,Debian 开发人员 Helmut Grohne helmut@subdivi.de回应道:

Hi,

On Wed, May 19, 2021 at 03:22:32PM +0800, zhangjialing wrote:
Thank you for providing the answers on list.

  • What is the gnu triplet used for the port?
    loongarch64-linux-gnu
  • How many bits? Endianess?
    64 bits,Little Endian

Sounds sane to me.

  • What is the state of binutils support?
    2.31.1-16 , patch can provide

I’m unsure what you mean precisely here. It reads as if the architecture
support was included in 2.31.1-16, but when I attempt to build it with
2.36.1-6, I get

| checking target system type... Invalid configuration 'loongarch64-linux-gnu': machine 'loongarch64-unknown' not recognized

I guess that you mean that you have based your work on 2.31.1-16 and you
created a patch against that version. I fear this is not something we
can work with. You need to mainline your work first. Only then can
Debian be bootstrapped in a reasonable way.
Please re-answer the questions about tooling support. This time, please
really answer the three questions above for each upstream project
(binutils, gcc, linux, glibc). Please do include references to public
online resources if available.

I fear that trying to bootstrap Debian for an architecture where the
toolchain support is not mainline is not an effective use of everyone’s
time. We’ve tried that for or1k and it failed. Let’s not repeat that.
Really do focus on mainlining first. Doing so helps not just Debian.
You’ll also make it far easier to add support for e.g. Yocto or PtxDist.

At a bare minimum, we’d need patches that apply to the versions in
unstable.

Helmut

2021/5/20 14:52:32 +0800,zhangjialing zhangjialing@loongson.cn回应道:

the upstream is not support now , the patch is in our local repository.

2021/5/20 11:42:03 +0200,Debian 开发人员 Helmut Grohne helmut@subdivi.de回应道:

Hi,

I fear that this is a very bad basis to bootstrap Debian from. I
strongly recommend deferring a Debian port and upstreaming first.

If you want to proceed anyway, you’ll pay a lot of maintenance cost.
You’ll be maintaining a Debian derivative. You’ll include your patches
and build it for a powerful existing architecture (most commonly amd64)
to cross bootstrap from. Then you can use the existing bootstrap
tooling (rebootstrap) and adapt it to use your derivative instead of
Debian.

So where does the maintenance cost come from? Debian is a moving target
and whenever it changes, you get to rebase your patches. rebootstrap
targets unstable. You’ll be patching it. Either you’ll be continuously
rebasing your rebootstrap fork or you’ll be solving all of the generic
issues that I am solving yourself. Effectively, you’ll be duplicating a
ton of work. Expect that it a full time employment just to keep in sync.
That’s the overhead, not the development cost. Or you choose to not keep
in sync with Debian and then you’ll have to effectively redo the whole
bootstrap once you start mainlining. Beyond this, you’ll be unable to
use Debian infrastructure (e.g. jenkins.debian.net).

Or you may choose to go the significantly cheaper route and upstream
your patches now. Yes, it’ll take time, but you’re still faster that
way.

Helmut

2021/5/21 09:07:10 +0800,zhangjialing zhangjialing@loongson.cn回应道:

Hi, I have known upstreaming first , I will make a plan for this debian port .

Please, when we upstreaming our patch , Is there a version limit for the soft like gcc ,glibc

when the upstream work done , what is the next.

2021/5/20 00:59:52 +0000,Debian开发人员 Paul Wise pabs@debian.org 要求更改wiki页面:

Could you also include these details and the other ones that Helmut
requested in the wiki page you created? Please also rename the wiki
page to the chosen architecture name (loongarch64) instead of the
current name (la64).


bye,
pabs

PaulWise - Debian Wiki

2021/5/20 09:20:18 +0800,zhangjialing zhangjialing@loongson.cn对此回应:

Ok,I will modify it as soon as possible.

看起来,目前的主要意见是:

请先做上游。

Wiki

2021/05/14 10:37:15,Wiki 页面 Ports/la64 被创建(目前为止,那里还没有任何有意义的内容)。
2021/05/20 09:32:02,根据邮件列表上的讨论,该 Wiki 页面被删除以进行重写。