All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla at busybox.net <bugzilla@busybox.net>
To: buildroot@busybox.net
Subject: [Buildroot] [Bug 13866] New: host-go: not supported on arm64 hosts
Date: Tue, 22 Jun 2021 01:52:26 +0000	[thread overview]
Message-ID: <bug-13866-163@https.bugs.busybox.net/> (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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2021-06-22  1:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  1:52 bugzilla at busybox.net [this message]
2021-06-22  2:25 ` [Buildroot] [Bug 13866] host-go: not supported on arm64 hosts bugzilla at busybox.net
2021-06-22  2:27 ` bugzilla at busybox.net
2024-06-15 14:59 ` bugzilla

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=bug-13866-163@https.bugs.busybox.net/ \
    --to=bugzilla@busybox.net \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.