summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/gcc/338-gccgo-syscall.patch115
-rw-r--r--system/gcc/339-gccgo-errstr.patch45
-rw-r--r--system/gcc/APKBUILD4
3 files changed, 164 insertions, 0 deletions
diff --git a/system/gcc/338-gccgo-syscall.patch b/system/gcc/338-gccgo-syscall.patch
new file mode 100644
index 000000000..a4ecb5b6b
--- /dev/null
+++ b/system/gcc/338-gccgo-syscall.patch
@@ -0,0 +1,115 @@
+diff -Naur gcc-8.3.0-orig/libgo/go/runtime/stubs.go gcc-8.3.0/libgo/go/runtime/stubs.go
+--- gcc-8.3.0-orig/libgo/go/runtime/stubs.go 2019-04-25 03:03:52.311215191 +0000
++++ gcc-8.3.0/libgo/go/runtime/stubs.go 2019-04-25 03:03:27.973824045 +0000
+@@ -284,8 +284,7 @@
+ // For gccgo this is in the C code.
+ func osyield()
+
+-// For gccgo this can be called directly.
+-//extern syscall
++//extern __go_syscall6
+ func syscall(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) uintptr
+
+ // For gccgo, to communicate from the C code to the Go code.
+diff -Naur gcc-8.3.0-orig/libgo/go/syscall/syscall_unix.go gcc-8.3.0/libgo/go/syscall/syscall_unix.go
+--- gcc-8.3.0-orig/libgo/go/syscall/syscall_unix.go 2019-04-25 03:04:55.064488337 +0000
++++ gcc-8.3.0/libgo/go/syscall/syscall_unix.go 2019-04-25 03:08:23.612133013 +0000
+@@ -19,11 +19,8 @@
+ Stderr = 2
+ )
+
+-//extern syscall
+-func c_syscall32(trap int32, a1, a2, a3, a4, a5, a6 int32) int32
+-
+-//extern syscall
+-func c_syscall64(trap int64, a1, a2, a3, a4, a5, a6 int64) int64
++//extern __go_syscall6
++func syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) uintptr
+
+ const (
+ darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8
+@@ -38,14 +35,7 @@
+ func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
+ Entersyscall()
+ SetErrno(0)
+- var r uintptr
+- if unsafe.Sizeof(r) == 4 {
+- r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3), 0, 0, 0)
+- r = uintptr(r1)
+- } else {
+- r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3), 0, 0, 0)
+- r = uintptr(r1)
+- }
++ r := syscall6(trap, a1, a2, a3, 0, 0, 0)
+ err = GetErrno()
+ Exitsyscall()
+ return r, 0, err
+@@ -54,47 +44,22 @@
+ func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) {
+ Entersyscall()
+ SetErrno(0)
+- var r uintptr
+- if unsafe.Sizeof(r) == 4 {
+- r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3),
+- int32(a4), int32(a5), int32(a6))
+- r = uintptr(r1)
+- } else {
+- r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3),
+- int64(a4), int64(a5), int64(a6))
+- r = uintptr(r1)
+- }
++ r := syscall6(trap, a1, a2, a3, a4, a5, a6)
+ err = GetErrno()
+ Exitsyscall()
+ return r, 0, err
+ }
+
+ func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
+- var r uintptr
+ SetErrno(0)
+- if unsafe.Sizeof(r) == 4 {
+- r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3), 0, 0, 0)
+- r = uintptr(r1)
+- } else {
+- r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3), 0, 0, 0)
+- r = uintptr(r1)
+- }
++ r := syscall6(trap, a1, a2, a3, 0, 0, 0)
+ err = GetErrno()
+ return r, 0, err
+ }
+
+ func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) {
+- var r uintptr
+ SetErrno(0)
+- if unsafe.Sizeof(r) == 4 {
+- r1 := c_syscall32(int32(trap), int32(a1), int32(a2), int32(a3),
+- int32(a4), int32(a5), int32(a6))
+- r = uintptr(r1)
+- } else {
+- r1 := c_syscall64(int64(trap), int64(a1), int64(a2), int64(a3),
+- int64(a4), int64(a5), int64(a6))
+- r = uintptr(r1)
+- }
++ r := syscall6(trap, a1, a2, a3, a4, a5, a6)
+ err = GetErrno()
+ return r, 0, err
+ }
+diff -Naur gcc-8.3.0-orig/libgo/runtime/go-varargs.c gcc-8.3.0/libgo/runtime/go-varargs.c
+--- gcc-8.3.0-orig/libgo/runtime/go-varargs.c 2015-11-06 19:15:45.000000000 +0000
++++ gcc-8.3.0/libgo/runtime/go-varargs.c 2019-04-25 03:14:11.404851275 +0000
+@@ -89,3 +89,14 @@
+ }
+
+ #endif
++
++// __go_syscall6 is called by both the runtime and syscall packages.
++// We use uintptr_t to make sure that the types match, since the Go
++// and C "int" types are not the same.
++
++uintptr_t
++__go_syscall6(uintptr_t flag, uintptr_t a1, uintptr_t a2, uintptr_t a3,
++ uintptr_t a4, uintptr_t a5, uintptr_t a6)
++{
++ return syscall (flag, a1, a2, a3, a4, a5, a6);
++}
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)
diff --git a/system/gcc/APKBUILD b/system/gcc/APKBUILD
index 60f9e6366..2ab149205 100644
--- a/system/gcc/APKBUILD
+++ b/system/gcc/APKBUILD
@@ -174,6 +174,8 @@ source="https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz
335-gccgo-signal-ppc32.patch
336-gccgo-mmap64.patch
337-gccgo-signal-sig34.patch
+ 338-gccgo-syscall.patch
+ 339-gccgo-errstr.patch
add-classic_table-support.patch
disable-multiarch-ppc32.patch
@@ -565,6 +567,8 @@ ab7a19d2702d232c9c1242fbdf9bd782e195d94104c0278e3b9ce435060a169094525ca53b615b3a
e755072a3c71ada6cde354dd258fae029919e1116048068368d38411ca28a6ad8856702498d6667b0dcbb1d09fcb3fd66669aa79739a5e574a9cd490bd92ce90 335-gccgo-signal-ppc32.patch
de0cc0f9356c9ee5ea7b0f954441b59115f4a8f8f63573d0c17b6537e6f37641cf137531b496fc192d38035c2c4ba8175d36cbd7da15cbfcf8dc18c049c0f111 336-gccgo-mmap64.patch
c2916948b028e1e990e1953875b884561c0f8dd105c1ec03073795df9a47ec2c627cbc95ca0ec98ab9177bf2b7c8458bf3fd09f780fa6c301995846f6317e366 337-gccgo-signal-sig34.patch
+0bdf592ec8444c6e253f1a7626b4e618b2e18e6d0b5a4548f90903f9de80a7cf3ea536750c2743f436a05faa1e7b65e52a391da9732dce51c4b00e23853e5365 338-gccgo-syscall.patch
+b32d496a3a04c2357200b75dbf7f667fb57bf5af4f0c68926bc58f6600e4f23caa48aad2eaf073f1408168cacf27e8f11a6062c65bf5bb67458eedef698871d4 339-gccgo-errstr.patch
1860593584f629d24d5b6db14b0a3412e9f93449b663aaa4981301a0923db0159314905e694f27366fbfef72dce06636ab6df86862b7e9e9564847e03bee82c1 add-classic_table-support.patch
db8c4ab3eae7c01943a61e9e3e20af45d4f6d196184eee5b94068b212900ccdeecaf4fb4145983226954f64e7c989fcd13e0b506176d2b3e781c2e9dc8b5a5a8 disable-multiarch-ppc32.patch
67a75a94fdba69de96b98dbc2978a50cb197857c464b81f7c956176da7066b3be937e40cb15e0870fc1e7382d662c5101bcd18cf457fc4112de41802042b51c4 gcc-5.4.0-locale.patch