summaryrefslogtreecommitdiff
path: root/system/gcc/339-gccgo-errstr.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-04-25 06:18:22 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-04-25 06:18:22 +0000
commitd40d77c4b8e84ab22bb631c5cced89b10ce3a84c (patch)
treecb2df669b217dbac7250cea6357a2c8be5cbfbea /system/gcc/339-gccgo-errstr.patch
parente179c8bab629eb4f1ceb840ef6eed33c4d4c553b (diff)
downloadpackages-d40d77c4b8e84ab22bb631c5cced89b10ce3a84c.tar.gz
packages-d40d77c4b8e84ab22bb631c5cced89b10ce3a84c.tar.bz2
packages-d40d77c4b8e84ab22bb631c5cced89b10ce3a84c.tar.xz
packages-d40d77c4b8e84ab22bb631c5cced89b10ce3a84c.zip
system/gcc: fix more GCC Go bugs
Diffstat (limited to 'system/gcc/339-gccgo-errstr.patch')
-rw-r--r--system/gcc/339-gccgo-errstr.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/system/gcc/339-gccgo-errstr.patch b/system/gcc/339-gccgo-errstr.patch
new file mode 100644
index 000000000..f78d18aa4
--- /dev/null
+++ b/system/gcc/339-gccgo-errstr.patch
@@ -0,0 +1,45 @@
+--- gcc-8.3.0/libgo/go/syscall/errstr_linux.go 2016-08-06 00:36:33.000000000 +0000
++++ /dev/null 2019-04-08 15:05:18.560000000 +0000
+@@ -1,31 +0,0 @@
+-// errstr_linux.go -- GNU/Linux specific error strings.
+-
+-// Copyright 2010 The Go Authors. All rights reserved.
+-// Use of this source code is governed by a BSD-style
+-// license that can be found in the LICENSE file.
+-
+-// We use this rather than errstr.go because on GNU/Linux sterror_r
+-// returns a pointer to the error message, and may not use buf at all.
+-
+-package syscall
+-
+-import "unsafe"
+-
+-//sysnb strerror_r(errnum int, b []byte) (errstr *byte)
+-//strerror_r(errnum _C_int, b *byte, len Size_t) *byte
+-
+-func Errstr(errnum int) string {
+- a := make([]byte, 128)
+- p := strerror_r(errnum, a)
+- b := (*[1000]byte)(unsafe.Pointer(p))
+- i := 0
+- for b[i] != 0 {
+- i++
+- }
+- // Lowercase first letter: Bad -> bad, but STREAM -> STREAM.
+- if i > 1 && 'A' <= b[0] && b[0] <= 'Z' && 'a' <= b[1] && b[1] <= 'z' {
+- c := b[0] + 'a' - 'A'
+- return string(c) + string(b[1:i])
+- }
+- return string(b[:i])
+-}
+--- gcc-8.3.0/libgo/go/syscall/errstr.go.old 2016-08-06 00:36:33.000000000 +0000
++++ gcc-8.3.0/libgo/go/syscall/errstr.go 2019-04-25 05:41:27.915806277 +0000
+@@ -4,8 +4,6 @@
+ // Use of this source code is governed by a BSD-style
+ // license that can be found in the LICENSE file.
+
+-// +build !linux
+-
+ package syscall
+
+ //sysnb strerror_r(errnum int, buf []byte) (err Errno)