From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Christian Stewart via buildroot <buildroot@buildroot.org>
Cc: "Yann E . MORIN" <yann.morin.1998@free.fr>,
Christian Stewart <christian@aperture.us>
Subject: Re: [Buildroot] [PATCH v7 4/4] package/go: use host compiler when go-bootstrap unsupported
Date: Sat, 22 Jul 2023 23:13:36 +0200 [thread overview]
Message-ID: <20230722231336.760d74ea@windsurf> (raw)
In-Reply-To: <20230711220849.1702358-4-christian@aperture.us>
Hello Christian,
On Tue, 11 Jul 2023 15:08:49 -0700
Christian Stewart via buildroot <buildroot@buildroot.org> wrote:
> 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-stage1 (which is Go 1.4.x and written in C)
> 3. Build go-bootstrap-stage2 (which is Go 1.19.x and written in Go)
> 3. Build go 1.20 (written in Go) using go-bootstrap-stage2.
>
> go-bootstrap-stage1 does not work on 64-bit arm. The Go 1.4.x bootstrap compiler
> is compatible with x86, x86_64, and arm (32 bit) only.
>
> This patch adds a fallback to require a host Go compiler to build host-go when
> BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS is not set.
>
> Signed-off-by: Christian Stewart <christian@aperture.us>
I understand the need, but I'd like to explore other options, namely
using pre-compiled Go compilers, which we would also like to support in
order to have the ability to run "make legal-info", or build Go
packages without necessarily having to build a Go compiler from
scratch. Like what we do for Rust, where you can chose to either use a
pre-built Rust compiler, or build your own with Buildroot.
For Go, I think we could imagine two options:
(a) You use a pre-built Go compiler as a replacement for package/go.
This would work for architectures/configurations for which
pre-built Go compilers are available. We would then move package/go
as a virtual package, with package/go-src being the provider that
builds the Go compiler from source, and package/go-bin being the
provider that downloads/installs a pre-built Go compiler.
(b) You use a pre-built Go compiler as a replacement for
package/go-bootstrap-stage2, i.e you still build the final Go
compiler from source, but all the bootstrapping is skipped by using
a pre-built Go compiler for the host. Would this option also
resolve your use-case of building on ARM64? In other words, is
there a Go compiler available pre-built for ARM64?
Best regards,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-07-22 21:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 22:08 [Buildroot] [PATCH v7 1/4] package/go-bootstrap: split into two stages: go1.4 and go1.19.10 Christian Stewart via buildroot
2023-07-11 22:08 ` [Buildroot] [PATCH v7 2/4] package/go: adjust comments Christian Stewart via buildroot
2023-07-22 21:09 ` Thomas Petazzoni via buildroot
2023-07-11 22:08 ` [Buildroot] [PATCH v7 3/4] package/go: bump to version 1.20.6 Christian Stewart via buildroot
2023-07-22 21:09 ` Thomas Petazzoni via buildroot
2023-07-11 22:08 ` [Buildroot] [PATCH v7 4/4] package/go: use host compiler when go-bootstrap unsupported Christian Stewart via buildroot
2023-07-22 21:13 ` Thomas Petazzoni via buildroot [this message]
2023-07-22 22:01 ` Christian Stewart via buildroot
2023-07-22 22:28 ` Thomas Petazzoni via buildroot
2023-07-23 3:22 ` Christian Stewart via buildroot
2023-07-25 16:48 ` Thomas Petazzoni via buildroot
2023-07-22 21:08 ` [Buildroot] [PATCH v7 1/4] package/go-bootstrap: split into two stages: go1.4 and go1.19.10 Thomas Petazzoni via buildroot
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=20230722231336.760d74ea@windsurf \
--to=buildroot@buildroot.org \
--cc=christian@aperture.us \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin.1998@free.fr \
/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