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

Support linux/loong64 Arch #133

Open
dongjiang1989 opened this issue Apr 19, 2023 · 7 comments
Open

Support linux/loong64 Arch #133

dongjiang1989 opened this issue Apr 19, 2023 · 7 comments

Comments

@dongjiang1989
Copy link

Description

Add support for loong64 builds.

Motivation and Context

To be able to build binaries for loong64.

How to test this PR?

Link: golang/go#46229

@xen0n
Copy link

xen0n commented Jun 27, 2023

It seems a bit involved to add such support. We have to:

  • bump https://github.com/tonistiigi/xx toolchain components to very recent versions (binutils 2.40+, Clang 16+, go 1.19+ but ideally the next version that's go1.21.0), and
  • ideally bump the QEMU version to 8.0+

before doing the trivial additions. (Which may or may not be so, depending on the tools involved.)

@emmansun
Copy link

After #151 #174 , Why is there still no linux/loong64 image? missing one platform in https://github.com/tonistiigi/binfmt/blob/master/docker-bake.hcl ?

target "all-arch" {
  platforms = [
    "linux/amd64",
    "linux/arm64",
    "linux/arm/v6",
    "linux/arm/v7",
    "linux/ppc64le",
    "linux/s390x",
    "linux/riscv64",
    "linux/386",
  ]
}

@tonistiigi @yzewei @vicamo

@xen0n
Copy link

xen0n commented Jun 28, 2024

After #151 #174 , Why is there still no linux/loong64 image? missing one platform in https://github.com/tonistiigi/binfmt/blob/master/docker-bake.hcl ?

You could use a little patience or make it happen yourself ;-) LoongArch availability is a bit limited especially outside of China, and open-source projects like this usually are severely limited in manpower, so you cannot expect people to keep their eyes on LoongArch at all times.

I'll try adding the support in a few days. If you see a PR fixing this issue, that'd be it, or I'll post on why this is still not feasible at the moment ;-)

@yzewei
Copy link
Contributor

yzewei commented Jun 28, 2024

After #151 #174 , Why is there still no linux/loong64 image? missing one platform in https://github.com/tonistiigi/binfmt/blob/master/docker-bake.hcl ?

You could use a little patience or make it happen yourself ;-) LoongArch availability is a bit limited especially outside of China, and open-source projects like this usually are severely limited in manpower, so you cannot expect people to keep their eyes on LoongArch at all times.

I'll try adding the support in a few days. If you see a PR fixing this issue, that'd be it, or I'll post on why this is still not feasible at the moment ;-)

@xen0n Thanks!
It is better to wait for the alpine community to support loongarch before submitting a similar PR, otherwise it will be different from other architectures and bring additional code maintenance burden

@yzewei
Copy link
Contributor

yzewei commented Jun 28, 2024

After #151 #174 , Why is there still no linux/loong64 image? missing one platform in https://github.com/tonistiigi/binfmt/blob/master/docker-bake.hcl ?

target "all-arch" {
  platforms = [
    "linux/amd64",
    "linux/arm64",
    "linux/arm/v6",
    "linux/arm/v7",
    "linux/ppc64le",
    "linux/s390x",
    "linux/riscv64",
    "linux/386",
  ]
}

@tonistiigi @yzewei @vicamo

@emmansun As I said earlier, if you currently need to use a loongarch-based binfmt image, https://lcr.loongnix.cn

@xen0n
Copy link

xen0n commented Jun 28, 2024

It seems tonistiigi/xx needs to get LoongArch awareness: the xx-info helper currently does not handle the loongarch64 loong64 things, which it definitely needs to. And the fact that the Alpine arch names are recorded means we'd better wait until things settle at Alpine side -- at least the architecture name needs to be frozen. The Alpine arch name seems to be loongarch64 already -- consistent with a Loongson first-party effort.

xen0n added a commit to xen0n/binfmt that referenced this issue Jun 28, 2024
As buildkit v0.14.x comes with loong64 support, this is automatically
integrated after the dep bump, and we only need to add loong64 to the
build recipe and hack script to make it work.

Fixes: tonistiigi#133
xen0n added a commit to xen0n/binfmt that referenced this issue Jun 28, 2024
As buildkit v0.14.x comes with loong64 support, this is automatically
integrated after the dep bump, and we only need to add loong64 to the
build recipe and hack script to make it work.

Fixes: tonistiigi#133
Signed-off-by: WANG Xuerui <git@xen0n.name>
@xen0n
Copy link

xen0n commented Jun 28, 2024

It seems tonistiigi/xx needs to get LoongArch awareness: the xx-info helper currently does not handle the loongarch64 loong64 things, which it definitely needs to.

This doesn't affect non-loong64-host builds -- it is used to exclude the *-linux-user configuration corresponding to the host arch, but we're primarily concerned with having loong64 emulation on other hosts e.g. amd64 or arm64. I've made #186 to hopefully fix this issue.

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

No branches or pull requests

4 participants