bump version to 2022.02.9

add miyoo_defconfig
This commit is contained in:
tiopex
2023-01-31 13:11:45 +01:00
parent 1fa746c353
commit dcdaa3599c
8423 changed files with 184305 additions and 91107 deletions

View File

@@ -1,4 +1,4 @@
From e1382a731a726293e30901038c6870fa77ef6095 Mon Sep 17 00:00:00 2001
From 335c6245674088de616324398137416c7a1cbe8f Mon Sep 17 00:00:00 2001
From: Angelo Compagnucci <angelo@amarulasolutions.com>
Date: Tue, 8 May 2018 16:08:44 +0200
Subject: [PATCH] build.go: explicit option for crosscompilation
@@ -17,10 +17,10 @@ Signed-off-by: Anisse Astier <anisse@astier.eu>
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index 99d1db5..eb4097f 100644
index f99f1f4e43..08a9f24f59 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
@@ -252,12 +252,13 @@ func xinit() {
@@ -286,12 +286,13 @@ func xinit() {
// $CC_FOR_goos_goarch, if set, applies only to goos/goarch.
func compilerEnv(envName, def string) map[string]string {
m := map[string]string{"": def}
@@ -36,5 +36,5 @@ index 99d1db5..eb4097f 100644
}
m[""] = env
--
2.7.4
2.35.1

View File

@@ -0,0 +1,95 @@
From 38d841a18ab0bcb63554fed6b38012e504599891 Mon Sep 17 00:00:00 2001
From: Christian Stewart <christian@paral.in>
Date: Wed, 1 Jun 2022 20:52:12 +0000
Subject: [PATCH] cmd/dist: use gohostarch for ssa rewrite check
Fix a build failure when bootstrapping the Go compiler with go-bootstrap 1.4
while the environment contains GOARCH=riscv64.
Building Go toolchain1 using go-1.4-bootstrap-20171003.
src/cmd/compile/internal/ssa/rewriteRISCV64.go:4814
invalid operation: y << x (shift count type int64, must be unsigned integer)
This is because:
- buildtool.go:198: calls bootstrapRewriteFile(src)
- bootstrapRewriteFile: buildtool.go:283 calls:
- isUnneededSSARewriteFile: checks os.Getenv("GOARCH")
- isUnneededSSARewriteFile: returns "", false
- bootstrapRewriteFile: calls bootstrapFixImports
- boostrapFixImports: generates code go1.4 cannot compile
Instead of checking "GOARCH" in the environment, use the gohostarch variable.
Change-Id: Ie9c190498555c4068461fead6278a62e924062c6
GitHub-Last-Rev: 300d7a7fea0a67c696970fd271e2ce709674a658
GitHub-Pull-Request: golang/go#52362
Reviewed-on: https://go-review.googlesource.com/c/go/+/400376
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Run-TryBot: Joel Sing <joel@sing.id.au>
---
src/cmd/dist/buildtool.go | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go
index 036f8c52fa..2d8ace52d8 100644
--- a/src/cmd/dist/buildtool.go
+++ b/src/cmd/dist/buildtool.go
@@ -16,7 +16,6 @@ import (
"os"
"path/filepath"
"regexp"
- "runtime"
"strings"
)
@@ -239,11 +238,11 @@ var ssaRewriteFileSubstring = filepath.FromSlash("src/cmd/compile/internal/ssa/r
// isUnneededSSARewriteFile reports whether srcFile is a
// src/cmd/compile/internal/ssa/rewriteARCHNAME.go file for an
-// architecture that isn't for the current runtime.GOARCH.
+// architecture that isn't for the given GOARCH.
//
// When unneeded is true archCaps is the rewrite base filename without
// the "rewrite" prefix or ".go" suffix: AMD64, 386, ARM, ARM64, etc.
-func isUnneededSSARewriteFile(srcFile string) (archCaps string, unneeded bool) {
+func isUnneededSSARewriteFile(srcFile, goArch string) (archCaps string, unneeded bool) {
if !strings.Contains(srcFile, ssaRewriteFileSubstring) {
return "", false
}
@@ -258,13 +257,10 @@ func isUnneededSSARewriteFile(srcFile string) (archCaps string, unneeded bool) {
archCaps = fileArch
fileArch = strings.ToLower(fileArch)
fileArch = strings.TrimSuffix(fileArch, "splitload")
- if fileArch == os.Getenv("GOHOSTARCH") {
+ if fileArch == goArch {
return "", false
}
- if fileArch == strings.TrimSuffix(runtime.GOARCH, "le") {
- return "", false
- }
- if fileArch == strings.TrimSuffix(os.Getenv("GOARCH"), "le") {
+ if fileArch == strings.TrimSuffix(goArch, "le") {
return "", false
}
return archCaps, true
@@ -273,9 +269,9 @@ func isUnneededSSARewriteFile(srcFile string) (archCaps string, unneeded bool) {
func bootstrapRewriteFile(srcFile string) string {
// During bootstrap, generate dummy rewrite files for
// irrelevant architectures. We only need to build a bootstrap
- // binary that works for the current runtime.GOARCH.
+ // binary that works for the current gohostarch.
// This saves 6+ seconds of bootstrap.
- if archCaps, ok := isUnneededSSARewriteFile(srcFile); ok {
+ if archCaps, ok := isUnneededSSARewriteFile(srcFile, gohostarch); ok {
return fmt.Sprintf(`// Code generated by go tool dist; DO NOT EDIT.
package ssa
--
2.35.1

View File

@@ -0,0 +1,65 @@
From 6618c7af436488fa12018cdcd31eeedb3a698745 Mon Sep 17 00:00:00 2001
From: Dmitry Vyukov <dvyukov@google.com>
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 <christian@paral.in>
---
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-1))
}
+ if GOARCH == "riscv64" {
+ return uint64(uintptr(unsafe.Pointer(node)))<<(64-riscv64AddrBits) | uint64(cnt&(1<<riscv64CntBits-1))
+ }
return uint64(uintptr(unsafe.Pointer(node)))<<(64-addrBits) | uint64(cnt&(1<<cntBits-1))
}
@@ -54,5 +63,8 @@ func lfstackUnpack(val uint64) *lfnode {
if GOARCH == "ppc64" && GOOS == "aix" {
return (*lfnode)(unsafe.Pointer(uintptr((val >> 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

View File

@@ -2,14 +2,19 @@
config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
bool
default y
depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_20006
depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS
depends on (BR2_arm && BR2_TOOLCHAIN_SUPPORTS_PIE) || BR2_aarch64 \
|| BR2_i386 || BR2_x86_64 || BR2_powerpc64le \
|| BR2_mips64 || BR2_mips64el || BR2_s390x
|| BR2_mips64 || BR2_mips64el || BR2_riscv || BR2_s390x
depends on !BR2_ARM_CPU_ARMV4
# MIPS R6 support in Go has not yet been developed.
depends on !BR2_MIPS_CPU_MIPS64R6
# Go doesn't support Risc-v 32-bit.
depends on !BR2_RISCV_32
# Go requires the following Risc-v General (G) features:
depends on !BR2_riscv || (BR2_RISCV_ISA_RVI && \
BR2_RISCV_ISA_RVM && BR2_RISCV_ISA_RVA && \
BR2_RISCV_ISA_RVF && BR2_RISCV_ISA_RVD)
config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
bool

View File

@@ -1,3 +1,3 @@
# From https://golang.org/dl/
sha256 28bf9d0bcde251011caae230a4a05d917b172ea203f2a62f2c2f9533589d4b4d go1.15.2.src.tar.gz
sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE
# From https://go.dev/dl
sha256 fbe7f09b96aca3db6faeaf180da8bb632868ec049731e355ff61695197c0e3ea go1.18.9.src.tar.gz
sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 LICENSE

View File

@@ -4,12 +4,13 @@
#
################################################################################
GO_VERSION = 1.15.2
GO_VERSION = 1.18.9
GO_SITE = https://storage.googleapis.com/golang
GO_SOURCE = go$(GO_VERSION).src.tar.gz
GO_LICENSE = BSD-3-Clause
GO_LICENSE_FILES = LICENSE
GO_CPE_ID_VENDOR = golang
HOST_GO_DEPENDENCIES = host-go-bootstrap
HOST_GO_GOPATH = $(HOST_DIR)/usr/share/go-path
@@ -24,6 +25,8 @@ HOST_GO_COMMON_ENV = \
GOFLAGS=-mod=vendor \
GOROOT="$(HOST_GO_ROOT)" \
GOPATH="$(HOST_GO_GOPATH)" \
GOCACHE="$(HOST_GO_TARGET_CACHE)" \
GOMODCACHE="$(HOST_GO_GOPATH)/pkg/mod" \
GOPROXY=off \
PATH=$(BR_PATH) \
GOBIN= \
@@ -39,11 +42,19 @@ else ifeq ($(BR2_ARM_CPU_ARMV6),y)
GO_GOARM = 6
else ifeq ($(BR2_ARM_CPU_ARMV7A),y)
GO_GOARM = 7
else ifeq ($(BR2_ARM_CPU_ARMV8A),y)
# Go doesn't support 32-bit GOARM=8 (https://github.com/golang/go/issues/29373)
# but can still benefit from armv7 optimisations
GO_GOARM = 7
endif
else ifeq ($(BR2_aarch64),y)
GO_GOARCH = arm64
else ifeq ($(BR2_i386),y)
GO_GOARCH = 386
# i386: use softfloat if no SSE2: https://golang.org/doc/go1.16#386
ifneq ($(BR2_X86_CPU_HAS_SSE2),y)
GO_GO386 = softfloat
endif
else ifeq ($(BR2_x86_64),y)
GO_GOARCH = amd64
else ifeq ($(BR2_powerpc64),y)
@@ -54,6 +65,8 @@ else ifeq ($(BR2_mips64),y)
GO_GOARCH = mips64
else ifeq ($(BR2_mips64el),y)
GO_GOARCH = mips64le
else ifeq ($(BR2_riscv),y)
GO_GOARCH = riscv64
else ifeq ($(BR2_s390x),y)
GO_GOARCH = s390x
endif
@@ -62,8 +75,8 @@ endif
HOST_GO_TOOLDIR = $(HOST_GO_ROOT)/pkg/tool/linux_$(GO_GOARCH)
HOST_GO_TARGET_ENV = \
$(HOST_GO_COMMON_ENV) \
GOOS="linux" \
GOARCH=$(GO_GOARCH) \
GOCACHE="$(HOST_GO_TARGET_CACHE)" \
CC="$(TARGET_CC)" \
CXX="$(TARGET_CXX)" \
CGO_CFLAGS="$(TARGET_CFLAGS)" \
@@ -84,7 +97,9 @@ endif
HOST_GO_CROSS_ENV = \
CC_FOR_TARGET="$(TARGET_CC)" \
CXX_FOR_TARGET="$(TARGET_CXX)" \
GOOS="linux" \
GOARCH=$(GO_GOARCH) \
$(if $(GO_GO386),GO386=$(GO_GO386)) \
$(if $(GO_GOARM),GOARM=$(GO_GOARM)) \
GO_ASSUME_CROSSCOMPILING=1
@@ -97,10 +112,11 @@ endif # BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
# For the convenience of host golang packages
HOST_GO_HOST_ENV = \
$(HOST_GO_COMMON_ENV) \
GOOS="" \
GOARCH="" \
GOCACHE="$(HOST_GO_HOST_CACHE)" \
CC="$(HOST_CCNOCCACHE)" \
CXX="$(HOST_CXXNOCCACHE)" \
CC="$(HOSTCC_NOCCACHE)" \
CXX="$(HOSTCXX_NOCCACHE)" \
CGO_CFLAGS="$(HOST_CFLAGS)" \
CGO_CXXFLAGS="$(HOST_CXXFLAGS)" \
CGO_LDFLAGS="$(HOST_LDFLAGS)"