From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Christian Stewart <christian@aperture.us>
Cc: "Yann E . MORIN" <yann.morin.1998@free.fr>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v1 1/1] package/go: add toolchain as dependency of host-go
Date: Fri, 28 Jul 2023 09:26:56 +0200 [thread overview]
Message-ID: <20230728092656.5ae69f0f@windsurf> (raw)
In-Reply-To: <20230728052530.1122268-1-christian@aperture.us>
Hello Christian,
On Thu, 27 Jul 2023 22:25:30 -0700
Christian Stewart <christian@aperture.us> wrote:
> Running "make host-go" in a clean Buildroot tree causes a build failure:
>
> Building Go cmd/dist using /host/lib/go-1.19.10. (go1.19.10 linux/amd64)
> go tool dist: cannot invoke C compiler ["/host/bin/arm-linux-gcc"]:
> fork/exec /host/bin/arm-linux-gcc: no such file or directory
>
> Go needs a system C compiler for use with cgo.
> To set a C compiler, set CC=the-compiler.
> To disable cgo, set CGO_ENABLED=0.
>
> Despite the fact that we're compiling the Go compiler and not compiling anything
> for the target system, the Go compiler make.bash still attempts to call the
> target C compiler during the build process.
>
> The dependency on toolchain is necessary only for host-go and not the other
> host-go-bootstrap packages as we only pass the path to the target compiler to
> the final host-go compiler package make.bash.
>
> Fix the issue by adding toolchain to the host-go package dependencies.
>
> Signed-off-by: Christian Stewart <christian@aperture.us>
> ---
> package/go/go.mk | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/package/go/go.mk b/package/go/go.mk
> index efa47e5781..ada343f766 100644
> --- a/package/go/go.mk
> +++ b/package/go/go.mk
> @@ -12,7 +12,8 @@ GO_LICENSE = BSD-3-Clause
> GO_LICENSE_FILES = LICENSE
> GO_CPE_ID_VENDOR = golang
>
> -HOST_GO_DEPENDENCIES = host-go-bootstrap-stage2
> +# Go requires the target toolchain to build the compiler.
> +HOST_GO_DEPENDENCIES = host-go-bootstrap-stage2 toolchain
What happens when we're building host-go for a target architecture that
Go does not support? This was previously supported in host-go, in which
we have this condition:
ifeq ($(BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS),y)
...
endif
to ensure we build a host-go compiler capable of building code for the
target if the target is supported, but in all cases builds a Go
compiler capable of compiling code for the host. Indeed, host-go might
also be needed solely to build host utilities, which would be relevant
even if the target architecture isn't supported by Go.
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-28 7:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-28 5:25 [Buildroot] [PATCH v1 1/1] package/go: add toolchain as dependency of host-go Christian Stewart via buildroot
2023-07-28 7:26 ` Thomas Petazzoni via buildroot [this message]
2023-07-29 1:19 ` Christian Stewart via buildroot
2023-07-29 21:05 ` 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=20230728092656.5ae69f0f@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 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.