From: Peter Korsgaard <peter@korsgaard.com>
To: <yann.morin@orange.com>
Cc: Anisse Astier <anisse@astier.eu>,
Christian Stewart <christian@aperture.us>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCHv3] package/go: cgo for the target needs the toolchain
Date: Sat, 30 Sep 2023 08:48:28 +0200 [thread overview]
Message-ID: <87pm20cg1v.fsf@48ers.dk> (raw)
In-Reply-To: <fddc853041d6b720991aa3438feef2e9a431a91d.1695649859.git.yann.morin@orange.com> (yann morin's message of "Mon, 25 Sep 2023 15:51:08 +0200")
>>>>> <yann.morin@orange.com> writes:
> From: Christian Stewart <christian@aperture.us>
> Build go with cgo support needs to build some .c files to generate
> target support code, and thus calls the cross C compiler, which is
> failing when the toolchain is not built before host-go:
>>>> host-go 1.21.1 Building
> cd .../build/host-go-1.21.1/src && GO111MODULE=off GOCACHE=.../per-package/host-go/host/share/host-go-cache GOROOT_BOOTSTRAP=.../per-package/host-go/host/lib/go-1.19.11 GOROOT_FINAL=.../per-package/host-go/host/lib/go GOROOT=".../build/host-go-1.21.1" GOBIN=".../build/host-go-1.21.1/bin" GOOS=linux CC=/usr/bin/gcc CXX=/usr/bin/g++ CGO_ENABLED=1 CC_FOR_TARGET=".../per-package/host-go/host/bin/arm-linux-gcc" CXX_FOR_TARGET=".../per-package/host-go/host/bin/arm-linux-g++" GOOS="linux" GOARCH=arm GOARM=6 GO_ASSUME_CROSSCOMPILING=1 ./make.bash
> Building Go cmd/dist using .../per-package/host-go/host/lib/go-1.19.11. (go1.19.11 linux/amd64)
> go tool dist: cannot invoke C compiler [".../per-package/host-go/host/bin/arm-linux-gcc"]: fork/exec .../per-package/host-go/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.
> This happens systematically with PPD, and happens without PPD when
> host-go is explicitly built (by running: "make host-go").
> Since only CGO support needs to compile C files, onmy add the toolchain
> dependency in that case.
> When the target is not supported by go, then there is obviously no need
> to depend on the toolchain (even if we unconditionally enable cgo
> support in only-for-the-host host-go).
> Signed-off-by: Christian Stewart <christian@aperture.us>
> [yann.morin@orange.com:
> - only add the toolchain dependency for target cgo
> - reword commit log
> ]
> Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Cc: Anisse Astier <anisse@astier.eu>
> ---
> Changes v2 -> v3:
> - properly reassign authorship to Christian (sorry for the screw up)
> Changes v1 -> v2:
> - only add the toolchain dependency for target cgo
> - reword commit log
> v1 by Christian:
> https://lore.kernel.org/buildroot/20230728052530.1122268-1-christian@aperture.us/
> ---
> package/go/go.mk | 1 +
> 1 file changed, 1 insertion(+)
Committed, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-09-30 6:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 13:51 [Buildroot] [PATCHv3] package/go: cgo for the target needs the toolchain yann.morin
2023-09-30 6:48 ` Peter Korsgaard [this message]
2023-10-12 16:03 ` Peter Korsgaard
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=87pm20cg1v.fsf@48ers.dk \
--to=peter@korsgaard.com \
--cc=anisse@astier.eu \
--cc=buildroot@buildroot.org \
--cc=christian@aperture.us \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin@orange.com \
/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