[Buildroot] pkg-golang: host package not supported

Cam Hutchison camh at xdna.net
Sat Aug 11 22:23:36 UTC 2018


On 10 August 2018 at 22:00, Thomas Petazzoni
<thomas.petazzoni at bootlin.com> wrote:
> Hello Mirza,
>
> On Fri, 10 Aug 2018 13:34:06 +0200, Mirza Krak wrote:
>
>> - Any hints on to add host-golang-package support?
>
> The first question is whether the existing host-go package installs a
> Go compiler that can do native compilation in addition to
> cross-compilation.

Yes, the existing host-go package will do native compilation. It is
just a matter of calling the compiler without the extra environment
variables set in HOST_GO_TARGET_ENV, specifically GOARCH, GOTOOLDIR,
CC and CXX. I'm not sure about GOROOT - the docs talk about that var
when un-archiving a binary installation of the toolchain anywhere but
/usr/local. I suspect a built-from-source toolchain will have the
correct GOROOT compiled in.

I have successfully compiled kubernetes under buildroot. It has a
pre-build generate-files step that builds a generator program for the
host and runs it. All I needed to do was put $(BR_PATH) at the head of
the path and ran the kubernetes generated_files step.

[I also posted the patch https://patchwork.ozlabs.org/patch/949972/ to
selectively set CGO_ENABLED, which I also needed to build kubernetes].



More information about the buildroot mailing list