summaryrefslogtreecommitdiff
path: root/system/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'system/gcc')
-rw-r--r--system/gcc/0016-invalid-tls-model.patch51
-rw-r--r--system/gcc/338-gccgo-syscall.patch115
-rw-r--r--system/gcc/339-gccgo-errstr.patch45
-rw-r--r--system/gcc/APKBUILD6
4 files changed, 217 insertions, 0 deletions
diff --git a/system/gcc/0016-invalid-tls-model.patch b/system/gcc/0016-invalid-tls-model.patch
new file mode 100644
index 000000000..d3b2b8ea0
--- /dev/null
+++ b/system/gcc/0016-invalid-tls-model.patch
@@ -0,0 +1,51 @@
+--- gcc-7.3.0/libgomp/configure.tgt.orig 2018-09-25 13:44:16.654561098 -0400
++++ gcc-7.3.0/libgomp/configure.tgt 2018-09-25 13:44:50.452688100 -0400
+@@ -10,23 +10,6 @@
+ # XCFLAGS Add extra compile flags to use.
+ # XLDFLAGS Add extra link flags to use.
+
+-# Optimize TLS usage by avoiding the overhead of dynamic allocation.
+-if test $gcc_cv_have_tls = yes ; then
+- case "${target}" in
+-
+- *-*-k*bsd*-gnu*)
+- ;;
+-
+- *-*-linux* | *-*-gnu*)
+- XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
+- ;;
+-
+- *-*-rtems*)
+- XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
+- ;;
+- esac
+-fi
+-
+ # Since we require POSIX threads, assume a POSIX system by default.
+ config_path="posix"
+
+--- gcc-7.3.0/libitm/configure.tgt.orig 2018-09-25 13:47:31.019296903 -0400
++++ gcc-7.3.0/libitm/configure.tgt 2018-09-25 13:47:37.676322335 -0400
+@@ -27,22 +27,6 @@
+ # XCFLAGS Add extra compile flags to use.
+ # XLDFLAGS Add extra link flags to use.
+
+-# Optimize TLS usage by avoiding the overhead of dynamic allocation.
+-if test "$gcc_cv_have_tls" = yes ; then
+- case "${target}" in
+-
+- # For x86, we use slots in the TCB head for most of our TLS.
+- # The setup of those slots in beginTransaction can afford to
+- # use the global-dynamic model.
+- i[456]86-*-linux* | x86_64-*-linux*)
+- ;;
+-
+- *-*-linux*)
+- XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
+- ;;
+- esac
+-fi
+-
+ # Map the target cpu to an ARCH sub-directory. At the same time,
+ # work out any special compilation flags as necessary.
+ case "${target_cpu}" in
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 9132db501..2ab149205 100644
--- a/system/gcc/APKBUILD
+++ b/system/gcc/APKBUILD
@@ -145,6 +145,7 @@ source="https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz
0010-ldbl128-config.patch
0011-m68k.patch
0012-static-pie.patch
+ 0016-invalid-tls-model.patch
002_all_default-relro.patch
005_all_default-as-needed.patch
@@ -173,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
@@ -540,6 +543,7 @@ b8207c1be82b20fdad2596bb0a60469db52257456d0925bacf48b44899f4c6ece93c501347e1ffe9
66085c5555e6b91b6874d1782d5a1dc0ab1792889f9400f48cde9483f82b51b9e3a5de1efbba21a19fc5e664334f2188d0c2bc988d42335efa26118b3c85cc7f 0010-ldbl128-config.patch
cd3ba928121e8578ba9f73215e4d81ee3ebbab33e00b04cdfd62b46d21f9536297ae12dc021aad6e56f3b28d9d544727331bbe6db1e3438d7b9545b2c3250906 0011-m68k.patch
45d5bc11a89e5af77503ca06eec52d6d84e6fea0be021aaee1bcc39f8dd3c7b4baa4200cfa2b0688faa0f207d005db89c029eff32f362207aa3d2365b2f2363e 0012-static-pie.patch
+dfedf48829cff22ee836ece743de20ad467b40e86c8f4034326a4c32df35b10affd69d6b9ab3382df2871a99ad0c2e99d4342183b59f9bca7f15112eed58ec8d 0016-invalid-tls-model.patch
625c02e03c2f1db04da12cc6a086ec85790a031a13df36486243fd9569cd17f7c8ebeec91ac16cc1f87c3ec1ffe4c421153e98a9aeb5eea35943a6f015d81f50 002_all_default-relro.patch
02b725b220e540077efef741e9d457f9e004fe53ae642a138e214875d076a60f7c2f27de0ed9a4225db2030fc9c3d2c5b0414c895b9eec0f5f48fad70e2fb029 005_all_default-as-needed.patch
622fdbcbbf2feb86bd839af627ec3613c6d2c77b14d37d31165b19f73f45b3663a203efff5d224f194edb15eb62d3d5885e32f85d1b584f071e580fea4e12664 011_all_default-warn-format-security.patch
@@ -563,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