Skip to contentSkip to conversation

New: host-go: not supported on arm64 hosts

Buildroot bugzilla at busybox.net 1 participant 4 messages Jun 22, 2021 – Jun 15, 2024

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=13866

Bug ID: 13866
Summary: host-go: not supported on arm64 hosts
Product: buildroot
Version: unspecified
Hardware: Other
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: christian at paral.in
CC: buildroot at uclibc.org
Target Milestone: ---

All Go compiler versions > 1.4.x (old) are written in Go, and require a existing compiled Go version to use to build from source.

https://golang.org/doc/install/source#bootstrapFromSource

The process for "bootstrapping" the Go compiler in Buildroot is:

1. Compile a C/C++ cross-compiler (gcc) as the host toolchain.
2. Build go-bootstrap (which is Go 1.4.x and written in C)
3. Build go 1.16.x (written in Go) using go-bootstrap.

The problem is that step 2 - build go-bootstrap - does not work on 64-bit arm. The Go compiler from 1.4.x is compatible with x86, x86_64, and arm (32 bit) only.

This means that arm64 host machines will skip building Go and all go-based packages like Docker.

Due to BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS

The best fix to this for Buildroot is to continue using go-bootstrap on x86_64 or arm32 platforms (when BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS is set). This is the most flexible option in terms of supporting third-party toolchains to bootstrap Go.

Support for gccgo (the Go compiler built-in to GCC 5 and greater) should be added with a conditional flag for the Buildroot toolchain (which would set --enable-languages=go).

If the compiler supports gccgo (toolchain sets GCCGO_SUPPORTS) flag, and GO_BOOTSTRAP_ARCH_SUPPORTS is false, then the host-go package should use the toolchain Gccgo to compile the Go compiler.

The toolchain gccgo would install a "go" binary into the host tree provided by gcc. (This binary is drop-in compatible with the normal Go compiler).

The Go compiler can then be instructed to use gccgo by simply setting $GOROOT_BOOTSTRAP to host/usr.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 13866] host-go: not supported on arm64 hosts

https://bugs.busybox.net/show_bug.cgi?id=13866

Christian Stewart <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |christian at paral.in

--- Comment #1 from Christian Stewart <[email protected]> --- Created attachment 9011
--> https://bugs.busybox.net/attachment.cgi?id=9011&action=edit
The attached patch configures host-go package to use the host /usr/bin/go compiler to bootstrap Golang when go-bootstrap is not supported (i.e. arm64).

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 13866] host-go: not supported on arm64 hosts

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=13866

Christian Stewart <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

   Attachment #9011|The attached patch          |0001-package-go-use-host-co
        description|configures host-go package  |mpiler-when-go-bootstrap-un
                   |to use the host /usr/bin/go |supported.patch
                   |compiler to bootstrap       |
                   |Golang when go-bootstrap is |
                   |not supported (i.e. arm64). |

--- Comment #2 from Christian Stewart <[email protected]> --- Comment on attachment 9011
--> https://bugs.busybox.net/attachment.cgi?id=9011
0001-package-go-use-host-compiler-when-go-bootstrap-unsupported.patch

The attached patch configures host-go package to use the host /usr/bin/go compiler to bootstrap Golang when go-bootstrap is not supported (i.e. arm64).

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 13866] host-go: not supported on arm64 hosts

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=13866

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
             Status|NEW                         |RESOLVED
         Resolution|---                         |MOVED

--- Comment #3 from Yann E. MORIN <[email protected]> --- Thank you for your report.

The issue tracker for the Buildroot project has been moved to the Gitlab.com issue tracker:
https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old tracker. If you believe your issue is still relevant, please open one in the new issue tracker.

Thank you!

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot