From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Athaariq Ardhiansyah <foss@athaariq.my.id>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Anisse Astier <anisse@astier.eu>,
Thomas Perale <thomas.perale@mind.be>,
Christian Stewart <christian@aperture.us>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 3/3] package/go: add prebuilt Go compiler option
Date: Sat, 14 Sep 2024 18:31:03 +0200 [thread overview]
Message-ID: <ZuW6R60yT66lkK4I@landeda> (raw)
In-Reply-To: <20240610154028.792440-3-foss@athaariq.my.id>
Athaariq, All,
On 2024-06-10 22:40 +0700, Athaariq Ardhiansyah spake thusly:
> According to the TO-DO list, the prebuilt Go compiler is considered as
> important to be implemented. So, I'm trying to help you to add the
> prebuilt Go compiler support into Buildroot.
>
> Signed-off-by: Athaariq Ardhiansyah <foss@athaariq.my.id>
Thank you for your proposal. However, Thomas Perale had been working on
his series and just respun a new iterartion of their patch, that is
musch closer to a solution we were expecting.
Thank you for the effort nonetheless, it is still much appreciated!
Maybe there are a few other, maybe-simpler topics you can have a look
into.
Thanks!
Regards,
Yann E. MORIN.
> ---
> package/go/Config.in.host | 22 +++++++++++++++-
> package/go/go-bin/go-bin.hash | 8 ++++++
> package/go/go-bin/go-bin.mk | 47 +++++++++++++++++++++++++++++++++++
> 3 files changed, 76 insertions(+), 1 deletion(-)
> create mode 100644 package/go/go-bin/go-bin.hash
> create mode 100644 package/go/go-bin/go-bin.mk
>
> diff --git a/package/go/Config.in.host b/package/go/Config.in.host
> index 32483871e7..ffd2594a80 100644
> --- a/package/go/Config.in.host
> +++ b/package/go/Config.in.host
> @@ -32,6 +32,16 @@ config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS
> default y
> depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE3_ARCH_SUPPORTS
>
> +# Only required for prebuilt Go compiler
> +config BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> + bool
> + default y if (BR2_HOSTARCH = "arm" && BR2_TOOLCHAIN_SUPPORTS_PIE)
> + default y if BR2_HOSTARCH = "aarch64"
> + default y if BR2_HOSTARCH = "powerpc64le"
> + default y if BR2_HOSTARCH = "s390x"
> + default y if BR2_HOSTARCH = "x86"
> + default y if BR2_HOSTARCH = "x86_64"
> +
> # Go packages should select BR2_PACKAGE_HOST_GO
> config BR2_PACKAGE_HOST_GO
> bool "host go"
> @@ -52,12 +62,22 @@ config BR2_PACKAGE_HOST_GO_SRC
> help
> This package will build the go compiler for the host.
>
> +config BR2_PACKAGE_HOST_GO_BIN
> + bool "host go (prebuilt)"
> + depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> + help
> + This package will download the go compiler binary for
> + the host without build process.
> +
> +comment "host-go-bin doesn't support $(BR2_HOSTARCH) host architecture."
> + depends on !BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> +
> endchoice
>
> config BR2_PACKAGE_PROVIDES_HOST_GO
> string
> - # Default to host-go-src
> default "host-go-src" if BR2_PACKAGE_HOST_GO_SRC
> + default "host-go-bin" if BR2_PACKAGE_HOST_GO_BIN
>
> endif
>
> diff --git a/package/go/go-bin/go-bin.hash b/package/go/go-bin/go-bin.hash
> new file mode 100644
> index 0000000000..52b6c6355f
> --- /dev/null
> +++ b/package/go/go-bin/go-bin.hash
> @@ -0,0 +1,8 @@
> +# From https://go.dev/dl
> +sha256 fefba30bb0d3dd1909823ee38c9f1930c3dc5337a2ac4701c2277a329a386b57 go1.22.3.linux-386.tar.gz
> +sha256 8920ea521bad8f6b7bc377b4824982e011c19af27df88a815e3586ea895f1b36 go1.22.3.linux-amd64.tar.gz
> +sha256 6c33e52a5b26e7aa021b94475587fce80043a727a54ceb0eee2f9fc160646434 go1.22.3.linux-arm64.tar.gz
> +sha256 f2bacad20cd2b96f23a86d4826525d42b229fd431cc6d0dec61ff3bc448ef46e go1.22.3.linux-armv6l.tar.gz
> +sha256 04b7b05283de30dd2da20bf3114b2e22cc727938aed3148babaf35cc951051ac go1.22.3.linux-ppc64le.tar.gz
> +sha256 2aba796417a69be5f3ed489076bac79c1c02b36e29422712f9f3bf51da9cf2d4 go1.22.3.linux-s390x.tar.gz
> +sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE
> diff --git a/package/go/go-bin/go-bin.mk b/package/go/go-bin/go-bin.mk
> new file mode 100644
> index 0000000000..cb320f44fa
> --- /dev/null
> +++ b/package/go/go-bin/go-bin.mk
> @@ -0,0 +1,47 @@
> +################################################################################
> +#
> +# go-bin
> +#
> +################################################################################
> +
> +# Translate Buildroot's arch enumeration to Go's arch
> +ifeq ($(BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS), y)
> +
> +ifeq ($(BR2_HOSTARCH), "arm")
> +GO_GOARCH = "armv6l"
> +else ifeq ($(BR2_HOSTARCH), "aarch64")
> +GO_GOARCH = "arm64"
> +else ifeq ($(BR2_HOSTARCH), "powerpc64le")
> +GO_GOARCH = "ppc64le"
> +else ifeq ($(BR2_HOSTARCH), "powerpc64le")
> +GO_GOARCH = "ppc64le"
> +else ifeq ($(BR2_HOSTARCH), "x86")
> +GO_GOARCH = "386"
> +else ifeq ($(BR2_HOSTARCH), "x86_64")
> +GO_GOARCH = "amd64"
> +else
> +GO_GOARCH = $(BR2_HOSTARCH)
> +endif
> +
> +endif # BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> +
> +GO_BIN_SITE = https://storage.googleapis.com/golang
> +GO_BIN_SOURCE = go$(GO_VERSION).linux-$(GO_GOARCH).tar.gz
> +
> +GO_BIN_LICENSE = BSD-3-Clause
> +GO_BIN_LICENSE_FILES = LICENSE
> +GO_BIN_CPE_ID_VENDOR = golang
> +
> +HOST_GO_SRC_PROVIDES = host-go
> +
> +ifeq ($(BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS),y)
> +ifeq ($(BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS), y)
> +
> +define HOST_GO_BIN_INSTALL_CMDS
> + $(GO_BINARIES_INSTALL)
> +endef
> +
> +endif # BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> +endif # BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
> +
> +$(eval $(host-generic-package))
> --
> 2.45.2
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2024-09-14 16:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 15:40 [Buildroot] [PATCH 1/3] package/go: expose option to enable via configurator Athaariq Ardhiansyah
2024-06-10 15:40 ` [Buildroot] [PATCH 2/3] package/go: move source-specific to go-src Athaariq Ardhiansyah
2024-09-14 16:27 ` Yann E. MORIN
2024-06-10 15:40 ` [Buildroot] [PATCH 3/3] package/go: add prebuilt Go compiler option Athaariq Ardhiansyah
2024-09-14 16:31 ` Yann E. MORIN [this message]
2024-09-14 16:24 ` [Buildroot] [PATCH 1/3] package/go: expose option to enable via configurator Yann E. MORIN
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=ZuW6R60yT66lkK4I@landeda \
--to=yann.morin.1998@free.fr \
--cc=anisse@astier.eu \
--cc=buildroot@buildroot.org \
--cc=christian@aperture.us \
--cc=foss@athaariq.my.id \
--cc=thomas.perale@mind.be \
--cc=thomas.petazzoni@bootlin.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