From patchwork Tue Jul 11 22:08:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 1806530 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R0w4s4PWJz20ZZ for ; Wed, 12 Jul 2023 08:09:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9B0E341E71; Tue, 11 Jul 2023 22:08:59 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9B0E341E71 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gZvgSMVNlqCc; Tue, 11 Jul 2023 22:08:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id AF5E941E61; Tue, 11 Jul 2023 22:08:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org AF5E941E61 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 04AA71BF2C0 for ; Tue, 11 Jul 2023 22:08:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D27E040493 for ; Tue, 11 Jul 2023 22:08:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D27E040493 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8BrMPkRJgN-J for ; Tue, 11 Jul 2023 22:08:53 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3525C4000B Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3525C4000B for ; Tue, 11 Jul 2023 22:08:53 +0000 (UTC) Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-55ba5bb0bf3so65484a12.1 for ; Tue, 11 Jul 2023 15:08:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689113332; x=1691705332; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ujdsxlp87WJ5fywRzvp4F2Ue32lTvV67sDmCQZoYmkQ=; b=VVfXG9QxWvW6US6H82RJhBNGac8l051l7vMa+xL/VN/iu/uJLFDw7AM6X9f4Jbr9Fn dSqBxEE2tRC3m9yuPH/agoFBzNx6kWoIub/pQPr6vEK7W1qHBkqs+38HpQjueu+GSJrG 1tpfC6H7ZbcjS7T4QL/g18e5Nvq2HV15ywQP9/lbo55e0dohg36+tYY6NEd0zl8c9ugu R+iyTkuC0NXf8dcv3Ju1QsQ5p/xE/KvFfCOzKYgrMs62g3XSxfDIP+QPM9hg+mVXzPua tH6MiQzg4KywEpiOJZWd7WxeBgb/0lU7fVQzTIVRPZ0kCFziOfuJ3yqIwdARPI1m6WSb CIOg== X-Gm-Message-State: ABy/qLYK0hox+/nEr82JB6DAC9sL/wihPKCbCDCP2q5cJeRg3skdNKhx YCEUvN0Gg6bZZDtXav9OHfmoItwl1bAY8r27I6HzzQ== X-Google-Smtp-Source: APBJJlGU/Itt3yYBr3kFvNQte7Cvmet7jtPvT89akpguLwShVw6qIf6nRCEVbJ8t+l69KRpsE52rVA== X-Received: by 2002:a17:90a:8d01:b0:262:ec12:7c40 with SMTP id c1-20020a17090a8d0100b00262ec127c40mr123106pjo.11.1689113332257; Tue, 11 Jul 2023 15:08:52 -0700 (PDT) Received: from localhost.localdomain (ip184-189-231-225.sb.sd.cox.net. [184.189.231.225]) by smtp.gmail.com with ESMTPSA id ep11-20020a17090ae64b00b0025bbe90d3cbsm2268015pjb.44.2023.07.11.15.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 15:08:51 -0700 (PDT) To: buildroot@buildroot.org Date: Tue, 11 Jul 2023 15:08:46 -0700 Message-ID: <20230711220849.1702358-1-christian@aperture.us> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aperture.us; s=google; t=1689113332; x=1691705332; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ujdsxlp87WJ5fywRzvp4F2Ue32lTvV67sDmCQZoYmkQ=; b=MQGfwvu9Zmk+fcNAoS6OTLlyc+Wc2fCrowXob2lPLQjG8WUIRBxs8gUoKSBhc3fHtc XfM0Jn2tdxmxa+6pC9d5D2xZ/KMyYoJ523R7tbWfhbejceUeunKHS/aSW3izvWCdBiAd wE7BJ01ne8mOsAenisAXdD3DiweKo+A3RpmuhpXvgx/QKsr0eV+j/mwpEtKvCAYFgXFz E/Sdh+ewuyQuBkD+uR9PVVnrMFXyXPGmqSyEDOQX2QpDcOwj0DWTwCKP3+kRYcMug6Tu h4h4XxYP4nfzBS96L6kaMrw4bqM5UYASWX425Y9/tlIE8Yi6iQgcS3SE593Y+zvgb9hf zM2A== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=aperture.us header.i=@aperture.us header.a=rsa-sha256 header.s=google header.b=MQGfwvu9 Subject: [Buildroot] [PATCH v7 1/4] package/go-bootstrap: split into two stages: go1.4 and go1.19.10 X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Christian Stewart via buildroot From: Christian Stewart Reply-To: Christian Stewart Cc: Christian Stewart , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Go 1.20 requires a minimum version of go 1.17.13 to bootstrap. https://go.dev/doc/go1.20#bootstrap As Go 1.4 was the previous version that could be compiled with C, there is now no way to bootstrap go with a C compiler, unless we use a two-stage bootstrap: - build host-go-bootstrap-1.4-20170531 - build host-go-bootstrap-1.19.10 with host-go-bootstrap-1.4-20170531 - build host-go-1.20 with host-go-bootstrap-1.19.9 This is implemented in this commit first, before upgrading host-go to 1.20. Note: the .patch files from package/go version 1.19.x are not necessary for package/go-bootstrap-stage2 and have not been included there. Previous discussion of possible alternatives: https://lore.kernel.org/all/CA+h8R2rtcynkCBsz=_9yANOEguyPCOcQDj8_ns+cv8RS8+8t9A@mail.gmail.com/ https://lore.kernel.org/all/20220525234312.643dfc03@windsurf/T/ Signed-off-by: Christian Stewart --- v1 -> v2: - fix indentation of GOROOT_BOOTSTRAP in stage2 MAKE_ENV - adjust commit description - remove duplicate MAKE_ENV declaration line - reorder depends on lines in config.in.host v3 -> v4: - Fixed typo compatable -> compatible - Dropped dependency on toolchain in go-bootstrap-stage1 - Dropped updating sources timestamps in go-bootstrap-stage{1,2} - Update go-bootstrap-stage2 to 1.19.7 - Drop these comments and move to separate patch: - Fix typo in comments. - Adjusted comment built in -> built-in. - Adjust comments relating to copying src/ to host/ - Dropped outdated comment referring to issue 2775. - Thanks Thomas for the review. v4 -> v5: - update stage2 to go1.19.9 v5 -> v6: - update stage2 to go1.19.10 Signed-off-by: Christian Stewart --- DEVELOPERS | 2 + package/Config.in.host | 3 +- package/go-bootstrap-stage1/Config.in.host | 6 +++ .../go-bootstrap-stage1.hash} | 0 .../go-bootstrap-stage1.mk | 43 +++++++++++++++ package/go-bootstrap-stage2/Config.in.host | 4 ++ .../go-bootstrap-stage2.hash | 3 ++ .../go-bootstrap-stage2.mk | 53 +++++++++++++++++++ package/go-bootstrap/Config.in.host | 7 --- package/go-bootstrap/go-bootstrap.mk | 50 ----------------- package/go/Config.in.host | 4 +- package/go/go.mk | 4 +- 12 files changed, 117 insertions(+), 62 deletions(-) create mode 100644 package/go-bootstrap-stage1/Config.in.host rename package/{go-bootstrap/go-bootstrap.hash => go-bootstrap-stage1/go-bootstrap-stage1.hash} (100%) create mode 100644 package/go-bootstrap-stage1/go-bootstrap-stage1.mk create mode 100644 package/go-bootstrap-stage2/Config.in.host create mode 100644 package/go-bootstrap-stage2/go-bootstrap-stage2.hash create mode 100644 package/go-bootstrap-stage2/go-bootstrap-stage2.mk delete mode 100644 package/go-bootstrap/Config.in.host delete mode 100644 package/go-bootstrap/go-bootstrap.mk diff --git a/DEVELOPERS b/DEVELOPERS index 0918e9f721..4a0a6844b7 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -558,6 +558,8 @@ F: package/docker-engine/ F: package/embiggen-disk/ F: package/fuse-overlayfs/ F: package/go/ +F: package/go-bootstrap-stage1/ +F: package/go-bootstrap-stage2/ F: package/gocryptfs/ F: package/mbpfan/ F: package/moby-buildkit/ diff --git a/package/Config.in.host b/package/Config.in.host index dcadbfdfc1..fff75cd165 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -40,7 +40,8 @@ menu "Host utilities" source "package/genpart/Config.in.host" source "package/gnupg/Config.in.host" source "package/go/Config.in.host" - source "package/go-bootstrap/Config.in.host" + source "package/go-bootstrap-stage1/Config.in.host" + source "package/go-bootstrap-stage2/Config.in.host" source "package/google-breakpad/Config.in.host" source "package/gptfdisk/Config.in.host" source "package/imagemagick/Config.in.host" diff --git a/package/go-bootstrap-stage1/Config.in.host b/package/go-bootstrap-stage1/Config.in.host new file mode 100644 index 0000000000..56a743caf9 --- /dev/null +++ b/package/go-bootstrap-stage1/Config.in.host @@ -0,0 +1,6 @@ +config BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE1_ARCH_SUPPORTS + bool + # See src/cmd/dist/unix.c for the list of supported architectures + default y if BR2_HOSTARCH = "x86" + default y if BR2_HOSTARCH = "x86_64" + default y if BR2_HOSTARCH = "arm" diff --git a/package/go-bootstrap/go-bootstrap.hash b/package/go-bootstrap-stage1/go-bootstrap-stage1.hash similarity index 100% rename from package/go-bootstrap/go-bootstrap.hash rename to package/go-bootstrap-stage1/go-bootstrap-stage1.hash diff --git a/package/go-bootstrap-stage1/go-bootstrap-stage1.mk b/package/go-bootstrap-stage1/go-bootstrap-stage1.mk new file mode 100644 index 0000000000..dba18e86e9 --- /dev/null +++ b/package/go-bootstrap-stage1/go-bootstrap-stage1.mk @@ -0,0 +1,43 @@ +################################################################################ +# +# go-bootstrap-stage1 +# +################################################################################ + +# Use last C-based Go compiler: v1.4.x +# See https://golang.org/doc/install/source#bootstrapFromSource +GO_BOOTSTRAP_STAGE1_VERSION = 1.4-bootstrap-20171003 +GO_BOOTSTRAP_STAGE1_SITE = https://dl.google.com/go +GO_BOOTSTRAP_STAGE1_SOURCE = go$(GO_BOOTSTRAP_STAGE1_VERSION).tar.gz + +GO_BOOTSTRAP_STAGE1_LICENSE = BSD-3-Clause +GO_BOOTSTRAP_STAGE1_LICENSE_FILES = LICENSE + +HOST_GO_BOOTSTRAP_STAGE1_ROOT = $(HOST_DIR)/lib/go-$(GO_BOOTSTRAP_STAGE1_VERSION) + +# The go build system is not compatable with ccache, so use HOSTCC_NOCCACHE. +# See https://github.com/golang/go/issues/11685. +HOST_GO_BOOTSTRAP_STAGE1_MAKE_ENV = \ + GOOS=linux \ + GOROOT_FINAL="$(HOST_GO_BOOTSTRAP_STAGE1_ROOT)" \ + GOROOT="$(@D)" \ + GOBIN="$(@D)/bin" \ + CC=$(HOSTCC_NOCCACHE) \ + CGO_ENABLED=0 + +define HOST_GO_BOOTSTRAP_STAGE1_BUILD_CMDS + cd $(@D)/src && $(HOST_GO_BOOTSTRAP_STAGE1_MAKE_ENV) ./make.bash +endef + +define HOST_GO_BOOTSTRAP_STAGE1_INSTALL_CMDS + $(INSTALL) -D -m 0755 $(@D)/bin/go $(HOST_GO_BOOTSTRAP_STAGE1_ROOT)/bin/go + $(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(HOST_GO_BOOTSTRAP_STAGE1_ROOT)/bin/gofmt + + cp -a $(@D)/lib $(HOST_GO_BOOTSTRAP_STAGE1_ROOT)/ + cp -a $(@D)/pkg $(HOST_GO_BOOTSTRAP_STAGE1_ROOT)/ + + # The Go sources must be installed to the host/ tree for the Go stdlib. + cp -a $(@D)/src $(HOST_GO_BOOTSTRAP_STAGE1_ROOT)/ +endef + +$(eval $(host-generic-package)) diff --git a/package/go-bootstrap-stage2/Config.in.host b/package/go-bootstrap-stage2/Config.in.host new file mode 100644 index 0000000000..967ddaed1d --- /dev/null +++ b/package/go-bootstrap-stage2/Config.in.host @@ -0,0 +1,4 @@ +config BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS + bool + default y + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE1_ARCH_SUPPORTS diff --git a/package/go-bootstrap-stage2/go-bootstrap-stage2.hash b/package/go-bootstrap-stage2/go-bootstrap-stage2.hash new file mode 100644 index 0000000000..874737ea2d --- /dev/null +++ b/package/go-bootstrap-stage2/go-bootstrap-stage2.hash @@ -0,0 +1,3 @@ +# From https://go.dev/dl +sha256 13755bcce529747d5f2930dee034730c86d02bd3e521ab3e2bbede548d3b953f go1.19.10.src.tar.gz +sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE diff --git a/package/go-bootstrap-stage2/go-bootstrap-stage2.mk b/package/go-bootstrap-stage2/go-bootstrap-stage2.mk new file mode 100644 index 0000000000..d0ee86b84e --- /dev/null +++ b/package/go-bootstrap-stage2/go-bootstrap-stage2.mk @@ -0,0 +1,53 @@ +################################################################################ +# +# go-bootstrap-stage2 +# +################################################################################ + +# Use last Go version that go-bootstrap-stage1 can build: v1.19.x +# See https://golang.org/doc/install/source#bootstrapFromSource +GO_BOOTSTRAP_STAGE2_VERSION = 1.19.10 +GO_BOOTSTRAP_STAGE2_SITE = https://storage.googleapis.com/golang +GO_BOOTSTRAP_STAGE2_SOURCE = go$(GO_BOOTSTRAP_STAGE2_VERSION).src.tar.gz + +GO_BOOTSTRAP_STAGE2_LICENSE = BSD-3-Clause +GO_BOOTSTRAP_STAGE2_LICENSE_FILES = LICENSE + +# Use go-bootstrap-stage1 to bootstrap. +HOST_GO_BOOTSTRAP_STAGE2_DEPENDENCIES = host-go-bootstrap-stage1 + +HOST_GO_BOOTSTRAP_STAGE2_ROOT = $(HOST_DIR)/lib/go-$(GO_BOOTSTRAP_STAGE2_VERSION) + +# The go build system is not compatible with ccache, so use HOSTCC_NOCCACHE. +# See https://github.com/golang/go/issues/11685. +HOST_GO_BOOTSTRAP_STAGE2_MAKE_ENV = \ + GO111MODULE=off \ + GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE1_ROOT) \ + GOROOT_FINAL=$(HOST_GO_BOOTSTRAP_STAGE2_ROOT) \ + GOROOT="$(@D)" \ + GOBIN="$(@D)/bin" \ + GOOS=linux \ + CC=$(HOSTCC_NOCCACHE) \ + CXX=$(HOSTCXX_NOCCACHE) \ + CGO_ENABLED=0 + +define HOST_GO_BOOTSTRAP_STAGE2_BUILD_CMDS + cd $(@D)/src && \ + $(HOST_GO_BOOTSTRAP_STAGE2_MAKE_ENV) ./make.bash $(if $(VERBOSE),-v) +endef + +define HOST_GO_BOOTSTRAP_STAGE2_INSTALL_CMDS + $(INSTALL) -D -m 0755 $(@D)/bin/go $(HOST_GO_BOOTSTRAP_STAGE2_ROOT)/bin/go + $(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(HOST_GO_BOOTSTRAP_STAGE2_ROOT)/bin/gofmt + + cp -a $(@D)/lib $(HOST_GO_BOOTSTRAP_STAGE2_ROOT)/ + + mkdir -p $(HOST_GO_BOOTSTRAP_STAGE2_ROOT)/pkg + cp -a $(@D)/pkg/include $(@D)/pkg/linux_* $(HOST_GO_BOOTSTRAP_STAGE2_ROOT)/pkg/ + cp -a $(@D)/pkg/tool $(HOST_GO_BOOTSTRAP_STAGE2_ROOT)/pkg/ + + # The Go sources must be installed to the host/ tree for the Go stdlib. + cp -a $(@D)/src $(HOST_GO_BOOTSTRAP_STAGE2_ROOT)/ +endef + +$(eval $(host-generic-package)) diff --git a/package/go-bootstrap/Config.in.host b/package/go-bootstrap/Config.in.host deleted file mode 100644 index fab80d24b4..0000000000 --- a/package/go-bootstrap/Config.in.host +++ /dev/null @@ -1,7 +0,0 @@ -config BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS - bool - # See src/cmd/dist/unix.c for the list of support - # architectures - default y if BR2_HOSTARCH = "x86" - default y if BR2_HOSTARCH = "x86_64" - default y if BR2_HOSTARCH = "arm" diff --git a/package/go-bootstrap/go-bootstrap.mk b/package/go-bootstrap/go-bootstrap.mk deleted file mode 100644 index 71696a1540..0000000000 --- a/package/go-bootstrap/go-bootstrap.mk +++ /dev/null @@ -1,50 +0,0 @@ -################################################################################ -# -# go-bootstrap -# -################################################################################ - -# Use last C-based Go compiler: v1.4.x -# See https://golang.org/doc/install/source#bootstrapFromSource -GO_BOOTSTRAP_VERSION = 1.4-bootstrap-20171003 -GO_BOOTSTRAP_SITE = https://dl.google.com/go -GO_BOOTSTRAP_SOURCE = go$(GO_BOOTSTRAP_VERSION).tar.gz - -GO_BOOTSTRAP_LICENSE = BSD-3-Clause -GO_BOOTSTRAP_LICENSE_FILES = LICENSE - -# To build programs that need cgo support the toolchain needs to be -# available, so the toolchain is not needed to build host-go-bootstrap -# itself, but needed by other packages that depend on -# host-go-bootstrap. -HOST_GO_BOOTSTRAP_DEPENDENCIES = toolchain - -HOST_GO_BOOTSTRAP_ROOT = $(HOST_DIR)/lib/go-$(GO_BOOTSTRAP_VERSION) - -# The go build system is not compatable with ccache, so use HOSTCC_NOCCACHE -# here. See https://github.com/golang/go/issues/11685. -HOST_GO_BOOTSTRAP_MAKE_ENV = \ - GOOS=linux \ - GOROOT_FINAL="$(HOST_GO_BOOTSTRAP_ROOT)" \ - GOROOT="$(@D)" \ - GOBIN="$(@D)/bin" \ - CC=$(HOSTCC_NOCCACHE) \ - CGO_ENABLED=0 - -define HOST_GO_BOOTSTRAP_BUILD_CMDS - cd $(@D)/src && $(HOST_GO_BOOTSTRAP_MAKE_ENV) ./make.bash -endef - -define HOST_GO_BOOTSTRAP_INSTALL_CMDS - $(INSTALL) -D -m 0755 $(@D)/bin/go $(HOST_GO_BOOTSTRAP_ROOT)/bin/go - $(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(HOST_GO_BOOTSTRAP_ROOT)/bin/gofmt - - cp -a $(@D)/lib $(HOST_GO_BOOTSTRAP_ROOT)/ - cp -a $(@D)/pkg $(HOST_GO_BOOTSTRAP_ROOT)/ - - # There is a known issue which requires the go sources to be installed - # https://golang.org/issue/2775 - cp -a $(@D)/src $(HOST_GO_BOOTSTRAP_ROOT)/ -endef - -$(eval $(host-generic-package)) diff --git a/package/go/Config.in.host b/package/go/Config.in.host index ded02d3b3a..90a54f0da6 100644 --- a/package/go/Config.in.host +++ b/package/go/Config.in.host @@ -2,7 +2,7 @@ config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS bool default y - depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \ || BR2_i386 || BR2_x86_64 || BR2_powerpc64le \ || BR2_mips64 || BR2_mips64el || BR2_riscv || BR2_s390x @@ -28,4 +28,4 @@ config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS bool default y - depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS + depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS diff --git a/package/go/go.mk b/package/go/go.mk index 545d2117b7..a96c6ab5dd 100644 --- a/package/go/go.mk +++ b/package/go/go.mk @@ -12,7 +12,7 @@ GO_LICENSE = BSD-3-Clause GO_LICENSE_FILES = LICENSE GO_CPE_ID_VENDOR = golang -HOST_GO_DEPENDENCIES = host-go-bootstrap +HOST_GO_DEPENDENCIES = host-go-bootstrap-stage2 HOST_GO_GOPATH = $(HOST_DIR)/share/go-path HOST_GO_HOST_CACHE = $(HOST_DIR)/share/host-go-cache HOST_GO_ROOT = $(HOST_DIR)/lib/go @@ -126,7 +126,7 @@ HOST_GO_HOST_ENV = \ HOST_GO_MAKE_ENV = \ GO111MODULE=off \ GOCACHE=$(HOST_GO_HOST_CACHE) \ - GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_ROOT) \ + GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE2_ROOT) \ GOROOT_FINAL=$(HOST_GO_ROOT) \ GOROOT="$(@D)" \ GOBIN="$(@D)/bin" \ From patchwork Tue Jul 11 22:08:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 1806531 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R0w582N6sz20ZZ for ; Wed, 12 Jul 2023 08:09:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 75CCF41E73; Tue, 11 Jul 2023 22:09:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 75CCF41E73 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WHNXIfLZv_sA; Tue, 11 Jul 2023 22:09:12 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 06A9F41E98; Tue, 11 Jul 2023 22:09:10 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 06A9F41E98 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id A14D41BF2C0 for ; Tue, 11 Jul 2023 22:08:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 795F041E61 for ; Tue, 11 Jul 2023 22:08:55 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 795F041E61 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UyBG5cq8USAB for ; Tue, 11 Jul 2023 22:08:54 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 21BB141E60 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by smtp4.osuosl.org (Postfix) with ESMTPS id 21BB141E60 for ; Tue, 11 Jul 2023 22:08:54 +0000 (UTC) Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-55ba895d457so3205602a12.0 for ; Tue, 11 Jul 2023 15:08:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689113333; x=1691705333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fr8k+uLIM71cZMtxO1KWpfDCrHaFPtGvpQGcJ05ErU0=; b=dP4N4x1oNIiUo78XNSCXF9BkeFsHMKWzWPKEUc4l6YtSOwqy0uzcKmQ+3U68YHDfKM xf9Ii0zyGpGZRC5X8H6ysy7e8P257+l32q1KdNiEpnRSqM3BSW7FG+kTfeytaADefBIj 7fQcCyiHFrECmkECFubYL4nWkid8om1mGgi9G0sb04BZZhsL1DMzvpBiKsxdPtvkM4+9 KBASnWgew+KC3EElxbP5VJaz0RTuLUfQXNUqCBXx86jmN6mEV+z64xAUfM4kq7w7XO8g CgayTAvf3EAl8oHQysnmdSU/PVUvLAuIvmdVSClHWfkG31RtXj83yS1OrP8f4CC+DFpk CuYQ== X-Gm-Message-State: ABy/qLYbeKruT09kYhruC3UEzpKmqp65c7TbdCK3A8Y9OQzJjZs4v/8N yifDaA0x50EncuA5N7RB1zf9Avac2vBYUJuuEfD7mg== X-Google-Smtp-Source: APBJJlF17mz8bQqC3ZKWzp3kgYSrlW8vg/6zyIFgTV7bIlbKeuvj+WcrRk1/8st726IBR7f+Yztllw== X-Received: by 2002:a17:90b:4a41:b0:263:fc45:4091 with SMTP id lb1-20020a17090b4a4100b00263fc454091mr12588194pjb.15.1689113333362; Tue, 11 Jul 2023 15:08:53 -0700 (PDT) Received: from localhost.localdomain (ip184-189-231-225.sb.sd.cox.net. [184.189.231.225]) by smtp.gmail.com with ESMTPSA id ep11-20020a17090ae64b00b0025bbe90d3cbsm2268015pjb.44.2023.07.11.15.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 15:08:52 -0700 (PDT) To: buildroot@buildroot.org Date: Tue, 11 Jul 2023 15:08:47 -0700 Message-ID: <20230711220849.1702358-2-christian@aperture.us> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230711220849.1702358-1-christian@aperture.us> References: <20230711220849.1702358-1-christian@aperture.us> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aperture.us; s=google; t=1689113333; x=1691705333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fr8k+uLIM71cZMtxO1KWpfDCrHaFPtGvpQGcJ05ErU0=; b=AHPe7ZGLavXPMnDezKOTHVOyuV36nl+x/XpJOX7Vy4NwxND1vqVE1umXnzk3vKZE31 UO9ou0fe9n2Yn5v31HaxJfzWXYjau+FTOyo8Fj7aLDUr99KrAbylOGls6ltURN7o9sSC wUjZeAkrTdoabs9u3pHVmDpZV2NJqcAoRzjont+YWvB7LUdQ98SQgFk+LbZjFLHZQpnq 1K1xcMhmz3Pf9dY6o/r0DK6cs3jVZ29/DiErpVbmISxGkFZ3s+nfOsB0sZGhNWititKN JbL8MISUuSJ5mupop6goshDwbJS9PFUiIKn0Iu0TXYy0vRSsxRTmx+S4zTibzY1UnJDY fj9g== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=aperture.us header.i=@aperture.us header.a=rsa-sha256 header.s=google header.b=AHPe7ZGL Subject: [Buildroot] [PATCH v7 2/4] package/go: adjust comments X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Christian Stewart via buildroot From: Christian Stewart Reply-To: Christian Stewart Cc: Christian Stewart , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Adjust comments in the Go package to improve clarity: Config.in.host: - Add comment mentioning list of supported architectures. go.mk: - Improve formatting of comment about NOCCACHE - Reword comment re: copying src/ to host/ - the previously linked issue is not relevant. - instead: mention that src/ is needed for stdlib. - Adjust comment re: adjusting file timestamps. - mention this is needed to avoid rebuilding stdlib Signed-off-by: Christian Stewart --- v3 -> v4: - move these comments to a separate patch - Thanks Thomas for the review. Signed-off-by: Christian Stewart --- package/go/Config.in.host | 2 ++ package/go/go.mk | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package/go/Config.in.host b/package/go/Config.in.host index 90a54f0da6..b87b862cec 100644 --- a/package/go/Config.in.host +++ b/package/go/Config.in.host @@ -3,6 +3,8 @@ config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS bool default y depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS + # See https://go.dev/doc/install/source#environment + # See src/go/build/syslist.go for the list of supported architectures depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \ || BR2_i386 || BR2_x86_64 || BR2_powerpc64le \ || BR2_mips64 || BR2_mips64el || BR2_riscv || BR2_s390x diff --git a/package/go/go.mk b/package/go/go.mk index a96c6ab5dd..66af25db45 100644 --- a/package/go/go.mk +++ b/package/go/go.mk @@ -121,8 +121,8 @@ HOST_GO_HOST_ENV = \ CGO_CXXFLAGS="$(HOST_CXXFLAGS)" \ CGO_LDFLAGS="$(HOST_LDFLAGS)" -# The go build system is not compatible with ccache, so use -# HOSTCC_NOCCACHE. See https://github.com/golang/go/issues/11685. +# The go build system is not compatible with ccache, so use HOSTCC_NOCCACHE. +# See https://github.com/golang/go/issues/11685. HOST_GO_MAKE_ENV = \ GO111MODULE=off \ GOCACHE=$(HOST_GO_HOST_CACHE) \ @@ -154,12 +154,11 @@ define HOST_GO_INSTALL_CMDS cp -a $(@D)/pkg/include $(@D)/pkg/linux_* $(HOST_GO_ROOT)/pkg/ cp -a $(@D)/pkg/tool $(HOST_GO_ROOT)/pkg/ - # There is a known issue which requires the go sources to be installed - # https://golang.org/issue/2775 + # The Go sources must be installed to the host/ tree for the Go stdlib. cp -a $(@D)/src $(HOST_GO_ROOT)/ - # Set all file timestamps to prevent the go compiler from rebuilding any - # built in packages when programs are built. + # Set file timestamps to prevent the Go compiler from rebuilding the stdlib + # when compiling other programs. find $(HOST_GO_ROOT) -type f -exec touch -r $(@D)/bin/go {} \; endef From patchwork Tue Jul 11 22:08:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 1806532 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R0w5P3dDNz20ZZ for ; Wed, 12 Jul 2023 08:09:29 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8452D41E60; Tue, 11 Jul 2023 22:09:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 8452D41E60 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TBOIfwh9gZjT; Tue, 11 Jul 2023 22:09:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 0523341E75; Tue, 11 Jul 2023 22:09:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0523341E75 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id A18C21BF2C0 for ; Tue, 11 Jul 2023 22:08:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 7BACE40493 for ; Tue, 11 Jul 2023 22:08:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 7BACE40493 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yep372ABlc30 for ; Tue, 11 Jul 2023 22:08:55 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 420704000B Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by smtp2.osuosl.org (Postfix) with ESMTPS id 420704000B for ; Tue, 11 Jul 2023 22:08:55 +0000 (UTC) Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-26304be177fso3185136a91.1 for ; Tue, 11 Jul 2023 15:08:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689113334; x=1691705334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dSdVuwysvj5V0aTCBmvO/vYR5/apvLkpvSI+8aP6f/g=; b=S42z/AfLhGKIm0V7djVYjiYrih/baDa+SQ2ogjTALpeaN1CDYy0ykUd51WRJ0Cmwsz 5tFvOPEx5wYNZE2ChFd0qIKF3pdelnvQBHxXad8a0EJxSXFmE7eIfMK1wUe/YW3/w2yk s+5Xb44Lhw8ZHpuhvr3FpRikijLOKfvzHBA4PLuXcZdTem8q35UI/442jysTy7Q9OSWT adjf9yDP8G1UqjMCSGRtXL8Kso6RHSG2VuzLzXH8NdrZIrTvUkRKdBetva6qaAh7Im5z u+d2jEldJ09TfEx5GkBSY4MFpriuvTYezNYF3o4dao2Oe5CcRdQ5e/q94fwQy1Uq/5NX vofg== X-Gm-Message-State: ABy/qLYhwtmRSKG8aKxbGenmhicGEzHCtjt4BY5WRJe+QQ7was4XT+F0 KaNsfSL4pKSYwFQyJ4qGWDVYn3FP8xkIw7SQnhcsDw== X-Google-Smtp-Source: APBJJlHxy1rTv/YT9NUsz+G3qupE9m/YErDdJeJbvSnB/zRz7Ygh5M78hwN346Apa4vV0llJ27gAdg== X-Received: by 2002:a17:90a:be02:b0:263:fc43:5f39 with SMTP id a2-20020a17090abe0200b00263fc435f39mr13603354pjs.13.1689113334383; Tue, 11 Jul 2023 15:08:54 -0700 (PDT) Received: from localhost.localdomain (ip184-189-231-225.sb.sd.cox.net. [184.189.231.225]) by smtp.gmail.com with ESMTPSA id ep11-20020a17090ae64b00b0025bbe90d3cbsm2268015pjb.44.2023.07.11.15.08.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 15:08:54 -0700 (PDT) To: buildroot@buildroot.org Date: Tue, 11 Jul 2023 15:08:48 -0700 Message-ID: <20230711220849.1702358-3-christian@aperture.us> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230711220849.1702358-1-christian@aperture.us> References: <20230711220849.1702358-1-christian@aperture.us> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aperture.us; s=google; t=1689113334; x=1691705334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dSdVuwysvj5V0aTCBmvO/vYR5/apvLkpvSI+8aP6f/g=; b=F5Ja06RlfI2E6cfQ/a80tiyZiq0dCB470kYTR2CjdjIhZB9u9I37M2sDWsDO7vpXa3 HPt10wqIFII67oV7fcXX/Up2W3tyso2N6b9hp3dik8ZobQjSU0+CceCeyhiZ4dCyvoyZ 8UinNdkSEqsDaEbidV9Q+FI/TRAXzwt56S0dLDEWovjCDZtXoBAUDHl4WGhXtiFcGec7 tNt6l4oUWk/+QeVMgrBPb9WtcmPYAyzjEoX9D+GlKmu/TjSsiHX+1PZVTVDtZK68+fN+ 61vFeVa+bGr0Vntz1O03Qlw65RPqC0waHc5GhFLhfEk5W2UOYoq9zE2rc+bZjvywh70z Ad1g== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=aperture.us header.i=@aperture.us header.a=rsa-sha256 header.s=google header.b=F5Ja06Rl Subject: [Buildroot] [PATCH v7 3/4] package/go: bump to version 1.20.6 X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Christian Stewart via buildroot From: Christian Stewart Reply-To: Christian Stewart Cc: Christian Stewart , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The latest Go release, version 1.20, arrives six months after Go 1.19. Most of its changes are in the implementation of the toolchain, runtime, and libraries. https://go.dev/doc/go1.20 https://go.dev/doc/devel/release#go1.20.6 https://github.com/golang/go/issues?q=milestone%3AGo1.20.6+label%3ACherryPickApproved Signed-off-by: Christian Stewart --- v1 -> v2: - drop unnecessary change to config.in.host v2 -> v3: - bump to go 1.20.1 - add note about fixed cves v3 -> v4: - rebase on updated go1.19.x version - remove notes about cves (fixed in previous 1.19.x version) - update to go 1.20.2 v4 -> v5: - security update to go 1.20.4 v5 -> v6: - security update to go 1.20.5 v6 -> v7: - security update to go 1.20.6 - CVE-2023-29406 Signed-off-by: Christian Stewart --- ...03-runtime-support-riscv64-SV57-mode.patch | 65 ------------------- package/go/go.hash | 2 +- package/go/go.mk | 4 +- 3 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 package/go/0003-runtime-support-riscv64-SV57-mode.patch diff --git a/package/go/0003-runtime-support-riscv64-SV57-mode.patch b/package/go/0003-runtime-support-riscv64-SV57-mode.patch deleted file mode 100644 index f51c2ca093..0000000000 --- a/package/go/0003-runtime-support-riscv64-SV57-mode.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 6618c7af436488fa12018cdcd31eeedb3a698745 Mon Sep 17 00:00:00 2001 -From: Dmitry Vyukov -Date: Fri, 27 May 2022 18:55:35 +0200 -Subject: [PATCH] runtime: support riscv64 SV57 mode - -Riscv64 has SV57 mode when user-space VA is 56 bits. -Linux kernel recently got support for this mode and Go binaries started crashing as: - -runtime: lfstack.push invalid packing: node=0xffffff5908a940 cnt=0x1 -packed=0xffff5908a9400001 -> node=0xffff5908a940 - -Adjust lfstack code to use only 8 top bits of pointers on riscv64. - -For context see: -https://groups.google.com/g/syzkaller-bugs/c/lU0GQTZoNQQ/m/O_c3vmE3AAAJ - -Update #54104 - -Change-Id: Ib5d3d6a79c0c6eddf11618d73fcc8bc1832a9c25 -Signed-off-by: Christian Stewart ---- - -Upstream: https://go-review.googlesource.com/c/go/+/409055/4 ---- - src/runtime/lfstack_64bit.go | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/src/runtime/lfstack_64bit.go b/src/runtime/lfstack_64bit.go -index 154130cf63..39fa647b9e 100644 ---- a/src/runtime/lfstack_64bit.go -+++ b/src/runtime/lfstack_64bit.go -@@ -36,12 +36,21 @@ const ( - // We use one bit to distinguish between the two ranges. - aixAddrBits = 57 - aixCntBits = 64 - aixAddrBits + 3 -+ -+ // Riscv64 SV57 mode gives 56 bits of userspace VA. -+ // lfstack code supports it, but broader support for SV57 mode is incomplete, -+ // and there may be other issues (see #54104). -+ riscv64AddrBits = 56 -+ riscv64CntBits = 64 - riscv64AddrBits + 3 - ) - - func lfstackPack(node *lfnode, cnt uintptr) uint64 { - if GOARCH == "ppc64" && GOOS == "aix" { - return uint64(uintptr(unsafe.Pointer(node)))<<(64-aixAddrBits) | uint64(cnt&(1<> aixCntBits << 3) | 0xa<<56))) - } -+ if GOARCH == "riscv64" { -+ return (*lfnode)(unsafe.Pointer(uintptr(val >> riscv64CntBits << 3))) -+ } - return (*lfnode)(unsafe.Pointer(uintptr(val >> cntBits << 3))) - } --- -2.35.1 - diff --git a/package/go/go.hash b/package/go/go.hash index 874737ea2d..135d1ad37b 100644 --- a/package/go/go.hash +++ b/package/go/go.hash @@ -1,3 +1,3 @@ # From https://go.dev/dl -sha256 13755bcce529747d5f2930dee034730c86d02bd3e521ab3e2bbede548d3b953f go1.19.10.src.tar.gz +sha256 62ee5bc6fb55b8bae8f705e0cb8df86d6453626b4ecf93279e2867092e0b7f70 go1.20.6.src.tar.gz sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE diff --git a/package/go/go.mk b/package/go/go.mk index 66af25db45..50e3e85cf5 100644 --- a/package/go/go.mk +++ b/package/go/go.mk @@ -4,7 +4,7 @@ # ################################################################################ -GO_VERSION = 1.19.10 +GO_VERSION = 1.20.6 GO_SITE = https://storage.googleapis.com/golang GO_SOURCE = go$(GO_VERSION).src.tar.gz @@ -151,7 +151,7 @@ define HOST_GO_INSTALL_CMDS cp -a $(@D)/lib $(HOST_GO_ROOT)/ mkdir -p $(HOST_GO_ROOT)/pkg - cp -a $(@D)/pkg/include $(@D)/pkg/linux_* $(HOST_GO_ROOT)/pkg/ + cp -a $(@D)/pkg/include $(HOST_GO_ROOT)/pkg/ cp -a $(@D)/pkg/tool $(HOST_GO_ROOT)/pkg/ # The Go sources must be installed to the host/ tree for the Go stdlib. From patchwork Tue Jul 11 22:08:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 1806533 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R0w5h1KSjz20ZZ for ; Wed, 12 Jul 2023 08:09:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D903E41EAD; Tue, 11 Jul 2023 22:09:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D903E41EAD X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id osHGynn_SCqV; Tue, 11 Jul 2023 22:09:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 2307F41E61; Tue, 11 Jul 2023 22:09:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2307F41E61 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 04F4A1BF2C0 for ; Tue, 11 Jul 2023 22:08:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id E05B640493 for ; Tue, 11 Jul 2023 22:08:57 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E05B640493 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BcqhGotmwNbf for ; Tue, 11 Jul 2023 22:08:57 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org CDB1C4000B Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) by smtp2.osuosl.org (Postfix) with ESMTPS id CDB1C4000B for ; Tue, 11 Jul 2023 22:08:56 +0000 (UTC) Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6b74e2d8c98so5503688a34.2 for ; Tue, 11 Jul 2023 15:08:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689113335; x=1691705335; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7TyJCcHb/m+HTrtulV+83NEZBlLCdtrC5/8D6bXho/c=; b=HWz8ymmBvDLOSIjIvociU/+KC6WVOMLHC6C/zWzuojzFfgbyfg27EZ2bT2iBttDxlD UzfyFkS7teKfDLve/QVakYby0netvsXVBbCnWAtp5BlseHPjlGcVbFCJOC0RHShfRkiA a0kjJXM9lmGblgekKE0SC8NY+oDU7Pb09nWfDMKF7B3GggQ1yKM7nmoRfg7aak5kRqL2 Gi6M4lPHoYBBQlbnS7rDPMCb9RrnphzLPtuyCUclRP69Lw+sgcrZJmynsGSjT6sMsrsE DgRs4ua2A5E3eXH/3Jm3+vJp9OLPB/VZTMNQypBHcls4S+QGVV2xH+o5G7oLOnxPubVF GjPw== X-Gm-Message-State: ABy/qLa7ibZ1vY94tuHGKHGvCVYsT0DMBrOXFkebWtvGj9zkIeiSjwK/ P/l386xdvm09hlMcDELAwU1L3LkGHNM/IBsTbDAdYQ== X-Google-Smtp-Source: APBJJlHdBLjz8o+0NRZsW6bntekhfW15Z6J+dVOjAZPKYBYjJIJDzlQg1xgJVJXlVgwmFwnHx0F+Xw== X-Received: by 2002:a05:6870:d181:b0:1b7:3ddb:aa31 with SMTP id a1-20020a056870d18100b001b73ddbaa31mr6437929oac.21.1689113335706; Tue, 11 Jul 2023 15:08:55 -0700 (PDT) Received: from localhost.localdomain (ip184-189-231-225.sb.sd.cox.net. [184.189.231.225]) by smtp.gmail.com with ESMTPSA id ep11-20020a17090ae64b00b0025bbe90d3cbsm2268015pjb.44.2023.07.11.15.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 15:08:55 -0700 (PDT) To: buildroot@buildroot.org Date: Tue, 11 Jul 2023 15:08:49 -0700 Message-ID: <20230711220849.1702358-4-christian@aperture.us> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230711220849.1702358-1-christian@aperture.us> References: <20230711220849.1702358-1-christian@aperture.us> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aperture.us; s=google; t=1689113335; x=1691705335; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7TyJCcHb/m+HTrtulV+83NEZBlLCdtrC5/8D6bXho/c=; b=nAUtlB2MSL50d8mOEVhhhpMvPNlu+IrHrAkU3p5gtBvBUu0zjuGB6InQ56uP2BcXu+ reLcI33/KrkrNXd/rHlOKv+RoYJgi0W5ID2UzuzVvDM4AV0rYjpmpko3X2HALOAj8prL l8uFHJLMM1xrIaPiTZ/13hcmah+OMMtH+cJL6QA1Vx7xp0PrzpMw/b6UrRkRg9jWUi+r XCtow1t/wO4UGqjesL2lyiV4vnB0VfImn2Y6J0PRIWkV8ER070knV0ZVBxLc4O1vUbLp /7k7Vfhnuc4Uyij7e7Mq1s32eL+0D3Oj2whKqd8zUbGrbIVvCgGVkDpmTW78iPpQgYU6 QOGw== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=aperture.us header.i=@aperture.us header.a=rsa-sha256 header.s=google header.b=nAUtlB2M Subject: [Buildroot] [PATCH v7 4/4] package/go: use host compiler when go-bootstrap unsupported X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Christian Stewart via buildroot From: Christian Stewart Reply-To: Christian Stewart Cc: Christian Stewart , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 --- changes prior to inclusion in this series: - thanks Thomas for the review & suggestions - added NEEDS_HOST_GO boolean - added dependency checks to support/dependencies/dependencies.sh - removed unnecessary changes to go-bootstrap package - add dependency on toolchain if Cgo is enabled - updates for go1.20 - updates for go-bootstrap-stage{1,2} changes from v1 -> v2: - remove whitespace fix in bootstrap stage2 Signed-off-by: Christian Stewart --- Config.in | 4 ++++ package/go/Config.in.host | 2 +- package/go/go.mk | 14 ++++++++++++-- support/dependencies/dependencies.sh | 4 ++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Config.in b/Config.in index 0d7641633c..c70ce94d94 100644 --- a/Config.in +++ b/Config.in @@ -58,6 +58,10 @@ config BR2_HOST_GCC_AT_LEAST_9 # When adding new entries above, be sure to update # the HOSTCC_MAX_VERSION variable in the Makefile. +# Hidden boolean selected if bootstrapping Go w/ GCC is not supported. +config BR2_NEEDS_HOST_GO + bool + # Hidden boolean selected by packages in need of Java in order to build # (example: kodi) config BR2_NEEDS_HOST_JAVA diff --git a/package/go/Config.in.host b/package/go/Config.in.host index b87b862cec..7f049ff1ae 100644 --- a/package/go/Config.in.host +++ b/package/go/Config.in.host @@ -30,4 +30,4 @@ config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS bool default y - depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS + select BR2_NEEDS_HOST_GO if !BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS diff --git a/package/go/go.mk b/package/go/go.mk index 50e3e85cf5..54b5d1fd97 100644 --- a/package/go/go.mk +++ b/package/go/go.mk @@ -12,7 +12,6 @@ GO_LICENSE = BSD-3-Clause GO_LICENSE_FILES = LICENSE GO_CPE_ID_VENDOR = golang -HOST_GO_DEPENDENCIES = host-go-bootstrap-stage2 HOST_GO_GOPATH = $(HOST_DIR)/share/go-path HOST_GO_HOST_CACHE = $(HOST_DIR)/share/host-go-cache HOST_GO_ROOT = $(HOST_DIR)/lib/go @@ -109,6 +108,11 @@ else # !BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS HOST_GO_CGO_ENABLED = 1 endif # BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS +ifeq ($(HOST_GO_CGO_ENABLED),1) +# For cgo support the toolchain needs to be available. +HOST_GO_DEPENDENCIES += toolchain +endif + # For the convenience of host golang packages HOST_GO_HOST_ENV = \ $(HOST_GO_COMMON_ENV) \ @@ -126,7 +130,6 @@ HOST_GO_HOST_ENV = \ HOST_GO_MAKE_ENV = \ GO111MODULE=off \ GOCACHE=$(HOST_GO_HOST_CACHE) \ - GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE2_ROOT) \ GOROOT_FINAL=$(HOST_GO_ROOT) \ GOROOT="$(@D)" \ GOBIN="$(@D)/bin" \ @@ -136,6 +139,13 @@ HOST_GO_MAKE_ENV = \ CGO_ENABLED=$(HOST_GO_CGO_ENABLED) \ $(HOST_GO_CROSS_ENV) +# Use the Go compiler bootstrapped by Buildroot if available. +# Otherwise, use the host Go compiler. +ifeq ($(BR2_PACKAGE_HOST_GO_BOOTSTRAP_STAGE2_ARCH_SUPPORTS),y) +HOST_GO_DEPENDENCIES += host-go-bootstrap-stage2 +HOST_GO_MAKE_ENV += GOROOT_BOOTSTRAP=$(HOST_GO_BOOTSTRAP_STAGE2_ROOT) +endif + define HOST_GO_BUILD_CMDS cd $(@D)/src && \ $(HOST_GO_MAKE_ENV) ./make.bash $(if $(VERBOSE),-v) diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh index 58f44c8723..48ec3a2eb0 100755 --- a/support/dependencies/dependencies.sh +++ b/support/dependencies/dependencies.sh @@ -217,6 +217,10 @@ if grep -q ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG ; then fi fi +if grep -q ^BR2_NEEDS_HOST_GO=y $BR2_CONFIG ; then + check_prog_host "go" +fi + if grep -q ^BR2_NEEDS_HOST_JAVA=y $BR2_CONFIG ; then check_prog_host "java" JAVA_GCJ=$(java -version 2>&1 | grep gcj)