Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl
@ 2019-09-07 17:35 voidlinux-github
  2019-09-07 18:18 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 17:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

There is a new pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

[WIP] gcc: update to 9.2.0 and enable gcc-go on musl
Preliminary pull request. Currently building and testing.

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 35130 bytes --]

From a4f0656adc104aa9f79366862a672c955f8e9591 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH] gcc: update to 9.2.0 and enable gcc-go on musl

[ci skip]
---
 srcpkgs/gcc/files/gccgo-musl.patch        | 170 ++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 703 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..87402e14883
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,170 @@
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
  2019-09-07 18:18 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-09-07 18:18 ` voidlinux-github
  2019-09-07 18:19 ` voidlinux-github
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 18:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

[WIP] gcc: update to 9.2.0 and enable gcc-go on musl
Preliminary pull request. Currently building and testing. `gcc-go` for `musl` is now enabled, but only for non-cross systems; cross would need this enabled in the crosstoolchains. We could maybe use this opportunity to also enable Objective-C in the crosstoolchains, or we could leave them as is for now.

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 36225 bytes --]

From cb0a53cf63e547f0d34b01dc069b7f97d2e32502 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH] gcc: update to 9.2.0 and enable gcc-go on musl

[ci skip]
---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..f22c663dbb0
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
@ 2019-09-07 18:18 ` voidlinux-github
  2019-09-07 18:18 ` voidlinux-github
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 18:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

[WIP] gcc: update to 9.2.0 and enable gcc-go on musl
Preliminary pull request. Currently building and testing. `gcc-go` for `musl` is now enabled, but only for non-cross systems; cross would need this enabled in the crosstoolchains. We could maybe use this opportunity to also enable Objective-C in the crosstoolchains, or we could leave them as is for now.

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 36225 bytes --]

From cb0a53cf63e547f0d34b01dc069b7f97d2e32502 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH] gcc: update to 9.2.0 and enable gcc-go on musl

[ci skip]
---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..f22c663dbb0
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
  2019-09-07 18:18 ` [PR PATCH] [Updated] " voidlinux-github
  2019-09-07 18:18 ` voidlinux-github
@ 2019-09-07 18:19 ` voidlinux-github
  2019-09-07 18:19 ` voidlinux-github
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 18:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

[WIP] gcc: update to 9.2.0 and enable gcc-go on musl
Preliminary pull request. Currently building and testing. `gcc-go` for `musl` is now enabled, but only for non-cross systems; cross would need this enabled in the crosstoolchains. We could maybe use this opportunity to also enable Objective-C in the crosstoolchains, or we could leave them as is for now.

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 36230 bytes --]

From 68b0ba2e7d645046bf31543086d76953080198ce Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH] gcc: update to 9.2.0 and enable gcc-go on musl

[ci skip]
---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (2 preceding siblings ...)
  2019-09-07 18:19 ` voidlinux-github
@ 2019-09-07 18:19 ` voidlinux-github
  2019-09-07 18:59 ` voidlinux-github
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 18:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

[WIP] gcc: update to 9.2.0 and enable gcc-go on musl
Preliminary pull request. Currently building and testing. `gcc-go` for `musl` is now enabled, but only for non-cross systems; cross would need this enabled in the crosstoolchains. We could maybe use this opportunity to also enable Objective-C in the crosstoolchains, or we could leave them as is for now.

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 36230 bytes --]

From 68b0ba2e7d645046bf31543086d76953080198ce Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH] gcc: update to 9.2.0 and enable gcc-go on musl

[ci skip]
---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (3 preceding siblings ...)
  2019-09-07 18:19 ` voidlinux-github
@ 2019-09-07 18:59 ` voidlinux-github
  2019-09-07 19:01 ` voidlinux-github
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 18:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/14289#issuecomment-529137181

Comment:
I will need someone to test this on `x86_64`, `x86_64-musl` as well as build-test on 32-bit ARM (i can do it for `aarch64`).

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (4 preceding siblings ...)
  2019-09-07 18:59 ` voidlinux-github
@ 2019-09-07 19:01 ` voidlinux-github
  2019-09-07 23:45 ` voidlinux-github
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 19:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/14289#issuecomment-529137181

Comment:
I will need someone to test this on `x86_64`, `x86_64-musl` as well as build-test on 32-bit ARM (i can do it for `aarch64`). When cross-testing, remove the temporary `nocross`. We will need that for the initial commit (as we'll need to bump the crosstoolchains first before letting them build the cross gcc) but can remove it afterwards. Cross also cannot be tested until we have the crosstoolchains bumped, as host compiler version needs to match the target.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (5 preceding siblings ...)
  2019-09-07 19:01 ` voidlinux-github
@ 2019-09-07 23:45 ` voidlinux-github
  2019-09-07 23:48 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 23:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2532 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/14289#issuecomment-529155630

Comment:
After updating the crosstoolchains for `aarch64` and `aarch64-musl` and then updating the `gcc` template appropriately, I now have `gcc` cross-compiling with the same set of languages as for native builds:

```
-rw-r--r-- 1 q66 q66 32318704 Sep  8 01:44 gcc-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  2181940 Sep  8 01:44 gcc-ada-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  7232260 Sep  8 01:42 gcc-fortran-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  7883712 Sep  8 01:43 gcc-go-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66   703548 Sep  8 01:43 gcc-go-tools-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  7115192 Sep  8 01:43 gcc-objc++-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  6610084 Sep  8 01:42 gcc-objc-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  2768416 Sep  8 01:44 libada-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  1165140 Sep  8 01:44 libada-devel-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66     6748 Sep  8 01:42 libatomic-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66     7084 Sep  8 01:42 libatomic-devel-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66    34372 Sep  8 01:42 libgcc-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66    49120 Sep  8 01:44 libgcc-devel-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66   327256 Sep  8 01:42 libgfortran-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66   365976 Sep  8 01:42 libgfortran-devel-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  4373240 Sep  8 01:43 libgo-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  6361892 Sep  8 01:43 libgo-devel-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66    74104 Sep  8 01:42 libgomp-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66   132220 Sep  8 01:42 libgomp-devel-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66    23952 Sep  8 01:44 libitm-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66   393872 Sep  8 01:44 libitm-devel-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66    34092 Sep  8 01:43 libobjc-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66    37576 Sep  8 01:43 libobjc-devel-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66     5300 Sep  8 01:42 libssp-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66     6308 Sep  8 01:42 libssp-devel-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66   502824 Sep  8 01:44 libstdc++-9.2.0_1.aarch64-musl.xbps
-rw-r--r-- 1 q66 q66  1663724 Sep  8 01:44 libstdc++-devel-9.2.0_1.aarch64-musl.xbps
```

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (7 preceding siblings ...)
  2019-09-07 23:48 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-09-07 23:48 ` voidlinux-github
  2019-09-07 23:52 ` voidlinux-github
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 23:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 879 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl
Preliminary pull request. Currently building and testing. `gcc-go` for `musl` is now enabled, but only for non-cross systems; cross would need this enabled in the crosstoolchains. We could maybe use this opportunity to also enable Objective-C in the crosstoolchains, or we could leave them as is for now.

Testing:

- [ ] update cross-toolchains
- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 47429 bytes --]

From 36e3c2d553a01e82321ff1f98280f9c215d3b425 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 1/4] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From 09b94435ec98a3196e9efc644093c78c630e1d1a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 2/4] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a84ce8904ec556eb026a0d7a204f32e9cec551ce Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 3/4] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 945de6776fbf945eea7e3a2ad0f54cab3d7e9d0b Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 4/4] gcc: reenable on cross and enable go/objc(++) for cross
 targets

---
 srcpkgs/gcc/template | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..3a41c21e1b8 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,6 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,13 +67,11 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-		# we need this for gcc-go on musl
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			makedepends+=" libucontext-devel"
-		fi
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+	# we need this for gcc-go on musl
+	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+		makedepends+=" libucontext-devel"
 	fi
 fi
 
@@ -129,7 +126,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -219,11 +215,13 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,go,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (6 preceding siblings ...)
  2019-09-07 23:45 ` voidlinux-github
@ 2019-09-07 23:48 ` voidlinux-github
  2019-09-07 23:48 ` voidlinux-github
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 23:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 879 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl
Preliminary pull request. Currently building and testing. `gcc-go` for `musl` is now enabled, but only for non-cross systems; cross would need this enabled in the crosstoolchains. We could maybe use this opportunity to also enable Objective-C in the crosstoolchains, or we could leave them as is for now.

Testing:

- [ ] update cross-toolchains
- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 47429 bytes --]

From 36e3c2d553a01e82321ff1f98280f9c215d3b425 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 1/4] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From 09b94435ec98a3196e9efc644093c78c630e1d1a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 2/4] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a84ce8904ec556eb026a0d7a204f32e9cec551ce Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 3/4] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 945de6776fbf945eea7e3a2ad0f54cab3d7e9d0b Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 4/4] gcc: reenable on cross and enable go/objc(++) for cross
 targets

---
 srcpkgs/gcc/template | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..3a41c21e1b8 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,6 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,13 +67,11 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-		# we need this for gcc-go on musl
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			makedepends+=" libucontext-devel"
-		fi
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+	# we need this for gcc-go on musl
+	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+		makedepends+=" libucontext-devel"
 	fi
 fi
 
@@ -129,7 +126,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -219,11 +215,13 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,go,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (8 preceding siblings ...)
  2019-09-07 23:48 ` voidlinux-github
@ 2019-09-07 23:52 ` voidlinux-github
  2019-09-07 23:52 ` voidlinux-github
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 23:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl
Preliminary pull request. Currently building and testing. `gcc-go` for `musl` is now enabled, but only for non-cross systems; cross would need this enabled in the crosstoolchains. We could maybe use this opportunity to also enable Objective-C in the crosstoolchains, or we could leave them as is for now.

Crosstoolchains updates:

- [x] aarch64
- [x] aarch64-musl
- [ ] armv5tel
- [ ] armv5tel-musl
- [ ] armv6l
- [ ] armv6l-musl
- [ ] armv7l
- [ ] armv7l-musl
- [ ] i686
- [ ] i686-musl
- [ ] mips
- [ ] mips-musl
- [ ] mipsel
- [ ] mipsel-musl
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64-musl

Testing:

- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 47439 bytes --]

From 36e3c2d553a01e82321ff1f98280f9c215d3b425 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 1/4] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From 09b94435ec98a3196e9efc644093c78c630e1d1a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 2/4] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a84ce8904ec556eb026a0d7a204f32e9cec551ce Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 3/4] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From b10589c0604ad21247741668006bb435011b6a2b Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 4/4] gcc: reenable on cross and enable go/objc(++) for cross
 targets

[ci skip]
---
 srcpkgs/gcc/template | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..3a41c21e1b8 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,6 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,13 +67,11 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-		# we need this for gcc-go on musl
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			makedepends+=" libucontext-devel"
-		fi
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+	# we need this for gcc-go on musl
+	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+		makedepends+=" libucontext-devel"
 	fi
 fi
 
@@ -129,7 +126,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -219,11 +215,13 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,go,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (9 preceding siblings ...)
  2019-09-07 23:52 ` voidlinux-github
@ 2019-09-07 23:52 ` voidlinux-github
  2019-09-08  1:20 ` [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets voidlinux-github
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-07 23:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl
Preliminary pull request. Currently building and testing. `gcc-go` for `musl` is now enabled, but only for non-cross systems; cross would need this enabled in the crosstoolchains. We could maybe use this opportunity to also enable Objective-C in the crosstoolchains, or we could leave them as is for now.

Crosstoolchains updates:

- [x] aarch64
- [x] aarch64-musl
- [ ] armv5tel
- [ ] armv5tel-musl
- [ ] armv6l
- [ ] armv6l-musl
- [ ] armv7l
- [ ] armv7l-musl
- [ ] i686
- [ ] i686-musl
- [ ] mips
- [ ] mips-musl
- [ ] mipsel
- [ ] mipsel-musl
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64-musl

Testing:

- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 47439 bytes --]

From 36e3c2d553a01e82321ff1f98280f9c215d3b425 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 1/4] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From 09b94435ec98a3196e9efc644093c78c630e1d1a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 2/4] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a84ce8904ec556eb026a0d7a204f32e9cec551ce Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 3/4] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From b10589c0604ad21247741668006bb435011b6a2b Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 4/4] gcc: reenable on cross and enable go/objc(++) for cross
 targets

[ci skip]
---
 srcpkgs/gcc/template | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..3a41c21e1b8 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,6 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,13 +67,11 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-		# we need this for gcc-go on musl
-		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
-			makedepends+=" libucontext-devel"
-		fi
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+	# we need this for gcc-go on musl
+	if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+		makedepends+=" libucontext-devel"
 	fi
 fi
 
@@ -129,7 +126,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -219,11 +215,13 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,go,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (10 preceding siblings ...)
  2019-09-07 23:52 ` voidlinux-github
@ 2019-09-08  1:20 ` voidlinux-github
  2019-09-08  1:20 ` voidlinux-github
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08  1:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
This updates `gcc` to 9.2.0 and while doing that, enables `gcc-go` on `musl`. It also enables `go`, `objc` and `objc++` support in crosstoolchains, allowing us to also enable them for cross targets.

Crosstoolchains updates:

- [x] aarch64
- [x] aarch64-musl
- [ ] armv5tel
- [ ] armv5tel-musl
- [ ] armv6l
- [ ] armv6l-musl
- [ ] armv7l
- [ ] armv7l-musl
- [ ] i686
- [ ] i686-musl
- [ ] mips-musl
- [ ] mipshf-musl
- [ ] mipsel-musl
- [ ] mipselhf-musl
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64-musl

Testing:

- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 106427 bytes --]

From 13446a506f0a2462a5698bede7b1da6c33f41259 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 01/16] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From bcf0fb67064263e3c85d70ddf453d7414e03c18f Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 02/16] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From d5afad259bbf0b296d512e8e7167bc1b00ee8572 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 03/16] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ff93eb00b4f5caf49c6778fec3cd1a2870599031 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:27:36 +0200
Subject: [PATCH 04/16] cross-x86_64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-x86_64-linux-musl/template      | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 2f6a2a4241d..349eacf973c 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-x86_64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=x86_64-linux-musl
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 archs="i686* x86_64 ppc64le"
 short_desc="Cross toolchain for x86_64 with musl"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,10 +86,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
 	sed -i 's/lib64/lib/' gcc/config/i386/linux64.h
@@ -158,6 +161,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86_64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -171,7 +190,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -213,6 +232,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -264,6 +284,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ccd0fcf577b6f23f904bc56f26057bc42cf768df Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:33:03 +0200
Subject: [PATCH 05/16] cross-powerpc64le-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-musl/template | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 7e75d7b1c5c..0de402db9c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64le-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64le with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +164,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +195,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
@@ -219,6 +238,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +290,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 8db9605e0ce1b659d8dba8e8ef3a3390e8da3825 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:36:30 +0200
Subject: [PATCH 06/16] cross-powerpc64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-musl/template   | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index d3a9a758fe9..559dac88f36 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64 with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +164,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +195,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpc-linux"
@@ -219,6 +238,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +290,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From fd12fa492cca12881e119210b75ba4f40b45de6d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:40:18 +0200
Subject: [PATCH 07/16] cross-powerpc-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-musl/template     | 63 +++++++++++++------
 3 files changed, 44 insertions(+), 21 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index 856e8fb0885..9d61d406ace 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,9 +1,9 @@
-# Template build file for 'cross-powerpc-linux-musl'
-#
+# Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=powerpc-linux-musl
 _fpuflags=
@@ -11,8 +11,8 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 
 short_desc="Cross toolchain for PowerPC (musl)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -21,13 +21,14 @@ license="GPL-3.0-or-later, GPL-2.0-only, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
- http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz"
-checksum="
- 0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
+checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
- 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa"
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -36,7 +37,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="i686* x86_64* ppc64*"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -86,13 +87,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -166,6 +167,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -181,7 +198,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-default-pie"
@@ -226,6 +243,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -268,15 +286,20 @@ do_install() {
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc.so.1
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc-sf.so.1
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 7db522d82fa730bd8530771d4f25ae2b8f5ad191 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:44:26 +0200
Subject: [PATCH 08/16] cross-arm-linux-musleabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabi/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index f1434fe9b26..985af935aac 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabi
 _fpuflags="--with-arch=armv5te --without-fp --with-float=soft"
@@ -11,8 +12,8 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv5 TE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -169,7 +188,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -211,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -261,6 +281,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From fd91ca767b9baa312f7fff4de71cc1818591d692 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:46:45 +0200
Subject: [PATCH 09/16] cross-arm-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabihf/template   | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 6b9194ebc65..a5b5fc028c7 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabihf
 _fpuflags="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv6 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -210,6 +229,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -260,6 +280,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 30d29b026144e09ec74bdcd3dff9fb620487accf Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:49:32 +0200
Subject: [PATCH 10/16] cross-armv7l-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 .../cross-armv7l-linux-musleabihf/template    | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 37daba36ac9..5704eb067a9 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-armv7l-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=armv7l-linux-musleabihf
 _fpuflags="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv7 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -156,6 +159,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -170,7 +189,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -212,6 +231,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -262,6 +282,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 246def05c0710913fa93a473eec8364042e3836f Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:53:27 +0200
Subject: [PATCH 11/16] cross-i686-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-linux-musl/template        | 47 +++++++++++++++----
 4 files changed, 38 insertions(+), 12 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/bug90756.patch
 create mode 120000 srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch b/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch b/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 905bacb0e27..25d8042180a 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-i686-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=i686-linux-musl
 _sysroot="/usr/${_triplet}"
 _archflags="-march=i686"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=4
+version=0.32
+revision=1
 short_desc="Cross toolchain for i686 target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,12 +86,11 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +157,25 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	sed -i arch/x86/startcontext.S -e \
+	 "s;__i686.get_pc_thunk.bx;i686_get_pc_thunk_bx;g"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +189,7 @@ _gcc_build() {
 	_args="--target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --prefix=/usr"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
@@ -209,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -266,6 +288,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 3bd2fe566a8b202e2a46e2cce9778662050edbcb Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:58:40 +0200
Subject: [PATCH 12/16] cross-mips-linux-musl: update for gcc-9.2.0 + objc(++)

---
 .../cross-mips-linux-musl/files/non-nullness.patch |  1 -
 srcpkgs/cross-mips-linux-musl/template             | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index a129e937dbf..213d288cafc 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 85aa95ee1bfd9a2fae521566987903b30b223c72 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:08:52 +0200
Subject: [PATCH 13/16] cross-mips-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mips-linux-muslhf/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index 5ad364ecf40..84892aa48ba 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE hardfloat target (musl)"
 maintainer="hipperson0 <hipperson0@gmail.com>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From dc16aef453181323f6ff73d13d2114ad1004063e Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:15:29 +0200
Subject: [PATCH 14/16] cross-mipsel-linux-musl: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-musl/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1621d1005d5..20cbe0fed03 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 38865a58a7b9cf87a50f8d3d8b1267b6452c6d3e Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:17:20 +0200
Subject: [PATCH 15/16] cross-mipsel-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-muslhf/template         | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 3f02ba22d27..d2a692b48fe 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE hardfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From f18cc06ece778176c2d59898024f415cec20bb4f Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 16/16] gcc: reenable on cross and enable go/objc(++) for cross
 targets

Except mips*-musl, as it doesn't have libucontext support yet.

[ci skip]
---
 srcpkgs/gcc/template | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..d8cae082a4f 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,13 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
+
+_have_gccgo=yes
+
+# MIPS does not have libucontext yet
+case "$XBPS_TARGET_MACHINE" in
+	mips*-musl) _have_gccgo=no ;;
+esac
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,8 +74,8 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	if [ "$_have_gccgo" = "yes" ]; then
 		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
 		# we need this for gcc-go on musl
 		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
@@ -129,7 +135,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -162,6 +167,9 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
+		mips*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			;;
 		*-musl)
 			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
 			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
@@ -219,20 +227,26 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,go,fortran,lto"
+		_langs="c,c++,objc,obj-c++,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi
 
+	if [ "$_have_gccgo" = "yes" ]; then
+		_langs+=",go"
+	fi
+
 	case "$XBPS_TARGET_MACHINE" in
 		*-musl) _args+=" --disable-libsanitizer";;
 	esac

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (11 preceding siblings ...)
  2019-09-08  1:20 ` [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets voidlinux-github
@ 2019-09-08  1:20 ` voidlinux-github
  2019-09-08  1:56 ` voidlinux-github
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08  1:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
This updates `gcc` to 9.2.0 and while doing that, enables `gcc-go` on `musl`. It also enables `go`, `objc` and `objc++` support in crosstoolchains, allowing us to also enable them for cross targets.

Crosstoolchains updates:

- [x] aarch64
- [x] aarch64-musl
- [ ] armv5tel
- [ ] armv5tel-musl
- [ ] armv6l
- [ ] armv6l-musl
- [ ] armv7l
- [ ] armv7l-musl
- [ ] i686
- [ ] i686-musl
- [ ] mips-musl
- [ ] mipshf-musl
- [ ] mipsel-musl
- [ ] mipselhf-musl
- [ ] ppc64le
- [ ] ppc64le-musl
- [ ] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64-musl

Testing:

- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [ ] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 106427 bytes --]

From 13446a506f0a2462a5698bede7b1da6c33f41259 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 01/16] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From bcf0fb67064263e3c85d70ddf453d7414e03c18f Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 02/16] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From d5afad259bbf0b296d512e8e7167bc1b00ee8572 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 03/16] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ff93eb00b4f5caf49c6778fec3cd1a2870599031 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:27:36 +0200
Subject: [PATCH 04/16] cross-x86_64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-x86_64-linux-musl/template      | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 2f6a2a4241d..349eacf973c 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-x86_64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=x86_64-linux-musl
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 archs="i686* x86_64 ppc64le"
 short_desc="Cross toolchain for x86_64 with musl"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,10 +86,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
 	sed -i 's/lib64/lib/' gcc/config/i386/linux64.h
@@ -158,6 +161,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86_64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -171,7 +190,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -213,6 +232,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -264,6 +284,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ccd0fcf577b6f23f904bc56f26057bc42cf768df Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:33:03 +0200
Subject: [PATCH 05/16] cross-powerpc64le-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-musl/template | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 7e75d7b1c5c..0de402db9c0 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64le-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64le with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +164,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +195,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
@@ -219,6 +238,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +290,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 8db9605e0ce1b659d8dba8e8ef3a3390e8da3825 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:36:30 +0200
Subject: [PATCH 06/16] cross-powerpc64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-musl/template   | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index d3a9a758fe9..559dac88f36 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64 with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +164,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +195,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpc-linux"
@@ -219,6 +238,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +290,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From fd12fa492cca12881e119210b75ba4f40b45de6d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:40:18 +0200
Subject: [PATCH 07/16] cross-powerpc-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-musl/template     | 63 +++++++++++++------
 3 files changed, 44 insertions(+), 21 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index 856e8fb0885..9d61d406ace 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,9 +1,9 @@
-# Template build file for 'cross-powerpc-linux-musl'
-#
+# Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=powerpc-linux-musl
 _fpuflags=
@@ -11,8 +11,8 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 
 short_desc="Cross toolchain for PowerPC (musl)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -21,13 +21,14 @@ license="GPL-3.0-or-later, GPL-2.0-only, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
- http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz"
-checksum="
- 0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
+checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
- 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa"
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -36,7 +37,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="i686* x86_64* ppc64*"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -86,13 +87,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -166,6 +167,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -181,7 +198,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-default-pie"
@@ -226,6 +243,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -268,15 +286,20 @@ do_install() {
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc.so.1
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc-sf.so.1
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 7db522d82fa730bd8530771d4f25ae2b8f5ad191 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:44:26 +0200
Subject: [PATCH 08/16] cross-arm-linux-musleabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabi/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index f1434fe9b26..985af935aac 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabi
 _fpuflags="--with-arch=armv5te --without-fp --with-float=soft"
@@ -11,8 +12,8 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv5 TE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -169,7 +188,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -211,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -261,6 +281,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From fd91ca767b9baa312f7fff4de71cc1818591d692 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:46:45 +0200
Subject: [PATCH 09/16] cross-arm-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabihf/template   | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 6b9194ebc65..a5b5fc028c7 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabihf
 _fpuflags="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv6 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -210,6 +229,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -260,6 +280,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 30d29b026144e09ec74bdcd3dff9fb620487accf Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:49:32 +0200
Subject: [PATCH 10/16] cross-armv7l-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 .../cross-armv7l-linux-musleabihf/template    | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 37daba36ac9..5704eb067a9 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-armv7l-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=armv7l-linux-musleabihf
 _fpuflags="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv7 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -156,6 +159,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -170,7 +189,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -212,6 +231,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -262,6 +282,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 246def05c0710913fa93a473eec8364042e3836f Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:53:27 +0200
Subject: [PATCH 11/16] cross-i686-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-linux-musl/template        | 47 +++++++++++++++----
 4 files changed, 38 insertions(+), 12 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/bug90756.patch
 create mode 120000 srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch b/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch b/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 905bacb0e27..25d8042180a 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-i686-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=i686-linux-musl
 _sysroot="/usr/${_triplet}"
 _archflags="-march=i686"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=4
+version=0.32
+revision=1
 short_desc="Cross toolchain for i686 target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,12 +86,11 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +157,25 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	sed -i arch/x86/startcontext.S -e \
+	 "s;__i686.get_pc_thunk.bx;i686_get_pc_thunk_bx;g"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +189,7 @@ _gcc_build() {
 	_args="--target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --prefix=/usr"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
@@ -209,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -266,6 +288,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 3bd2fe566a8b202e2a46e2cce9778662050edbcb Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:58:40 +0200
Subject: [PATCH 12/16] cross-mips-linux-musl: update for gcc-9.2.0 + objc(++)

---
 .../cross-mips-linux-musl/files/non-nullness.patch |  1 -
 srcpkgs/cross-mips-linux-musl/template             | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index a129e937dbf..213d288cafc 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 85aa95ee1bfd9a2fae521566987903b30b223c72 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:08:52 +0200
Subject: [PATCH 13/16] cross-mips-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mips-linux-muslhf/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index 5ad364ecf40..84892aa48ba 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE hardfloat target (musl)"
 maintainer="hipperson0 <hipperson0@gmail.com>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From dc16aef453181323f6ff73d13d2114ad1004063e Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:15:29 +0200
Subject: [PATCH 14/16] cross-mipsel-linux-musl: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-musl/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1621d1005d5..20cbe0fed03 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 38865a58a7b9cf87a50f8d3d8b1267b6452c6d3e Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:17:20 +0200
Subject: [PATCH 15/16] cross-mipsel-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-muslhf/template         | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 3f02ba22d27..d2a692b48fe 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE hardfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From f18cc06ece778176c2d59898024f415cec20bb4f Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 16/16] gcc: reenable on cross and enable go/objc(++) for cross
 targets

Except mips*-musl, as it doesn't have libucontext support yet.

[ci skip]
---
 srcpkgs/gcc/template | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..d8cae082a4f 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,13 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
+
+_have_gccgo=yes
+
+# MIPS does not have libucontext yet
+case "$XBPS_TARGET_MACHINE" in
+	mips*-musl) _have_gccgo=no ;;
+esac
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,8 +74,8 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	if [ "$_have_gccgo" = "yes" ]; then
 		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
 		# we need this for gcc-go on musl
 		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
@@ -129,7 +135,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -162,6 +167,9 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
+		mips*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			;;
 		*-musl)
 			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
 			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
@@ -219,20 +227,26 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,go,fortran,lto"
+		_langs="c,c++,objc,obj-c++,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi
 
+	if [ "$_have_gccgo" = "yes" ]; then
+		_langs+=",go"
+	fi
+
 	case "$XBPS_TARGET_MACHINE" in
 		*-musl) _args+=" --disable-libsanitizer";;
 	esac

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (13 preceding siblings ...)
  2019-09-08  1:56 ` voidlinux-github
@ 2019-09-08  1:56 ` voidlinux-github
  2019-09-08  2:27 ` voidlinux-github
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08  1:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
This updates `gcc` to 9.2.0 and while doing that, enables `gcc-go` on `musl`. It also enables `go`, `objc` and `objc++` support in crosstoolchains, allowing us to also enable them for cross targets.

The only exception is MIPS, which is only newly getting `objc` and `objc++`. That is because `libucontext` does not have a MIPS implementation yet, so we can't enable `gcc-go` on `mips*-musl`.

Crosstoolchains updates:

- [x] aarch64
- [x] aarch64-musl
- [ ] armv5tel
- [x] armv5tel-musl
- [ ] armv6l
- [x] armv6l-musl
- [ ] armv7l
- [x] armv7l-musl
- [ ] i686
- [x] i686-musl
- [x] mips-musl
- [x] mipshf-musl
- [x] mipsel-musl
- [x] mipselhf-musl
- [ ] ppc64le
- [x] ppc64le-musl
- [ ] ppc64
- [x] ppc64-musl
- [ ] ppc
- [x] ppc-musl
- [x] x86_64-musl

Testing:

- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [x] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 139113 bytes --]

From 0b7506f12526cf5c44ae26f6e21f127db9f12acb Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 01/25] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From f4a95f4a278f64c80b9e7d877884c5a456d42bf9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 02/25] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ee8bbf9acaff06515c7a0c38974b8777e895c42d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 03/25] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 57ba6b18eed6e7445270ae2b9d67b98358ef4726 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:27:36 +0200
Subject: [PATCH 04/25] cross-x86_64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-x86_64-linux-musl/template      | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 2f6a2a4241d..349eacf973c 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-x86_64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=x86_64-linux-musl
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 archs="i686* x86_64 ppc64le"
 short_desc="Cross toolchain for x86_64 with musl"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,10 +86,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
 	sed -i 's/lib64/lib/' gcc/config/i386/linux64.h
@@ -158,6 +161,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86_64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -171,7 +190,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -213,6 +232,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -264,6 +284,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a852d18f0a3144844fc16122749fe9898583e90a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:33:03 +0200
Subject: [PATCH 05/25] cross-powerpc64le-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-musl/template | 44 +++++++++++++++----
 4 files changed, 37 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 7e75d7b1c5c..475f2f725ca 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64le-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64le with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,14 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +165,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +196,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
@@ -219,6 +239,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +291,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 62adb1e3cb4fc560d66c37c17130b4071d0726c1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:36:30 +0200
Subject: [PATCH 06/25] cross-powerpc64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-musl/template   | 44 +++++++++++++++----
 4 files changed, 37 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch b/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index d3a9a758fe9..ea2800df634 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64 with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,14 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +165,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +196,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpc-linux"
@@ -219,6 +239,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +291,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ff81242ebdaaf5271929e9cd1f712074989aab58 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:40:18 +0200
Subject: [PATCH 07/25] cross-powerpc-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-musl/template     | 63 +++++++++++++------
 3 files changed, 44 insertions(+), 21 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index 856e8fb0885..9d61d406ace 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,9 +1,9 @@
-# Template build file for 'cross-powerpc-linux-musl'
-#
+# Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=powerpc-linux-musl
 _fpuflags=
@@ -11,8 +11,8 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 
 short_desc="Cross toolchain for PowerPC (musl)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -21,13 +21,14 @@ license="GPL-3.0-or-later, GPL-2.0-only, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
- http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz"
-checksum="
- 0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
+checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
- 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa"
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -36,7 +37,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="i686* x86_64* ppc64*"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -86,13 +87,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -166,6 +167,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -181,7 +198,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-default-pie"
@@ -226,6 +243,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -268,15 +286,20 @@ do_install() {
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc.so.1
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc-sf.so.1
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 7617221f04a76008a1dac4a2b26e7db46361b40a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:44:26 +0200
Subject: [PATCH 08/25] cross-arm-linux-musleabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabi/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index f1434fe9b26..985af935aac 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabi
 _fpuflags="--with-arch=armv5te --without-fp --with-float=soft"
@@ -11,8 +12,8 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv5 TE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -169,7 +188,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -211,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -261,6 +281,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 9a88f06468900106b22fa394f523985110a3d9d5 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:46:45 +0200
Subject: [PATCH 09/25] cross-arm-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabihf/template   | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 6b9194ebc65..a5b5fc028c7 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabihf
 _fpuflags="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv6 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -210,6 +229,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -260,6 +280,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 942adf56fa65937a796db207d3272515812c05f1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:49:32 +0200
Subject: [PATCH 10/25] cross-armv7l-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 .../cross-armv7l-linux-musleabihf/template    | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 37daba36ac9..5704eb067a9 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-armv7l-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=armv7l-linux-musleabihf
 _fpuflags="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv7 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -156,6 +159,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -170,7 +189,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -212,6 +231,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -262,6 +282,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a2aa6268834894cb2323ad92a55fabd0433bb4d0 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:53:27 +0200
Subject: [PATCH 11/25] cross-i686-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-linux-musl/template        | 47 +++++++++++++++----
 4 files changed, 38 insertions(+), 12 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/bug90756.patch
 create mode 120000 srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch b/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch b/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 905bacb0e27..25d8042180a 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-i686-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=i686-linux-musl
 _sysroot="/usr/${_triplet}"
 _archflags="-march=i686"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=4
+version=0.32
+revision=1
 short_desc="Cross toolchain for i686 target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,12 +86,11 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +157,25 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	sed -i arch/x86/startcontext.S -e \
+	 "s;__i686.get_pc_thunk.bx;i686_get_pc_thunk_bx;g"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +189,7 @@ _gcc_build() {
 	_args="--target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --prefix=/usr"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
@@ -209,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -266,6 +288,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 2b663cf412958fb8f536c8d6a9ba762429697363 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:58:40 +0200
Subject: [PATCH 12/25] cross-mips-linux-musl: update for gcc-9.2.0 + objc(++)

---
 .../cross-mips-linux-musl/files/non-nullness.patch |  1 -
 srcpkgs/cross-mips-linux-musl/template             | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index a129e937dbf..213d288cafc 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From b73ddebe655c8a20869533295c01dee57e996c06 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:08:52 +0200
Subject: [PATCH 13/25] cross-mips-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mips-linux-muslhf/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index 5ad364ecf40..84892aa48ba 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE hardfloat target (musl)"
 maintainer="hipperson0 <hipperson0@gmail.com>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 758e50bfd80b1eb82a3a4aea7e5e1a1c22ae64de Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:15:29 +0200
Subject: [PATCH 14/25] cross-mipsel-linux-musl: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-musl/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1621d1005d5..20cbe0fed03 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From e695439186bb09ce530f92abb348fb2b20f63e69 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:17:20 +0200
Subject: [PATCH 15/25] cross-mipsel-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-muslhf/template         | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 3f02ba22d27..d2a692b48fe 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE hardfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 0ac8266f483e3be1f9ffca9cb1453a8a44c11db9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:29:56 +0200
Subject: [PATCH 16/25] cross-powerpc64le-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-gnu/template  | 21 ++++++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch b/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 485f6bfe397..30bde74b769 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,14 +1,14 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet="powerpc64le-linux-gnu"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU cross toolchain for the ${_triplet} targets (binutils/gcc/glibc)"
 maintainer="q66 <daniel@octaforge.org>"
@@ -20,8 +20,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -29,7 +29,7 @@ nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,7 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
@@ -241,7 +241,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
 	_args+=" --with-gnu-as"
@@ -338,6 +338,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 317088c13756361c7d6a31b38fdd72223aec3e1d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:32:21 +0200
Subject: [PATCH 17/25] cross-powerpc64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-gnu/template    | 21 ++++++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch b/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 51973934ea6..9788de4ffc1 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,14 +1,14 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet="powerpc64-linux-gnu"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU cross toolchain for the ${_triplet} targets (binutils/gcc/glibc)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -20,8 +20,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -29,7 +29,7 @@ nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,7 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
@@ -241,7 +241,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
 	_args+=" --with-gnu-as"
@@ -338,6 +338,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From d9b03a3b995805a9646b1aedc8861c1099306e62 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:38:58 +0200
Subject: [PATCH 18/25] cross-powerpc-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-gnu/template      | 40 ++++++++++---------
 2 files changed, 21 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index d599721bad6..c36b8c1c307 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,8 +1,7 @@
-# Template build file for 'cross-powerpc-linux-gnu'
-#
+# Template file for 'cross-powerpc-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=powerpc-linux-gnu
@@ -10,7 +9,7 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} target (binutils/gcc/glibc)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -22,15 +21,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -95,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -236,7 +234,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -252,7 +250,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -328,14 +325,19 @@ do_install() {
 	cd ${wrksrc}/glibc-build
 	make install_root=${DESTDIR}/${_sysroot} install install-headers
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
-        rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
+	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
+
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
 
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a

From 53fbe184a8e70c0a9bb8178dae38f89b2e2ff3a6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:40:23 +0200
Subject: [PATCH 19/25] cross-i686-pc-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-pc-linux-gnu/template      | 24 ++++++++++---------
 3 files changed, 13 insertions(+), 13 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
 delete mode 120000 srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch b/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 34dc2a3827e..c5b0e414cae 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-i686-pc-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=i686-pc-linux-gnu
@@ -10,8 +10,8 @@ _archflags="-march=i686 -mtune=generic"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=2
+version=0.32
+revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -22,8 +22,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 archs="armv6l armv7l x86_64"
@@ -32,7 +32,7 @@ nopie=yes
 nodebug=yes
 lib32disabled=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -81,9 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -235,7 +233,7 @@ _gcc_build() {
 	_args+=" --prefix=/usr"
 	_args+=" --libdir=/usr/lib"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -252,7 +250,6 @@ _gcc_build() {
 	_args+=" --enable-default-ssp"
 	_args+=" --enable-gnu-indirect-function"
 	_args+=" --enable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -338,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From f693975534b81ec98d829f0ca1e53837cdb9a561 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:42:23 +0200
Subject: [PATCH 20/25] cross-arm-linux-gnueabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-gnueabi/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index 53b16264218..99b23a88538 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-arm-linux-gnueabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=arm-linux-gnueabi
@@ -11,7 +11,7 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -97,7 +97,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -238,7 +237,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -255,7 +254,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -337,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 229aea4fc588ded950880719578ede2b7a50ebe1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:44:02 +0200
Subject: [PATCH 21/25] cross-arm-linux-gnueabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-gnueabihf/template    | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index 32006480282..85a724d3c87 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-arm-linux-gnueabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=arm-linux-gnueabihf
@@ -11,7 +11,7 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -98,7 +98,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -238,7 +237,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -255,7 +254,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -337,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 8d89413b2fad6d95dc25fc0e3abd4fc32e1418b6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:46:29 +0200
Subject: [PATCH 22/25] cross-armv7l-linux-gnueabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 23864834772..bb60304d610 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-armv7l-linux-gnueabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=armv7l-linux-gnueabihf
@@ -11,7 +11,7 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  http://ftp.gnu.org/gnu/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -98,7 +98,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -239,7 +238,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -256,7 +255,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -338,6 +336,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 01836066b5abb28d1de1490936a54fa30c85cbbc Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:52:10 +0200
Subject: [PATCH 23/25] cross-vpkg-dummy: update to 0.32

---
 srcpkgs/cross-vpkg-dummy/template | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d763d7f14c4..6d29b14f73a 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,7 +1,7 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.31
-revision=2
+version=0.32
+revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,9 +20,16 @@ provides="
 	libstdc++-devel-9999_1
 	libgfortran-9999_1
 	libgfortran-devel-9999_1
+	libgo-9999_1
+	libgo-devel-9999_1
+	libobjc-9999_1
+	libobjc-devel-9999_1
 	gcc-9999_1
 	gcc-fortran-9999_1
-	gcc-ada-9999_1"
+	gcc-ada-9999_1
+	gcc-go-9999_1
+	gcc-objc-9999_1
+	gcc-objc++-9999_1"
 conflicts="
 	kernel-libc-headers>=0
 	binutils>=0
@@ -33,9 +40,16 @@ conflicts="
 	libstdc++-devel>=0
 	libgfortran>=0
 	libgfortran-devel>=0
+	libgo>=0
+	libgo-devel>=0
+	libobjc>=0
+	libobjc-devel>=0
 	gcc>=0
 	gcc-fortran>=0
-	gcc-ada>=0"
+	gcc-ada>=0
+	gcc-go>=0
+	gcc-objc>=0
+	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
 	libgnat-9.so

From d0dad1aafbf3db2c5a0666a20eb254608ddec5f0 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 24/25] gcc: reenable on cross and enable go/objc(++) for cross
 targets

Except mips*-musl, as it doesn't have libucontext support yet.

[ci skip]
---
 srcpkgs/gcc/template | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..d8cae082a4f 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,13 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
+
+_have_gccgo=yes
+
+# MIPS does not have libucontext yet
+case "$XBPS_TARGET_MACHINE" in
+	mips*-musl) _have_gccgo=no ;;
+esac
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,8 +74,8 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	if [ "$_have_gccgo" = "yes" ]; then
 		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
 		# we need this for gcc-go on musl
 		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
@@ -129,7 +135,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -162,6 +167,9 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
+		mips*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			;;
 		*-musl)
 			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
 			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
@@ -219,20 +227,26 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,go,fortran,lto"
+		_langs="c,c++,objc,obj-c++,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi
 
+	if [ "$_have_gccgo" = "yes" ]; then
+		_langs+=",go"
+	fi
+
 	case "$XBPS_TARGET_MACHINE" in
 		*-musl) _args+=" --disable-libsanitizer";;
 	esac

From 025aaf72fcf0b7c589bc189018038ed07c9ec5f1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:54:41 +0200
Subject: [PATCH 25/25] cross-x86_64-w64-mingw32: update for gcc-9.2.0

[ci skip]
---
 srcpkgs/cross-x86_64-w64-mingw32/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-x86_64-w64-mingw32/template b/srcpkgs/cross-x86_64-w64-mingw32/template
index 2e5bc454ba8..ccc30402e15 100644
--- a/srcpkgs/cross-x86_64-w64-mingw32/template
+++ b/srcpkgs/cross-x86_64-w64-mingw32/template
@@ -1,5 +1,5 @@
 # Template file for 'cross-x86_64-w64-mingw32'
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _binutils_version=2.32
 _gmp_version=6.1.2
 _mpfr_version=4.0.1
@@ -9,7 +9,7 @@ _mingw_version=6.0.0
 
 pkgname=cross-x86_64-w64-mingw32
 version=$_mingw_version
-revision=2
+revision=3
 archs="x86_64* i686*"
 create_wrksrc=yes
 hostmakedepends="flex perl python3"
@@ -31,7 +31,7 @@ distfiles="
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2
  ${SOURCEFORGE_SITE}/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${_mingw_version}.tar.bz2"
 checksum="de38b15c902eb2725eac6af21183a5f34ea4634cb0bcef19612b50e5ed31072d
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
  67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (12 preceding siblings ...)
  2019-09-08  1:20 ` voidlinux-github
@ 2019-09-08  1:56 ` voidlinux-github
  2019-09-08  1:56 ` voidlinux-github
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08  1:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
This updates `gcc` to 9.2.0 and while doing that, enables `gcc-go` on `musl`. It also enables `go`, `objc` and `objc++` support in crosstoolchains, allowing us to also enable them for cross targets.

The only exception is MIPS, which is only newly getting `objc` and `objc++`. That is because `libucontext` does not have a MIPS implementation yet, so we can't enable `gcc-go` on `mips*-musl`.

Crosstoolchains updates:

- [x] aarch64
- [x] aarch64-musl
- [ ] armv5tel
- [x] armv5tel-musl
- [ ] armv6l
- [x] armv6l-musl
- [ ] armv7l
- [x] armv7l-musl
- [ ] i686
- [x] i686-musl
- [x] mips-musl
- [x] mipshf-musl
- [x] mipsel-musl
- [x] mipselhf-musl
- [ ] ppc64le
- [x] ppc64le-musl
- [ ] ppc64
- [x] ppc64-musl
- [ ] ppc
- [x] ppc-musl
- [x] x86_64-musl

Testing:

- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [x] ppc64-musl
- [ ] ppc
- [ ] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 139113 bytes --]

From 0b7506f12526cf5c44ae26f6e21f127db9f12acb Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 01/25] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From f4a95f4a278f64c80b9e7d877884c5a456d42bf9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 02/25] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ee8bbf9acaff06515c7a0c38974b8777e895c42d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 03/25] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 57ba6b18eed6e7445270ae2b9d67b98358ef4726 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:27:36 +0200
Subject: [PATCH 04/25] cross-x86_64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-x86_64-linux-musl/template      | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 2f6a2a4241d..349eacf973c 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-x86_64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=x86_64-linux-musl
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 archs="i686* x86_64 ppc64le"
 short_desc="Cross toolchain for x86_64 with musl"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,10 +86,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
 	sed -i 's/lib64/lib/' gcc/config/i386/linux64.h
@@ -158,6 +161,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86_64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -171,7 +190,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -213,6 +232,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -264,6 +284,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a852d18f0a3144844fc16122749fe9898583e90a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:33:03 +0200
Subject: [PATCH 05/25] cross-powerpc64le-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-musl/template | 44 +++++++++++++++----
 4 files changed, 37 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 7e75d7b1c5c..475f2f725ca 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64le-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64le with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,14 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +165,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +196,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
@@ -219,6 +239,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +291,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 62adb1e3cb4fc560d66c37c17130b4071d0726c1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:36:30 +0200
Subject: [PATCH 06/25] cross-powerpc64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-musl/template   | 44 +++++++++++++++----
 4 files changed, 37 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch b/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index d3a9a758fe9..ea2800df634 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64 with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,14 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +165,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +196,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpc-linux"
@@ -219,6 +239,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +291,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ff81242ebdaaf5271929e9cd1f712074989aab58 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:40:18 +0200
Subject: [PATCH 07/25] cross-powerpc-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-musl/template     | 63 +++++++++++++------
 3 files changed, 44 insertions(+), 21 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index 856e8fb0885..9d61d406ace 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,9 +1,9 @@
-# Template build file for 'cross-powerpc-linux-musl'
-#
+# Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=powerpc-linux-musl
 _fpuflags=
@@ -11,8 +11,8 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 
 short_desc="Cross toolchain for PowerPC (musl)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -21,13 +21,14 @@ license="GPL-3.0-or-later, GPL-2.0-only, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
- http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz"
-checksum="
- 0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
+checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
- 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa"
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -36,7 +37,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="i686* x86_64* ppc64*"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -86,13 +87,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -166,6 +167,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -181,7 +198,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-default-pie"
@@ -226,6 +243,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -268,15 +286,20 @@ do_install() {
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc.so.1
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc-sf.so.1
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 7617221f04a76008a1dac4a2b26e7db46361b40a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:44:26 +0200
Subject: [PATCH 08/25] cross-arm-linux-musleabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabi/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index f1434fe9b26..985af935aac 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabi
 _fpuflags="--with-arch=armv5te --without-fp --with-float=soft"
@@ -11,8 +12,8 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv5 TE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -169,7 +188,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -211,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -261,6 +281,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 9a88f06468900106b22fa394f523985110a3d9d5 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:46:45 +0200
Subject: [PATCH 09/25] cross-arm-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabihf/template   | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 6b9194ebc65..a5b5fc028c7 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabihf
 _fpuflags="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv6 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -210,6 +229,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -260,6 +280,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 942adf56fa65937a796db207d3272515812c05f1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:49:32 +0200
Subject: [PATCH 10/25] cross-armv7l-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 .../cross-armv7l-linux-musleabihf/template    | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 37daba36ac9..5704eb067a9 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-armv7l-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=armv7l-linux-musleabihf
 _fpuflags="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv7 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -156,6 +159,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -170,7 +189,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -212,6 +231,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -262,6 +282,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a2aa6268834894cb2323ad92a55fabd0433bb4d0 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:53:27 +0200
Subject: [PATCH 11/25] cross-i686-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-linux-musl/template        | 47 +++++++++++++++----
 4 files changed, 38 insertions(+), 12 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/bug90756.patch
 create mode 120000 srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch b/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch b/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 905bacb0e27..25d8042180a 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-i686-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=i686-linux-musl
 _sysroot="/usr/${_triplet}"
 _archflags="-march=i686"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=4
+version=0.32
+revision=1
 short_desc="Cross toolchain for i686 target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,12 +86,11 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +157,25 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	sed -i arch/x86/startcontext.S -e \
+	 "s;__i686.get_pc_thunk.bx;i686_get_pc_thunk_bx;g"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +189,7 @@ _gcc_build() {
 	_args="--target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --prefix=/usr"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
@@ -209,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -266,6 +288,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 2b663cf412958fb8f536c8d6a9ba762429697363 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:58:40 +0200
Subject: [PATCH 12/25] cross-mips-linux-musl: update for gcc-9.2.0 + objc(++)

---
 .../cross-mips-linux-musl/files/non-nullness.patch |  1 -
 srcpkgs/cross-mips-linux-musl/template             | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index a129e937dbf..213d288cafc 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From b73ddebe655c8a20869533295c01dee57e996c06 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:08:52 +0200
Subject: [PATCH 13/25] cross-mips-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mips-linux-muslhf/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index 5ad364ecf40..84892aa48ba 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE hardfloat target (musl)"
 maintainer="hipperson0 <hipperson0@gmail.com>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 758e50bfd80b1eb82a3a4aea7e5e1a1c22ae64de Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:15:29 +0200
Subject: [PATCH 14/25] cross-mipsel-linux-musl: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-musl/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1621d1005d5..20cbe0fed03 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From e695439186bb09ce530f92abb348fb2b20f63e69 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:17:20 +0200
Subject: [PATCH 15/25] cross-mipsel-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-muslhf/template         | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 3f02ba22d27..d2a692b48fe 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE hardfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 0ac8266f483e3be1f9ffca9cb1453a8a44c11db9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:29:56 +0200
Subject: [PATCH 16/25] cross-powerpc64le-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-gnu/template  | 21 ++++++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch b/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 485f6bfe397..30bde74b769 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,14 +1,14 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet="powerpc64le-linux-gnu"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU cross toolchain for the ${_triplet} targets (binutils/gcc/glibc)"
 maintainer="q66 <daniel@octaforge.org>"
@@ -20,8 +20,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -29,7 +29,7 @@ nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,7 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
@@ -241,7 +241,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
 	_args+=" --with-gnu-as"
@@ -338,6 +338,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 317088c13756361c7d6a31b38fdd72223aec3e1d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:32:21 +0200
Subject: [PATCH 17/25] cross-powerpc64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-gnu/template    | 21 ++++++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch b/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 51973934ea6..9788de4ffc1 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,14 +1,14 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet="powerpc64-linux-gnu"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU cross toolchain for the ${_triplet} targets (binutils/gcc/glibc)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -20,8 +20,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -29,7 +29,7 @@ nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,7 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
@@ -241,7 +241,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
 	_args+=" --with-gnu-as"
@@ -338,6 +338,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From d9b03a3b995805a9646b1aedc8861c1099306e62 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:38:58 +0200
Subject: [PATCH 18/25] cross-powerpc-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-gnu/template      | 40 ++++++++++---------
 2 files changed, 21 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index d599721bad6..c36b8c1c307 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,8 +1,7 @@
-# Template build file for 'cross-powerpc-linux-gnu'
-#
+# Template file for 'cross-powerpc-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=powerpc-linux-gnu
@@ -10,7 +9,7 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} target (binutils/gcc/glibc)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -22,15 +21,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -95,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -236,7 +234,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -252,7 +250,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -328,14 +325,19 @@ do_install() {
 	cd ${wrksrc}/glibc-build
 	make install_root=${DESTDIR}/${_sysroot} install install-headers
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
-        rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
+	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
+
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
 
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a

From 53fbe184a8e70c0a9bb8178dae38f89b2e2ff3a6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:40:23 +0200
Subject: [PATCH 19/25] cross-i686-pc-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-pc-linux-gnu/template      | 24 ++++++++++---------
 3 files changed, 13 insertions(+), 13 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
 delete mode 120000 srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch b/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 34dc2a3827e..c5b0e414cae 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-i686-pc-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=i686-pc-linux-gnu
@@ -10,8 +10,8 @@ _archflags="-march=i686 -mtune=generic"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=2
+version=0.32
+revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -22,8 +22,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 archs="armv6l armv7l x86_64"
@@ -32,7 +32,7 @@ nopie=yes
 nodebug=yes
 lib32disabled=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -81,9 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -235,7 +233,7 @@ _gcc_build() {
 	_args+=" --prefix=/usr"
 	_args+=" --libdir=/usr/lib"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -252,7 +250,6 @@ _gcc_build() {
 	_args+=" --enable-default-ssp"
 	_args+=" --enable-gnu-indirect-function"
 	_args+=" --enable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -338,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From f693975534b81ec98d829f0ca1e53837cdb9a561 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:42:23 +0200
Subject: [PATCH 20/25] cross-arm-linux-gnueabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-gnueabi/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index 53b16264218..99b23a88538 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-arm-linux-gnueabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=arm-linux-gnueabi
@@ -11,7 +11,7 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -97,7 +97,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -238,7 +237,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -255,7 +254,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -337,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 229aea4fc588ded950880719578ede2b7a50ebe1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:44:02 +0200
Subject: [PATCH 21/25] cross-arm-linux-gnueabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-gnueabihf/template    | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index 32006480282..85a724d3c87 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-arm-linux-gnueabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=arm-linux-gnueabihf
@@ -11,7 +11,7 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -98,7 +98,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -238,7 +237,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -255,7 +254,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -337,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 8d89413b2fad6d95dc25fc0e3abd4fc32e1418b6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:46:29 +0200
Subject: [PATCH 22/25] cross-armv7l-linux-gnueabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 23864834772..bb60304d610 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-armv7l-linux-gnueabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=armv7l-linux-gnueabihf
@@ -11,7 +11,7 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  http://ftp.gnu.org/gnu/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -98,7 +98,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -239,7 +238,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -256,7 +255,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -338,6 +336,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 01836066b5abb28d1de1490936a54fa30c85cbbc Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:52:10 +0200
Subject: [PATCH 23/25] cross-vpkg-dummy: update to 0.32

---
 srcpkgs/cross-vpkg-dummy/template | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d763d7f14c4..6d29b14f73a 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,7 +1,7 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.31
-revision=2
+version=0.32
+revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,9 +20,16 @@ provides="
 	libstdc++-devel-9999_1
 	libgfortran-9999_1
 	libgfortran-devel-9999_1
+	libgo-9999_1
+	libgo-devel-9999_1
+	libobjc-9999_1
+	libobjc-devel-9999_1
 	gcc-9999_1
 	gcc-fortran-9999_1
-	gcc-ada-9999_1"
+	gcc-ada-9999_1
+	gcc-go-9999_1
+	gcc-objc-9999_1
+	gcc-objc++-9999_1"
 conflicts="
 	kernel-libc-headers>=0
 	binutils>=0
@@ -33,9 +40,16 @@ conflicts="
 	libstdc++-devel>=0
 	libgfortran>=0
 	libgfortran-devel>=0
+	libgo>=0
+	libgo-devel>=0
+	libobjc>=0
+	libobjc-devel>=0
 	gcc>=0
 	gcc-fortran>=0
-	gcc-ada>=0"
+	gcc-ada>=0
+	gcc-go>=0
+	gcc-objc>=0
+	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
 	libgnat-9.so

From d0dad1aafbf3db2c5a0666a20eb254608ddec5f0 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 24/25] gcc: reenable on cross and enable go/objc(++) for cross
 targets

Except mips*-musl, as it doesn't have libucontext support yet.

[ci skip]
---
 srcpkgs/gcc/template | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..d8cae082a4f 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,13 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
+
+_have_gccgo=yes
+
+# MIPS does not have libucontext yet
+case "$XBPS_TARGET_MACHINE" in
+	mips*-musl) _have_gccgo=no ;;
+esac
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,8 +74,8 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	if [ "$_have_gccgo" = "yes" ]; then
 		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
 		# we need this for gcc-go on musl
 		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
@@ -129,7 +135,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -162,6 +167,9 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
+		mips*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			;;
 		*-musl)
 			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
 			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
@@ -219,20 +227,26 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,go,fortran,lto"
+		_langs="c,c++,objc,obj-c++,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi
 
+	if [ "$_have_gccgo" = "yes" ]; then
+		_langs+=",go"
+	fi
+
 	case "$XBPS_TARGET_MACHINE" in
 		*-musl) _args+=" --disable-libsanitizer";;
 	esac

From 025aaf72fcf0b7c589bc189018038ed07c9ec5f1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:54:41 +0200
Subject: [PATCH 25/25] cross-x86_64-w64-mingw32: update for gcc-9.2.0

[ci skip]
---
 srcpkgs/cross-x86_64-w64-mingw32/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-x86_64-w64-mingw32/template b/srcpkgs/cross-x86_64-w64-mingw32/template
index 2e5bc454ba8..ccc30402e15 100644
--- a/srcpkgs/cross-x86_64-w64-mingw32/template
+++ b/srcpkgs/cross-x86_64-w64-mingw32/template
@@ -1,5 +1,5 @@
 # Template file for 'cross-x86_64-w64-mingw32'
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _binutils_version=2.32
 _gmp_version=6.1.2
 _mpfr_version=4.0.1
@@ -9,7 +9,7 @@ _mingw_version=6.0.0
 
 pkgname=cross-x86_64-w64-mingw32
 version=$_mingw_version
-revision=2
+revision=3
 archs="x86_64* i686*"
 create_wrksrc=yes
 hostmakedepends="flex perl python3"
@@ -31,7 +31,7 @@ distfiles="
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2
  ${SOURCEFORGE_SITE}/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${_mingw_version}.tar.bz2"
 checksum="de38b15c902eb2725eac6af21183a5f34ea4634cb0bcef19612b50e5ed31072d
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
  67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (14 preceding siblings ...)
  2019-09-08  1:56 ` voidlinux-github
@ 2019-09-08  2:27 ` voidlinux-github
  2019-09-08 10:31 ` voidlinux-github
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08  2:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/14289#issuecomment-529163284

Comment:
Alright. As far as I'm concerned I've done everything; what's left is testing on systems I can't test on and merging.

To merge, we'll have to do this in steps:

1) First merge the initial commit updating `gcc` only.
2) Wait until native builders have all rebuilt their `gcc` (first commit marks `gcc` nocross to prevent crossbuilders from attempting anything)
3) Once that's done, merge all of the crosstoolchain rebuilds.
4) Once these are done building, merge the `cross-vpkg-dummy` update as well as the commit that reenables cross for gcc and enables go/objc for cross.
5) that's it

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (15 preceding siblings ...)
  2019-09-08  2:27 ` voidlinux-github
@ 2019-09-08 10:31 ` voidlinux-github
  2019-09-08 15:30 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08 10:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 212 bytes --]

New comment by jnbr on void-packages repository

https://github.com/void-linux/void-packages/pull/14289#issuecomment-529189894

Comment:
I started builds for x86_64 and armv7hf. Will test and report later today.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (17 preceding siblings ...)
  2019-09-08 15:30 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-09-08 15:30 ` voidlinux-github
  2019-09-08 19:02 ` voidlinux-github
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08 15:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
This updates `gcc` to 9.2.0 and while doing that, enables `gcc-go` on `musl`. It also enables `go`, `objc` and `objc++` support in crosstoolchains, allowing us to also enable them for cross targets. That mainly means our cross targets and native targets will all have `gcc` built with the same languages and subpackages, which should be a lot easier to deal with (and possibly enable crosscompiling for some GNUstep stuff etc)

(except on `mips*-musl`, as `libucontext` does not have MIPS support yet, so only enable `objc` and `objc++` on those)

Crosstoolchains updates:

- [x] aarch64
- [x] aarch64-musl
- [x] armv5tel
- [x] armv5tel-musl
- [x] armv6l
- [x] armv6l-musl
- [x] armv7l
- [x] armv7l-musl
- [x] i686
- [x] i686-musl
- [x] mips-musl
- [x] mipshf-musl
- [x] mipsel-musl
- [x] mipselhf-musl
- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [x] ppc64-musl
- [x] ppc
- [x] ppc-musl
- [x] x86_64-musl

Testing:

- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [x] ppc64-musl
- [x] ppc
- [x] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 138738 bytes --]

From 0b7506f12526cf5c44ae26f6e21f127db9f12acb Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 01/25] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From f4a95f4a278f64c80b9e7d877884c5a456d42bf9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 02/25] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ee8bbf9acaff06515c7a0c38974b8777e895c42d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 03/25] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 57ba6b18eed6e7445270ae2b9d67b98358ef4726 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:27:36 +0200
Subject: [PATCH 04/25] cross-x86_64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-x86_64-linux-musl/template      | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 2f6a2a4241d..349eacf973c 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-x86_64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=x86_64-linux-musl
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 archs="i686* x86_64 ppc64le"
 short_desc="Cross toolchain for x86_64 with musl"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,10 +86,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
 	sed -i 's/lib64/lib/' gcc/config/i386/linux64.h
@@ -158,6 +161,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86_64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -171,7 +190,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -213,6 +232,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -264,6 +284,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a852d18f0a3144844fc16122749fe9898583e90a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:33:03 +0200
Subject: [PATCH 05/25] cross-powerpc64le-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-musl/template | 44 +++++++++++++++----
 4 files changed, 37 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 7e75d7b1c5c..475f2f725ca 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64le-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64le with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,14 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +165,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +196,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
@@ -219,6 +239,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +291,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 62adb1e3cb4fc560d66c37c17130b4071d0726c1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:36:30 +0200
Subject: [PATCH 06/25] cross-powerpc64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-musl/template   | 44 +++++++++++++++----
 4 files changed, 37 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch b/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index d3a9a758fe9..ea2800df634 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64 with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,14 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +165,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +196,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpc-linux"
@@ -219,6 +239,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +291,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ff81242ebdaaf5271929e9cd1f712074989aab58 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:40:18 +0200
Subject: [PATCH 07/25] cross-powerpc-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-musl/template     | 63 +++++++++++++------
 3 files changed, 44 insertions(+), 21 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index 856e8fb0885..9d61d406ace 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,9 +1,9 @@
-# Template build file for 'cross-powerpc-linux-musl'
-#
+# Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=powerpc-linux-musl
 _fpuflags=
@@ -11,8 +11,8 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 
 short_desc="Cross toolchain for PowerPC (musl)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -21,13 +21,14 @@ license="GPL-3.0-or-later, GPL-2.0-only, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
- http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz"
-checksum="
- 0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
+checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
- 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa"
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -36,7 +37,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="i686* x86_64* ppc64*"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -86,13 +87,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -166,6 +167,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -181,7 +198,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-default-pie"
@@ -226,6 +243,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -268,15 +286,20 @@ do_install() {
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc.so.1
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc-sf.so.1
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 7617221f04a76008a1dac4a2b26e7db46361b40a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:44:26 +0200
Subject: [PATCH 08/25] cross-arm-linux-musleabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabi/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index f1434fe9b26..985af935aac 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabi
 _fpuflags="--with-arch=armv5te --without-fp --with-float=soft"
@@ -11,8 +12,8 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv5 TE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -169,7 +188,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -211,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -261,6 +281,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 9a88f06468900106b22fa394f523985110a3d9d5 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:46:45 +0200
Subject: [PATCH 09/25] cross-arm-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabihf/template   | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 6b9194ebc65..a5b5fc028c7 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabihf
 _fpuflags="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv6 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -210,6 +229,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -260,6 +280,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 942adf56fa65937a796db207d3272515812c05f1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:49:32 +0200
Subject: [PATCH 10/25] cross-armv7l-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 .../cross-armv7l-linux-musleabihf/template    | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 37daba36ac9..5704eb067a9 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-armv7l-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=armv7l-linux-musleabihf
 _fpuflags="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv7 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -156,6 +159,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -170,7 +189,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -212,6 +231,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -262,6 +282,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a2aa6268834894cb2323ad92a55fabd0433bb4d0 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:53:27 +0200
Subject: [PATCH 11/25] cross-i686-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-linux-musl/template        | 47 +++++++++++++++----
 4 files changed, 38 insertions(+), 12 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/bug90756.patch
 create mode 120000 srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch b/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch b/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 905bacb0e27..25d8042180a 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-i686-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=i686-linux-musl
 _sysroot="/usr/${_triplet}"
 _archflags="-march=i686"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=4
+version=0.32
+revision=1
 short_desc="Cross toolchain for i686 target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,12 +86,11 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +157,25 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	sed -i arch/x86/startcontext.S -e \
+	 "s;__i686.get_pc_thunk.bx;i686_get_pc_thunk_bx;g"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +189,7 @@ _gcc_build() {
 	_args="--target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --prefix=/usr"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
@@ -209,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -266,6 +288,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 2b663cf412958fb8f536c8d6a9ba762429697363 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:58:40 +0200
Subject: [PATCH 12/25] cross-mips-linux-musl: update for gcc-9.2.0 + objc(++)

---
 .../cross-mips-linux-musl/files/non-nullness.patch |  1 -
 srcpkgs/cross-mips-linux-musl/template             | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index a129e937dbf..213d288cafc 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From b73ddebe655c8a20869533295c01dee57e996c06 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:08:52 +0200
Subject: [PATCH 13/25] cross-mips-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mips-linux-muslhf/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index 5ad364ecf40..84892aa48ba 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE hardfloat target (musl)"
 maintainer="hipperson0 <hipperson0@gmail.com>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 758e50bfd80b1eb82a3a4aea7e5e1a1c22ae64de Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:15:29 +0200
Subject: [PATCH 14/25] cross-mipsel-linux-musl: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-musl/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1621d1005d5..20cbe0fed03 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From e695439186bb09ce530f92abb348fb2b20f63e69 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:17:20 +0200
Subject: [PATCH 15/25] cross-mipsel-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-muslhf/template         | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 3f02ba22d27..d2a692b48fe 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE hardfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 0ac8266f483e3be1f9ffca9cb1453a8a44c11db9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:29:56 +0200
Subject: [PATCH 16/25] cross-powerpc64le-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-gnu/template  | 21 ++++++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch b/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 485f6bfe397..30bde74b769 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,14 +1,14 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet="powerpc64le-linux-gnu"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU cross toolchain for the ${_triplet} targets (binutils/gcc/glibc)"
 maintainer="q66 <daniel@octaforge.org>"
@@ -20,8 +20,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -29,7 +29,7 @@ nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,7 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
@@ -241,7 +241,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
 	_args+=" --with-gnu-as"
@@ -338,6 +338,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 317088c13756361c7d6a31b38fdd72223aec3e1d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:32:21 +0200
Subject: [PATCH 17/25] cross-powerpc64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-gnu/template    | 21 ++++++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch b/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 51973934ea6..9788de4ffc1 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,14 +1,14 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet="powerpc64-linux-gnu"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU cross toolchain for the ${_triplet} targets (binutils/gcc/glibc)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -20,8 +20,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -29,7 +29,7 @@ nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,7 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
@@ -241,7 +241,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
 	_args+=" --with-gnu-as"
@@ -338,6 +338,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From d9b03a3b995805a9646b1aedc8861c1099306e62 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:38:58 +0200
Subject: [PATCH 18/25] cross-powerpc-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-gnu/template      | 40 ++++++++++---------
 2 files changed, 21 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index d599721bad6..c36b8c1c307 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,8 +1,7 @@
-# Template build file for 'cross-powerpc-linux-gnu'
-#
+# Template file for 'cross-powerpc-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=powerpc-linux-gnu
@@ -10,7 +9,7 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} target (binutils/gcc/glibc)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -22,15 +21,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -95,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -236,7 +234,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -252,7 +250,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -328,14 +325,19 @@ do_install() {
 	cd ${wrksrc}/glibc-build
 	make install_root=${DESTDIR}/${_sysroot} install install-headers
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
-        rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
+	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
+
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
 
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a

From 53fbe184a8e70c0a9bb8178dae38f89b2e2ff3a6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:40:23 +0200
Subject: [PATCH 19/25] cross-i686-pc-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-pc-linux-gnu/template      | 24 ++++++++++---------
 3 files changed, 13 insertions(+), 13 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
 delete mode 120000 srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch b/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 34dc2a3827e..c5b0e414cae 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-i686-pc-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=i686-pc-linux-gnu
@@ -10,8 +10,8 @@ _archflags="-march=i686 -mtune=generic"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=2
+version=0.32
+revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -22,8 +22,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 archs="armv6l armv7l x86_64"
@@ -32,7 +32,7 @@ nopie=yes
 nodebug=yes
 lib32disabled=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -81,9 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -235,7 +233,7 @@ _gcc_build() {
 	_args+=" --prefix=/usr"
 	_args+=" --libdir=/usr/lib"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -252,7 +250,6 @@ _gcc_build() {
 	_args+=" --enable-default-ssp"
 	_args+=" --enable-gnu-indirect-function"
 	_args+=" --enable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -338,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From f693975534b81ec98d829f0ca1e53837cdb9a561 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:42:23 +0200
Subject: [PATCH 20/25] cross-arm-linux-gnueabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-gnueabi/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index 53b16264218..99b23a88538 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-arm-linux-gnueabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=arm-linux-gnueabi
@@ -11,7 +11,7 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -97,7 +97,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -238,7 +237,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -255,7 +254,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -337,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 229aea4fc588ded950880719578ede2b7a50ebe1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:44:02 +0200
Subject: [PATCH 21/25] cross-arm-linux-gnueabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-gnueabihf/template    | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index 32006480282..85a724d3c87 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-arm-linux-gnueabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=arm-linux-gnueabihf
@@ -11,7 +11,7 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -98,7 +98,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -238,7 +237,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -255,7 +254,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -337,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 8d89413b2fad6d95dc25fc0e3abd4fc32e1418b6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:46:29 +0200
Subject: [PATCH 22/25] cross-armv7l-linux-gnueabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 23864834772..bb60304d610 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-armv7l-linux-gnueabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=armv7l-linux-gnueabihf
@@ -11,7 +11,7 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  http://ftp.gnu.org/gnu/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -98,7 +98,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -239,7 +238,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -256,7 +255,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -338,6 +336,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 01836066b5abb28d1de1490936a54fa30c85cbbc Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:52:10 +0200
Subject: [PATCH 23/25] cross-vpkg-dummy: update to 0.32

---
 srcpkgs/cross-vpkg-dummy/template | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d763d7f14c4..6d29b14f73a 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,7 +1,7 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.31
-revision=2
+version=0.32
+revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,9 +20,16 @@ provides="
 	libstdc++-devel-9999_1
 	libgfortran-9999_1
 	libgfortran-devel-9999_1
+	libgo-9999_1
+	libgo-devel-9999_1
+	libobjc-9999_1
+	libobjc-devel-9999_1
 	gcc-9999_1
 	gcc-fortran-9999_1
-	gcc-ada-9999_1"
+	gcc-ada-9999_1
+	gcc-go-9999_1
+	gcc-objc-9999_1
+	gcc-objc++-9999_1"
 conflicts="
 	kernel-libc-headers>=0
 	binutils>=0
@@ -33,9 +40,16 @@ conflicts="
 	libstdc++-devel>=0
 	libgfortran>=0
 	libgfortran-devel>=0
+	libgo>=0
+	libgo-devel>=0
+	libobjc>=0
+	libobjc-devel>=0
 	gcc>=0
 	gcc-fortran>=0
-	gcc-ada>=0"
+	gcc-ada>=0
+	gcc-go>=0
+	gcc-objc>=0
+	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
 	libgnat-9.so

From eebf669b42b9c1efa317deaedbb31f168cbb71a4 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 24/25] gcc: reenable on cross and enable go/objc(++) for cross
 targets

Except mips*-musl, as it doesn't have libucontext support yet.

[ci skip]
---
 srcpkgs/gcc/template | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..6774b8a5826 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,13 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
+
+_have_gccgo=yes
+
+# MIPS does not have libucontext yet
+case "$XBPS_TARGET_MACHINE" in
+	mips*-musl) _have_gccgo=no ;;
+esac
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,8 +74,8 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	if [ "$_have_gccgo" = "yes" ]; then
 		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
 		# we need this for gcc-go on musl
 		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
@@ -129,7 +135,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -219,20 +224,26 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,go,fortran,lto"
+		_langs="c,c++,objc,obj-c++,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi
 
+	if [ "$_have_gccgo" = "yes" ]; then
+		_langs+=",go"
+	fi
+
 	case "$XBPS_TARGET_MACHINE" in
 		*-musl) _args+=" --disable-libsanitizer";;
 	esac

From a8a070fee027603fc4d10652a6c5f801286cc09a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:54:41 +0200
Subject: [PATCH 25/25] cross-x86_64-w64-mingw32: update for gcc-9.2.0

[ci skip]
---
 srcpkgs/cross-x86_64-w64-mingw32/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-x86_64-w64-mingw32/template b/srcpkgs/cross-x86_64-w64-mingw32/template
index 2e5bc454ba8..ccc30402e15 100644
--- a/srcpkgs/cross-x86_64-w64-mingw32/template
+++ b/srcpkgs/cross-x86_64-w64-mingw32/template
@@ -1,5 +1,5 @@
 # Template file for 'cross-x86_64-w64-mingw32'
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _binutils_version=2.32
 _gmp_version=6.1.2
 _mpfr_version=4.0.1
@@ -9,7 +9,7 @@ _mingw_version=6.0.0
 
 pkgname=cross-x86_64-w64-mingw32
 version=$_mingw_version
-revision=2
+revision=3
 archs="x86_64* i686*"
 create_wrksrc=yes
 hostmakedepends="flex perl python3"
@@ -31,7 +31,7 @@ distfiles="
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2
  ${SOURCEFORGE_SITE}/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${_mingw_version}.tar.bz2"
 checksum="de38b15c902eb2725eac6af21183a5f34ea4634cb0bcef19612b50e5ed31072d
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
  67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (16 preceding siblings ...)
  2019-09-08 10:31 ` voidlinux-github
@ 2019-09-08 15:30 ` voidlinux-github
  2019-09-08 15:30 ` voidlinux-github
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08 15:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]

There is an updated pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages gcc92
https://github.com/void-linux/void-packages/pull/14289

gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
This updates `gcc` to 9.2.0 and while doing that, enables `gcc-go` on `musl`. It also enables `go`, `objc` and `objc++` support in crosstoolchains, allowing us to also enable them for cross targets. That mainly means our cross targets and native targets will all have `gcc` built with the same languages and subpackages, which should be a lot easier to deal with (and possibly enable crosscompiling for some GNUstep stuff etc)

(except on `mips*-musl`, as `libucontext` does not have MIPS support yet, so only enable `objc` and `objc++` on those)

Crosstoolchains updates:

- [x] aarch64
- [x] aarch64-musl
- [x] armv5tel
- [x] armv5tel-musl
- [x] armv6l
- [x] armv6l-musl
- [x] armv7l
- [x] armv7l-musl
- [x] i686
- [x] i686-musl
- [x] mips-musl
- [x] mipshf-musl
- [x] mipsel-musl
- [x] mipselhf-musl
- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [x] ppc64-musl
- [x] ppc
- [x] ppc-musl
- [x] x86_64-musl

Testing:

- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [x] ppc64-musl
- [x] ppc
- [x] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

A patch file from https://github.com/void-linux/void-packages/pull/14289.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gcc92-14289.patch --]
[-- Type: text/x-diff, Size: 138738 bytes --]

From 0b7506f12526cf5c44ae26f6e21f127db9f12acb Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 19:13:12 +0200
Subject: [PATCH 01/25] gcc: update to 9.2.0 and enable gcc-go on musl

---
 srcpkgs/gcc/files/gccgo-musl.patch        | 200 +++++++++
 srcpkgs/gcc/patches/bug90756.patch        |  23 -
 srcpkgs/gcc/patches/darn.patch            | 504 ++++++++++++++++++++++
 srcpkgs/gcc/patches/libffi_gnulinux.patch |  11 +
 srcpkgs/gcc/patches/non-nullness.patch    |  88 ----
 srcpkgs/gcc/template                      |  39 +-
 6 files changed, 733 insertions(+), 132 deletions(-)
 create mode 100644 srcpkgs/gcc/files/gccgo-musl.patch
 delete mode 100644 srcpkgs/gcc/patches/bug90756.patch
 create mode 100644 srcpkgs/gcc/patches/darn.patch
 create mode 100644 srcpkgs/gcc/patches/libffi_gnulinux.patch
 delete mode 100644 srcpkgs/gcc/patches/non-nullness.patch

diff --git a/srcpkgs/gcc/files/gccgo-musl.patch b/srcpkgs/gcc/files/gccgo-musl.patch
new file mode 100644
index 00000000000..cc3ed7d17ae
--- /dev/null
+++ b/srcpkgs/gcc/files/gccgo-musl.patch
@@ -0,0 +1,200 @@
+This is not among the normal patches as these changes are musl specific and
+there is no way to easily conditionalize it in source for some of the changes.
+
+Souurce: Adélie Linux, q66
+URL: https://code.foxkit.us/adelie/packages/tree/master/system/gcc
+
+--- Makefile.in
++++ Makefile.in
+@@ -46325,7 +46325,7 @@ configure-target-libgo:
+ 	esac; \
+ 	module_srcdir=libgo; \
+ 	rm -f no-such-file || : ; \
+-	CONFIG_SITE=no-such-file $(SHELL) \
++	CONFIG_SITE=no-such-file LIBS="-lucontext $$LIBS" $(SHELL) \
+ 	  $$s/$$module_srcdir/configure \
+ 	  --srcdir=$${topdir}/$$module_srcdir \
+ 	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+--- libgo/mksysinfo.sh
++++ libgo/mksysinfo.sh
+@@ -379,11 +379,7 @@ fi
+ # Some basic types.
+ echo 'type Size_t _size_t' >> ${OUT}
+ echo "type Ssize_t _ssize_t" >> ${OUT}
+-if grep '^const _HAVE_OFF64_T = ' gen-sysinfo.go > /dev/null 2>&1; then
+-  echo "type Offset_t _off64_t" >> ${OUT}
+-else
+-  echo "type Offset_t _off_t" >> ${OUT}
+-fi
++echo "type Offset_t _off_t" >> ${OUT}
+ echo "type Mode_t _mode_t" >> ${OUT}
+ echo "type Pid_t _pid_t" >> ${OUT}
+ echo "type Uid_t _uid_t" >> ${OUT}
+--- libgo/go/runtime/mem_gccgo.go
++++ libgo/go/runtime/mem_gccgo.go
+@@ -16,7 +16,7 @@ import (
+ //go:linkname sysFree runtime.sysFree
+ 
+ //extern mmap
+-func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) unsafe.Pointer
++func sysMmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) unsafe.Pointer
+ 
+ //extern munmap
+ func munmap(addr unsafe.Pointer, length uintptr) int32
+@@ -38,7 +38,7 @@ func init() {
+ 	}
+ }
+ 
+-func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off uintptr) (unsafe.Pointer, int) {
++func mmap(addr unsafe.Pointer, n uintptr, prot, flags, fd int32, off int64) (unsafe.Pointer, int) {
+ 	p := sysMmap(addr, n, prot, flags, fd, off)
+ 	if uintptr(p) == _MAP_FAILED {
+ 		return nil, errno()
+--- libgo/go/runtime/signal_gccgo.go
++++ libgo/go/runtime/signal_gccgo.go
+@@ -111,7 +111,7 @@ func getsig(i uint32) uintptr {
+ 	if sigaction(i, nil, &sa) < 0 {
+ 		// On GNU/Linux glibc rejects attempts to call
+ 		// sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID).
+-		if GOOS == "linux" && (i == 32 || i == 33) {
++		if GOOS == "linux" && (i == 32 || i == 33 || i == 34) {
+ 			return _SIG_DFL
+ 		}
+ 		throw("sigaction read failure")
+--- libgo/go/syscall/errstr.go
++++ libgo/go/syscall/errstr.go
+@@ -5,7 +5,6 @@
+ // license that can be found in the LICENSE file.
+ 
+ // +build !hurd
+-// +build !linux
+ 
+ package syscall
+ 
+--- libgo/go/syscall/errstr_glibc.go
++++ /dev/null
+@@ -1,33 +0,0 @@
+-// errstr_glibc.go -- GNU/Linux and GNU/Hurd 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.
+-
+-// +build hurd linux
+-
+-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])
+-}
+--- libgo/go/syscall/libcall_linux.go
++++ libgo/go/syscall/libcall_linux.go
+@@ -206,19 +206,19 @@ func Gettid() (tid int) {
+ //sys	Setxattr(path string, attr string, data []byte, flags int) (err error)
+ //setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
+ 
+-//sys	splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
+-//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
++//sys	splice(rfd int, roff *_off_t, wfd int, woff *_off_t, len int, flags int) (n int64, err error)
++//splice(rfd _C_int, roff *_off_t, wfd _C_int, woff *_off_t, len Size_t, flags _C_uint) Ssize_t
+ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
+-	var lroff _loff_t
+-	var plroff *_loff_t
++	var lroff _off_t
++	var plroff *_off_t
+ 	if roff != nil {
+-		lroff = _loff_t(*roff)
++		lroff = _off_t(*roff)
+ 		plroff = &lroff
+ 	}
+-	var lwoff _loff_t
+-	var plwoff *_loff_t
++	var lwoff _off_t
++	var plwoff *_off_t
+ 	if woff != nil {
+-		lwoff = _loff_t(*woff)
++		lwoff = _off_t(*woff)
+ 		plwoff = &lwoff
+ 	}
+ 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)
+--- libgo/mksigtab.sh
++++ libgo/mksigtab.sh
+@@ -82,7 +82,7 @@ checksig _SIGPWR     '{_SigNotify, "SIGPWR: power failure restart"}'
+ checksig _SIGEMT     '{_SigThrow, "SIGEMT: emulate instruction executed"}'
+ checksig _SIGINFO    '{_SigNotify, "SIGINFO: status request from keyboard"}'
+ checksig _SIGTHR     '{_SigNotify, "SIGTHR: reserved"}'
+-checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
++#checksig _SIGPOLL    '{_SigNotify, "SIGPOLL: pollable event occurred"}'
+ checksig _SIGWAITING '{_SigNotify, "SIGWAITING: reserved signal no longer used by"}'
+ checksig _SIGLWP     '{_SigNotify, "SIGLWP: reserved signal no longer used by"}'
+ checksig _SIGFREEZE  '{_SigNotify, "SIGFREEZE: special signal used by CPR"}'
+@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
+ 
+ # Special handling of signals 32 and 33 on GNU/Linux systems,
+ # because they are special to glibc.
++# Signal 34 is additionally special to Linux systems with musl.
+ if test "${GOOS}" = "linux"; then
+-    SIGLIST=$SIGLIST"_32__33_"
++    SIGLIST=$SIGLIST"_32__33__34_"
+     echo '	32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
+     echo '	33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
++    echo '	34: {_SigSetStack + _SigUnblock, "signal 34"}, /* see issue 30062 */'
+ fi
+ 
+ if test "${GOOS}" = "aix"; then
+--- libgo/runtime/go-signal.c
++++ libgo/runtime/go-signal.c
+@@ -222,7 +222,11 @@ getSiginfo(siginfo_t *info, void *context __attribute__((unused)))
+ #endif
+ #ifdef __PPC__
+   #ifdef __linux__
+-	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
++    #ifdef __PPC64__
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gp_regs[32];
++    #else
++	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];
++    #endif
+   #endif
+   #ifdef _AIX
+ 	ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.jmp_context.iar;
+@@ -343,7 +343,7 @@ dumpregs(siginfo_t *info __attribute__((unused)), void *context __attribute__((u
+   #endif
+ #endif
+ 
+-#if defined(__PPC__) && defined(__LITTLE_ENDIAN__)
++#if defined(__PPC__) && defined(__LITTLE_ENDIAN__) && defined(__GLIBC__)
+   #ifdef __linux__
+ 	  {
+ 		mcontext_t *m = &((ucontext_t*)(context))->uc_mcontext;
+--- libgo/sysinfo.c
++++ libgo/sysinfo.c
+@@ -73,9 +73,6 @@
+ #include <sys/times.h>
+ #include <sys/wait.h>
+ #include <sys/un.h>
+-#if defined(HAVE_SYS_USER_H)
+-#include <sys/user.h>
+-#endif
+ #if defined(HAVE_SYS_UTSNAME_H)
+ #include <sys/utsname.h>
+ #endif
diff --git a/srcpkgs/gcc/patches/bug90756.patch b/srcpkgs/gcc/patches/bug90756.patch
deleted file mode 100644
index cf78dad9cce..00000000000
--- a/srcpkgs/gcc/patches/bug90756.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Bug 90756 - [7/8/9 Regression] g++ ICE in convert_move, at expr.c:218 on i686 and s390x 
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90756
-
---- gcc/explow.c	2019/07/04 02:39:58	273035
-+++ gcc/explow.c	2019/07/04 04:49:22	273036
-@@ -892,16 +892,7 @@
- 
-   tree type = TREE_TYPE (name);
-   int unsignedp = TYPE_UNSIGNED (type);
--  machine_mode mode = TYPE_MODE (type);
--
--  /* Bypass TYPE_MODE when it maps vector modes to BLKmode.  */
--  if (mode == BLKmode)
--    {
--      gcc_assert (VECTOR_TYPE_P (type));
--      mode = type->type_common.mode;
--    }
--
--  machine_mode pmode = promote_mode (type, mode, &unsignedp);
-+  machine_mode pmode = promote_mode (type, TYPE_MODE (type), &unsignedp);
-   if (punsignedp)
-     *punsignedp = unsignedp;
- 
diff --git a/srcpkgs/gcc/patches/darn.patch b/srcpkgs/gcc/patches/darn.patch
new file mode 100644
index 00000000000..97f7de3f438
--- /dev/null
+++ b/srcpkgs/gcc/patches/darn.patch
@@ -0,0 +1,504 @@
+Upstream: yes
+Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91481
+
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275170
+https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=275181
+
+Fixes a security issue with the hardware random number generator
+when compiling for POWER9. Since Void compiles for POWER8 by
+default, it's not affected, but people building custom binaries
+might be.
+
+--- gcc/config/rs6000/altivec.md
++++ gcc/config/rs6000/altivec.md
+@@ -80,9 +80,6 @@
+    UNSPEC_VUPKHPX
+    UNSPEC_VUPKLPX
+    UNSPEC_CONVERT_4F32_8I16
+-   UNSPEC_DARN
+-   UNSPEC_DARN_32
+-   UNSPEC_DARN_RAW
+    UNSPEC_DST
+    UNSPEC_DSTT
+    UNSPEC_DSTST
+@@ -161,9 +158,6 @@
+    UNSPEC_BCDADD
+    UNSPEC_BCDSUB
+    UNSPEC_BCD_OVERFLOW
+-   UNSPEC_CMPRB
+-   UNSPEC_CMPRB2
+-   UNSPEC_CMPEQB
+    UNSPEC_VRLMI
+    UNSPEC_VRLNM
+ ])
+@@ -4101,223 +4095,6 @@
+   "bcd<bcd_add_sub>. %0,%1,%2,%3"
+   [(set_attr "type" "vecsimple")])
+ 
+-(define_insn "darn_32"
+-  [(set (match_operand:SI 0 "register_operand" "=r")
+-        (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
+-  "TARGET_P9_MISC"
+-  "darn %0,0"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn_raw"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,2"
+-  [(set_attr "type" "integer")])
+-
+-(define_insn "darn"
+-  [(set (match_operand:DI 0 "register_operand" "=r")
+-        (unspec:DI [(const_int 0)] UNSPEC_DARN))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "darn %0,1"
+-  [(set_attr "type" "integer")])
+-
+-;; Test byte within range.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Return in target register operand 0 a value of 1 if lo <= vv and
+-;; vv <= hi.  Otherwise, set register operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
+-;; 3 bits of the target CR register are all set to 0.
+-(define_insn "*cmprb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+-;; register operand 1 is on.  Otherwise, set operand 0 register to 1
+-;; if the GT bit (0x4) of condition register operand 1 is on.
+-;; Otherwise, set operand 0 to 0.  Note that the result stored into
+-;; register operand 0 is non-zero iff either the LT or GT bits are on
+-;; within condition register operand 1.
+-(define_insn "setb_signed"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gt (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-(define_insn "setb_unsigned"
+-   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+-			      (const_int 0))
+-			  (const_int -1)
+-			  (if_then_else (gtu (match_dup 1)
+-					    (const_int 0))
+-					(const_int 1)
+-					(const_int 0))))]
+-  "TARGET_P9_MISC"
+-  "setb %0,%1"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte within two ranges.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the range specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
+-;; operand 0 to 0.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation only operates on
+-;; SI-mode operands as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmprb2"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the ranges specified by operand 2.
+-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+-;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
+-;; CR register are all set to 0.
+-(define_insn "*cmprb2_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:SI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPRB2))]
+-  "TARGET_P9_MISC"
+-  "cmprb %0,1,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+-;; Test byte membership within set of 8 bytes.
+-;;
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Return in target register operand 0 a value of 1 if vv equals one
+-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
+-;; register operand 0 to 0.  Note that the 8 byte values held within
+-;; operand 2 need not be unique.
+-;;
+-;; Though the instructions to which this expansion maps operate on
+-;; 64-bit registers, the current implementation requires that operands
+-;; 0 and 1 have mode SI as the high-order bits provide no information
+-;; that is not already available in the low-order bits.  To avoid the
+-;; costs of data widening operations, future enhancements might allow
+-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+-(define_expand "cmpeqb"
+-  [(set (match_dup 3)
+-	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		    (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	 UNSPEC_CMPEQB))
+-   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+-	(if_then_else:SI (lt (match_dup 3)
+-			     (const_int 0))
+-			 (const_int -1)
+-			 (if_then_else (gt (match_dup 3)
+-					   (const_int 0))
+-				       (const_int 1)
+-				       (const_int 0))))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-{
+-  operands[3] = gen_reg_rtx (CCmode);
+-})
+-
+-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+-;; represents a byte whose value is ignored in this context and
+-;; vv, the least significant byte, holds the byte value that is to
+-;; be tested for membership within the set specified by operand 2.
+-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+-;;
+-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
+-;; set the GT bit to zero.  The other 3 bits of the target CR register
+-;; are all set to 0.
+-(define_insn "*cmpeqb_internal"
+-  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+-	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+-		     (match_operand:DI 2 "gpc_reg_operand" "r")]
+-	  UNSPEC_CMPEQB))]
+-  "TARGET_P9_MISC && TARGET_64BIT"
+-  "cmpeqb %0,%1,%2"
+-  [(set_attr "type" "logical")])
+-
+ (define_expand "bcd<bcd_add_sub>_<code>"
+   [(parallel [(set (reg:CCFP CR6_REGNO)
+ 		   (compare:CCFP
+--- gcc/config/rs6000/rs6000.md
++++ gcc/config/rs6000/rs6000.md
+@@ -137,6 +137,9 @@
+    UNSPEC_LSQ
+    UNSPEC_FUSION_GPR
+    UNSPEC_STACK_CHECK
++   UNSPEC_CMPRB
++   UNSPEC_CMPRB2
++   UNSPEC_CMPEQB
+    UNSPEC_ADD_ROUND_TO_ODD
+    UNSPEC_SUB_ROUND_TO_ODD
+    UNSPEC_MUL_ROUND_TO_ODD
+@@ -164,6 +167,9 @@
+    UNSPECV_EH_RR		; eh_reg_restore
+    UNSPECV_ISYNC		; isync instruction
+    UNSPECV_MFTB			; move from time base
++   UNSPECV_DARN			; darn 1 (deliver a random number)
++   UNSPECV_DARN_32		; darn 2
++   UNSPECV_DARN_RAW		; darn 0
+    UNSPECV_NLGR			; non-local goto receiver
+    UNSPECV_MFFS			; Move from FPSCR
+    UNSPECV_MFFSL		; Move from FPSCR light instruction version
+@@ -13853,6 +13859,224 @@
+   [(set_attr "type" "vecmove")
+    (set_attr "size" "128")])
+ 
++;; Miscellaneous ISA 3.0 (power9) instructions
++
++(define_insn "darn_32"
++  [(set (match_operand:SI 0 "register_operand" "=r")
++        (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
++  "TARGET_P9_MISC"
++  "darn %0,0"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn_raw"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,2"
++  [(set_attr "type" "integer")])
++
++(define_insn "darn"
++  [(set (match_operand:DI 0 "register_operand" "=r")
++        (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "darn %0,1"
++  [(set_attr "type" "integer")])
++
++;; Test byte within range.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Return in target register operand 0 a value of 1 if lo <= vv and
++;; vv <= hi.  Otherwise, set register operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as xx:xx:hi:lo.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; lo <= vv and vv <= hi.  Otherwise, set the GT bit to 0.  The other
++;; 3 bits of the target CR register are all set to 0.
++(define_insn "*cmprb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB))]
++  "TARGET_P9_MISC"
++  "cmprb %0,0,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Set operand 0 register to -1 if the LT bit (0x8) of condition
++;; register operand 1 is on.  Otherwise, set operand 0 register to 1
++;; if the GT bit (0x4) of condition register operand 1 is on.
++;; Otherwise, set operand 0 to 0.  Note that the result stored into
++;; register operand 0 is non-zero iff either the LT or GT bits are on
++;; within condition register operand 1.
++(define_insn "setb_signed"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gt (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++(define_insn "setb_unsigned"
++   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	 (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
++			      (const_int 0))
++			  (const_int -1)
++			  (if_then_else (gtu (match_dup 1)
++					    (const_int 0))
++					(const_int 1)
++					(const_int 0))))]
++  "TARGET_P9_MISC"
++  "setb %0,%1"
++  [(set_attr "type" "logical")])
++
++;; Test byte within two ranges.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the range specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
++;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).  Otherwise, set register
++;; operand 0 to 0.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation only operates on
++;; SI-mode operands as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmprb2"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the ranges specified by operand 2.
++;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
++;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
++;; Otherwise, set the GT bit to 0.  The other 3 bits of the target
++;; CR register are all set to 0.
++(define_insn "*cmprb2_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:SI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPRB2))]
++  "TARGET_P9_MISC"
++  "cmprb %0,1,%1,%2"
++  [(set_attr "type" "logical")])
++
++;; Test byte membership within set of 8 bytes.
++;;
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Return in target register operand 0 a value of 1 if vv equals one
++;; of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise, set
++;; register operand 0 to 0.  Note that the 8 byte values held within
++;; operand 2 need not be unique.
++;;
++;; Though the instructions to which this expansion maps operate on
++;; 64-bit registers, the current implementation requires that operands
++;; 0 and 1 have mode SI as the high-order bits provide no information
++;; that is not already available in the low-order bits.  To avoid the
++;; costs of data widening operations, future enhancements might allow
++;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
++(define_expand "cmpeqb"
++  [(set (match_dup 3)
++	(unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		    (match_operand:DI 2 "gpc_reg_operand" "r")]
++	 UNSPEC_CMPEQB))
++   (set (match_operand:SI 0 "gpc_reg_operand" "=r")
++	(if_then_else:SI (lt (match_dup 3)
++			     (const_int 0))
++			 (const_int -1)
++			 (if_then_else (gt (match_dup 3)
++					   (const_int 0))
++				       (const_int 1)
++				       (const_int 0))))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++{
++  operands[3] = gen_reg_rtx (CCmode);
++})
++
++;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
++;; represents a byte whose value is ignored in this context and
++;; vv, the least significant byte, holds the byte value that is to
++;; be tested for membership within the set specified by operand 2.
++;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
++;;
++;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
++;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7.  Otherwise,
++;; set the GT bit to zero.  The other 3 bits of the target CR register
++;; are all set to 0.
++(define_insn "*cmpeqb_internal"
++  [(set (match_operand:CC 0 "cc_reg_operand" "=y")
++	 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
++		     (match_operand:DI 2 "gpc_reg_operand" "r")]
++	  UNSPEC_CMPEQB))]
++  "TARGET_P9_MISC && TARGET_64BIT"
++  "cmpeqb %0,%1,%2"
++  [(set_attr "type" "logical")])
+ 
+ (define_insn "*nabs<mode>2_hw"
+   [(set (match_operand:IEEE128 0 "altivec_register_operand" "=v")
diff --git a/srcpkgs/gcc/patches/libffi_gnulinux.patch b/srcpkgs/gcc/patches/libffi_gnulinux.patch
new file mode 100644
index 00000000000..413b4aef5af
--- /dev/null
+++ b/srcpkgs/gcc/patches/libffi_gnulinux.patch
@@ -0,0 +1,11 @@
+--- libffi/src/closures.c.orig
++++ libffi/src/closures.c
+@@ -34,7 +34,7 @@
+ #include <ffi_common.h>
+
+ #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE
+-# if __gnu_linux__ && !defined(__ANDROID__)
++# if __linux__ && !defined(__ANDROID__)
+ /* This macro indicates it may be forbidden to map anonymous memory
+    with both write and execute permission.  Code compiled when this
+    option is defined will attempt to map such pages once, but if it
diff --git a/srcpkgs/gcc/patches/non-nullness.patch b/srcpkgs/gcc/patches/non-nullness.patch
deleted file mode 100644
index 7e0e4425ce4..00000000000
--- a/srcpkgs/gcc/patches/non-nullness.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Source: 2019-06-21  Jeff Law  <law@redhat.com>
-Upstream: yes
-Reason: PR tree-optimization/90949
-* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
-* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.
-
---- gcc/tree-ssa-copy.c	2019-01-01 13:31:55.000000000 +0100
-+++ gcc/tree-ssa-copy.c	2019-06-26 18:50:01.030395471 +0200
-@@ -545,13 +545,12 @@
- 	      duplicate_ssa_name_ptr_info (copy_of[i].value,
- 					   SSA_NAME_PTR_INFO (var));
- 	      /* Points-to information is cfg insensitive,
--		 but alignment info might be cfg sensitive, if it
--		 e.g. is derived from VRP derived non-zero bits.
--		 So, do not copy alignment info if the two SSA_NAMEs
--		 aren't defined in the same basic block.  */
-+		 but [E]VRP might record context sensitive alignment
-+		 info, non-nullness, etc.  So reset context sensitive
-+		 info if the two SSA_NAMEs aren't defined in the same
-+		 basic block.  */
- 	      if (var_bb != copy_of_bb)
--		mark_ptr_info_alignment_unknown
--				(SSA_NAME_PTR_INFO (copy_of[i].value));
-+		reset_flow_sensitive_info (copy_of[i].value);
- 	    }
- 	  else if (!POINTER_TYPE_P (TREE_TYPE (var))
- 		   && SSA_NAME_RANGE_INFO (var)
---- gcc/tree-ssanames.c	2019-03-18 14:59:11.000000000 +0100
-+++ gcc/tree-ssanames.c	2019-06-26 18:50:11.282394906 +0200
-@@ -820,7 +820,12 @@
-     {
-       /* points-to info is not flow-sensitive.  */
-       if (SSA_NAME_PTR_INFO (name))
--	mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	{
-+	  /* [E]VRP can derive context sensitive alignment info and
-+	     non-nullness properties.  We must reset both.  */
-+	  mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (name));
-+	  SSA_NAME_PTR_INFO (name)->pt.null = 1;
-+	}
-     }
-   else
-     SSA_NAME_RANGE_INFO (name) = NULL;
---- /dev/null
-+++ gcc/testsuite/gcc.c-torture/pr90949.c	2019-06-26 18:53:16.870384679 +0200
-@@ -0,0 +1,42 @@
-+void __attribute__ ((noipa, noinline)) my_puts (const char *str) { }
-+
-+void __attribute__ ((noipa, noinline)) my_free (void *p) { }
-+
-+
-+struct Node
-+{
-+  struct Node *child;
-+};
-+
-+struct Node space[2] = { };
-+
-+struct Node * __attribute__ ((noipa, noinline)) my_malloc (int bytes)
-+{
-+  return &space[0];
-+}
-+
-+void
-+walk (struct Node *module, int cleanup)
-+{
-+  if (module == 0)
-+    {
-+      return;
-+    }
-+  if (!cleanup)
-+    {
-+      my_puts ("No cleanup");
-+    }
-+  walk (module->child, cleanup);
-+  if (cleanup)
-+    {
-+      my_free (module);
-+    }
-+}
-+
-+int
-+main ()
-+{
-+  struct Node *node = my_malloc (sizeof (struct Node));
-+  node->child = 0;
-+  walk (node, 1);
-+}
diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index bab33d798ae..069b66a11f2 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -1,14 +1,14 @@
 # Template file for 'gcc'
 _majorver=9
-_minorver=${_majorver}.1
+_minorver=${_majorver}.2
 _gmp_version=6.1.2
-_mpfr_version=4.0.1
+_mpfr_version=4.0.2
 _mpc_version=1.1.0
-_isl_version=0.19
+_isl_version=0.21
 
 pkgname=gcc
 version=${_minorver}.0
-revision=3
+revision=1
 short_desc="GNU Compiler Collection"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://gcc.gnu.org"
@@ -20,17 +20,18 @@ distfiles="
  https://www.mpfr.org/mpfr-${_mpfr_version}/mpfr-${_mpfr_version}.tar.xz
  ${GNU_SITE}/mpc/mpc-${_mpc_version}.tar.gz
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2"
-checksum="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+checksum="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
- 67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
+ 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
- d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8"
+ d18ca11f8ad1a39ab6d03d3dcb3365ab416720fcb65b42d69f34f51bf0a0e859"
 
 nopie=yes
 lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
+nocross=yes
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -69,12 +70,11 @@ if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
 	if [ -z "$CROSS_BUILD" ]; then
 		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
-		case "$XBPS_TARGET_MACHINE" in
-		*-musl)	# Go won't link for musl libc
-			;;
-		*)	subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
-			;;
-		esac
+		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
+		# we need this for gcc-go on musl
+		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
+			makedepends+=" libucontext-devel"
+		fi
 	fi
 fi
 
@@ -162,7 +162,10 @@ pre_configure() {
 	# _FORTIFY_SOURCE needs an optimization level.
 	sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
 	case "$XBPS_TARGET_MACHINE" in
-		*-musl) patch -p1 -i ${FILESDIR}/libgnarl-musl.patch ;;
+		*-musl)
+			patch -p1 -i ${FILESDIR}/libgnarl-musl.patch
+			patch -p0 -i ${FILESDIR}/gccgo-musl.patch
+			;;
 	esac
 }
 do_configure() {
@@ -225,13 +228,7 @@ do_configure() {
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,fortran,lto"
-		case "$XBPS_TARGET_MACHINE" in
-			*-musl)	# Linking libgo.so is broken for musl libc
-				;;
-			*)	_langs+=",go"
-				;;
-		esac
+		_langs="c,c++,objc,obj-c++,go,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi

From f4a95f4a278f64c80b9e7d877884c5a456d42bf9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 7 Sep 2019 22:14:40 +0200
Subject: [PATCH 02/25] cross-aarch64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-gnu/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-gnu/template b/srcpkgs/cross-aarch64-linux-gnu/template
index e4f1544040e..cecc02ec7b8 100644
--- a/srcpkgs/cross-aarch64-linux-gnu/template
+++ b/srcpkgs/cross-aarch64-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-aarch64-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=aarch64-linux-gnu
@@ -10,7 +10,7 @@ _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Leah Neukirchen <leah@vuxu.org>"
@@ -22,15 +22,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -94,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -234,7 +233,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -250,7 +249,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -334,6 +332,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ee8bbf9acaff06515c7a0c38974b8777e895c42d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:03:19 +0200
Subject: [PATCH 03/25] cross-aarch64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-aarch64-linux-musl/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-aarch64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index a40e53f532e..7fc76c3d726 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-aarch64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=aarch64-linux-musl
 _archflags="-march=armv8-a"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,11 +21,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="x86_64* ppc64le"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,10 +84,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -153,6 +156,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=aarch64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -208,6 +227,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -263,6 +283,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 57ba6b18eed6e7445270ae2b9d67b98358ef4726 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:27:36 +0200
Subject: [PATCH 04/25] cross-x86_64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-x86_64-linux-musl/template      | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-x86_64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-x86_64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-x86_64-linux-musl/template b/srcpkgs/cross-x86_64-linux-musl/template
index 2f6a2a4241d..349eacf973c 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -1,16 +1,17 @@
 # Template file for 'cross-x86_64-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=x86_64-linux-musl
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 archs="i686* x86_64 ppc64le"
 short_desc="Cross toolchain for x86_64 with musl"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,10 +86,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
 	sed -i 's/lib64/lib/' gcc/config/i386/linux64.h
@@ -158,6 +161,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86_64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -171,7 +190,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -213,6 +232,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -264,6 +284,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a852d18f0a3144844fc16122749fe9898583e90a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:33:03 +0200
Subject: [PATCH 05/25] cross-powerpc64le-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-musl/template | 44 +++++++++++++++----
 4 files changed, 37 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 7e75d7b1c5c..475f2f725ca 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64le-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64le-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64le with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,14 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +165,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +196,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
@@ -219,6 +239,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +291,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 62adb1e3cb4fc560d66c37c17130b4071d0726c1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:36:30 +0200
Subject: [PATCH 06/25] cross-powerpc64-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-musl/template   | 44 +++++++++++++++----
 4 files changed, 37 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch b/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index d3a9a758fe9..ea2800df634 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -1,15 +1,16 @@
 # Template file for 'cross-powerpc64-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet="powerpc64-linux-musl"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for powerpc64 with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -18,18 +19,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,13 +84,14 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
@@ -161,6 +165,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc64 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -176,7 +196,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-decimal-float=no"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpc-linux"
@@ -219,6 +239,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -270,6 +291,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From ff81242ebdaaf5271929e9cd1f712074989aab58 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:40:18 +0200
Subject: [PATCH 07/25] cross-powerpc-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-musl/template     | 63 +++++++++++++------
 3 files changed, 44 insertions(+), 21 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-powerpc-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index 856e8fb0885..9d61d406ace 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -1,9 +1,9 @@
-# Template build file for 'cross-powerpc-linux-musl'
-#
+# Template file for 'cross-powerpc-linux-musl'
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=powerpc-linux-musl
 _fpuflags=
@@ -11,8 +11,8 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 
 short_desc="Cross toolchain for PowerPC (musl)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -21,13 +21,14 @@ license="GPL-3.0-or-later, GPL-2.0-only, MIT"
 distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
+ http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
- http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz"
-checksum="
- 0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
+checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
- 8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa"
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -36,7 +37,7 @@ nodebug=yes
 create_wrksrc=yes
 
 archs="i686* x86_64* ppc64*"
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -86,13 +87,13 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/0010-ldbl128-config.patch
 	_apply_patch -p0 ${FILESDIR}/libgcc-musl-ldbl128-config.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -166,6 +167,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=ppc libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -181,7 +198,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-default-pie"
@@ -226,6 +243,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -268,15 +286,20 @@ do_install() {
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc.so.1
 	ln -sf libc.so ${DESTDIR}/${_sysroot}/usr/lib/ld-musl-powerpc-sf.so.1
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 7617221f04a76008a1dac4a2b26e7db46361b40a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:44:26 +0200
Subject: [PATCH 08/25] cross-arm-linux-musleabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabi/template     | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabi/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index f1434fe9b26..985af935aac 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabi
 _fpuflags="--with-arch=armv5te --without-fp --with-float=soft"
@@ -11,8 +12,8 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv5 TE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -169,7 +188,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -211,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -261,6 +281,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 9a88f06468900106b22fa394f523985110a3d9d5 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:46:45 +0200
Subject: [PATCH 09/25] cross-arm-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-musleabihf/template   | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index 6b9194ebc65..a5b5fc028c7 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-arm-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=arm-linux-musleabihf
 _fpuflags="--with-arch=armv6 --with-fpu=vfp --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv6 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +158,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +187,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -210,6 +229,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -260,6 +280,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 942adf56fa65937a796db207d3272515812c05f1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:49:32 +0200
Subject: [PATCH 10/25] cross-armv7l-linux-musleabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 .../cross-armv7l-linux-musleabihf/template    | 43 +++++++++++++++----
 3 files changed, 35 insertions(+), 10 deletions(-)
 create mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-musleabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 37daba36ac9..5704eb067a9 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -1,9 +1,10 @@
 # Template build file for 'cross-armv7l-linux-musleabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=armv7l-linux-musleabihf
 _fpuflags="--with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard"
@@ -11,8 +12,8 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for ARMv7 LE Hard Float target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -21,11 +22,13 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
@@ -33,7 +36,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,10 +87,10 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -156,6 +159,22 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=arm libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 
@@ -170,7 +189,7 @@ _gcc_build() {
 	_args="--prefix=/usr"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -212,6 +231,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -262,6 +282,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From a2aa6268834894cb2323ad92a55fabd0433bb4d0 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:53:27 +0200
Subject: [PATCH 11/25] cross-i686-linux-musl: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/gccgo-musl.patch                    |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-linux-musl/template        | 47 +++++++++++++++----
 4 files changed, 38 insertions(+), 12 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/bug90756.patch
 create mode 120000 srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
 delete mode 120000 srcpkgs/cross-i686-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch b/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
new file mode 120000
index 00000000000..a093af85773
--- /dev/null
+++ b/srcpkgs/cross-i686-linux-musl/files/gccgo-musl.patch
@@ -0,0 +1 @@
+../../gcc/files/gccgo-musl.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch b/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 905bacb0e27..25d8042180a 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -1,17 +1,18 @@
 # Template build file for 'cross-i686-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
+_libucontext_version=0.9.0
 
 _triplet=i686-linux-musl
 _sysroot="/usr/${_triplet}"
 _archflags="-march=i686"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=4
+version=0.32
+revision=1
 short_desc="Cross toolchain for i686 target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -20,18 +21,20 @@ distfiles="
  ${GNU_SITE}/binutils/binutils-${_binutils_version}.tar.xz
  ${GNU_SITE}/gcc/gcc-${_gcc_version}/gcc-${_gcc_version}.tar.xz
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
- ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
+ ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz
+ https://distfiles.adelielinux.org/source/libucontext/libucontext-${_libucontext_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
- 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
+ 0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1
+ 0d53a415a307ef175153bbe60a572c940a922cb736ce13530b666e7ec2795d68"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -83,12 +86,11 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
+	_apply_patch -p0 ${FILESDIR}/gccgo-musl.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -155,6 +157,25 @@ _musl_build() {
 	touch ${wrksrc}/.musl_build_done
 }
 
+_libucontext_build() {
+	[ -f ${wrksrc}/.libucontext_build_done ] && return 0
+
+	cd ${wrksrc}/libucontext-${_libucontext_version}
+	msg_normal "Building cross libucontext\n"
+
+	sed -i arch/x86/startcontext.S -e \
+	 "s;__i686.get_pc_thunk.bx;i686_get_pc_thunk_bx;g"
+
+	# it's ok if we're static only here
+	CC="${_triplet}-gcc" AR="${_triplet}-ar" AS="${_triplet}-as" \
+		CFLAGS="-Os -pipe ${_archflags}" \
+		make ARCH=x86 libucontext.a
+
+	cp libucontext.a ${_sysroot}/usr/lib
+
+	touch ${wrksrc}/.libucontext_build_done
+}
+
 _gcc_build() {
 	local _args
 	[ -f ${wrksrc}/.gcc_build_done ] && return 0
@@ -168,7 +189,7 @@ _gcc_build() {
 	_args="--target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --prefix=/usr"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
@@ -209,6 +230,7 @@ do_build() {
 	_gcc_bootstrap
 	_linux_headers
 	_musl_build
+	_libucontext_build
 	_gcc_build
 }
 
@@ -266,6 +288,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 2b663cf412958fb8f536c8d6a9ba762429697363 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 02:58:40 +0200
Subject: [PATCH 12/25] cross-mips-linux-musl: update for gcc-9.2.0 + objc(++)

---
 .../cross-mips-linux-musl/files/non-nullness.patch |  1 -
 srcpkgs/cross-mips-linux-musl/template             | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index a129e937dbf..213d288cafc 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From b73ddebe655c8a20869533295c01dee57e996c06 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:08:52 +0200
Subject: [PATCH 13/25] cross-mips-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mips-linux-muslhf/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mips-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index 5ad364ecf40..84892aa48ba 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mips-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 BE hardfloat target (musl)"
 maintainer="hipperson0 <hipperson0@gmail.com>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  https://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --libexecdir=/usr/lib"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 758e50bfd80b1eb82a3a4aea7e5e1a1c22ae64de Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:15:29 +0200
Subject: [PATCH 14/25] cross-mipsel-linux-musl: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-musl/template           | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-musl/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 1621d1005d5..20cbe0fed03 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-musl'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -msoft-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE softfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From e695439186bb09ce530f92abb348fb2b20f63e69 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:17:20 +0200
Subject: [PATCH 15/25] cross-mipsel-linux-muslhf: update for gcc-9.2.0 +
 objc(++)

---
 .../files/non-nullness.patch                       |  1 -
 srcpkgs/cross-mipsel-linux-muslhf/template         | 14 +++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)
 delete mode 120000 srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch b/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-mipsel-linux-muslhf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index 3f02ba22d27..d2a692b48fe 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -1,7 +1,7 @@
 # Template build file for 'cross-mipsel-linux-muslhf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _musl_version=1.1.23
 _linux_version=4.19
 
@@ -11,8 +11,8 @@ _archflags="-march=mips32r2 -mhard-float"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=3
+version=0.32
+revision=1
 short_desc="Cross toolchain for MIPS32r2 LE hardfloat target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -23,7 +23,7 @@ distfiles="
  http://www.musl-libc.org/releases/musl-${_musl_version}.tar.gz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  8a0feb41cef26c97dde382c014e68b9bb335c094bbc1356f6edaaf6b79bd14aa
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc flex perl python3"
 makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel isl15-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -84,7 +84,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/musl-ada.patch
 	_apply_patch -p1 ${FILESDIR}/libgnarl-musl.patch
 	_apply_patch -p0 ${FILESDIR}/invalid_tls_model.patch
@@ -169,7 +168,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,fortran,lto"
 	_args+=" --enable-libada"
 	_args+=" --enable-lto"
 	_args+=" --enable-default-pie"
@@ -180,6 +179,7 @@ _gcc_build() {
 	_args+=" --disable-libquadmath"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
+	_args+=" --disable-libatomic"
 	_args+=" --enable-shared"
 	_args+=" ${_fpuflags}"
 

From 0ac8266f483e3be1f9ffca9cb1453a8a44c11db9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:29:56 +0200
Subject: [PATCH 16/25] cross-powerpc64le-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64le-linux-gnu/template  | 21 ++++++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
 delete mode 120000 srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch b/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64le-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-gnu/template b/srcpkgs/cross-powerpc64le-linux-gnu/template
index 485f6bfe397..30bde74b769 100644
--- a/srcpkgs/cross-powerpc64le-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64le-linux-gnu/template
@@ -1,14 +1,14 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet="powerpc64le-linux-gnu"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU cross toolchain for the ${_triplet} targets (binutils/gcc/glibc)"
 maintainer="q66 <daniel@octaforge.org>"
@@ -20,8 +20,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -29,7 +29,7 @@ nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,7 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
@@ -241,7 +241,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
 	_args+=" --with-gnu-as"
@@ -338,6 +338,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 317088c13756361c7d6a31b38fdd72223aec3e1d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:32:21 +0200
Subject: [PATCH 17/25] cross-powerpc64-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/darn.patch                          |  1 +
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc64-linux-gnu/template    | 21 ++++++++++++-------
 3 files changed, 14 insertions(+), 9 deletions(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
 delete mode 120000 srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch b/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
new file mode 120000
index 00000000000..dc81f1f9657
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-gnu/files/darn.patch
@@ -0,0 +1 @@
+../../gcc/patches/darn.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc64-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-gnu/template b/srcpkgs/cross-powerpc64-linux-gnu/template
index 51973934ea6..9788de4ffc1 100644
--- a/srcpkgs/cross-powerpc64-linux-gnu/template
+++ b/srcpkgs/cross-powerpc64-linux-gnu/template
@@ -1,14 +1,14 @@
 # Template file for 'cross-powerpc64le-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet="powerpc64-linux-gnu"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU cross toolchain for the ${_triplet} targets (binutils/gcc/glibc)"
 maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
@@ -20,8 +20,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -29,7 +29,7 @@ nocross=yes
 nopie=yes
 nodebug=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
  libgnarl_pic.a libgnarl.a libgnat_pic.a libgnat.a"
@@ -81,7 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
+	_apply_patch -p0 ${FILESDIR}/darn.patch
 	_apply_patch -p0 ${FILESDIR}/ppc64-pure64.patch
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
@@ -241,7 +241,7 @@ _gcc_build() {
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
 	_args+=" --with-abi=elfv2"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --enable-secureplt"
 	_args+=" --enable-targets=powerpcle-linux"
 	_args+=" --with-gnu-as"
@@ -338,6 +338,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From d9b03a3b995805a9646b1aedc8861c1099306e62 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:38:58 +0200
Subject: [PATCH 18/25] cross-powerpc-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-powerpc-linux-gnu/template      | 40 ++++++++++---------
 2 files changed, 21 insertions(+), 20 deletions(-)
 delete mode 120000 srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-powerpc-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-gnu/template b/srcpkgs/cross-powerpc-linux-gnu/template
index d599721bad6..c36b8c1c307 100644
--- a/srcpkgs/cross-powerpc-linux-gnu/template
+++ b/srcpkgs/cross-powerpc-linux-gnu/template
@@ -1,8 +1,7 @@
-# Template build file for 'cross-powerpc-linux-gnu'
-#
+# Template file for 'cross-powerpc-linux-gnu'
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=powerpc-linux-gnu
@@ -10,7 +9,7 @@ _archflags="-mcpu=powerpc -msecure-plt"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} target (binutils/gcc/glibc)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -22,15 +21,15 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
 nocross=yes
 nopie=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -95,7 +94,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -236,7 +234,7 @@ _gcc_build() {
 	_args+=" --libdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -252,7 +250,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmudflap"
 	_args+=" --disable-libsanitizer"
@@ -328,14 +325,19 @@ do_install() {
 	cd ${wrksrc}/glibc-build
 	make install_root=${DESTDIR}/${_sysroot} install install-headers
 
-        # symlinks for gnarl and gnat shared libraries
-        _majorver=${_gcc_version%.*.*}
-        _adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
-        mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
-        ln -svf libgnarl-${_majorver}.so libgnarl.so
-        ln -svf libgnat-${_majorver}.so libgnat.so
-        rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
+	# symlinks for gnarl and gnat shared libraries
+	_majorver=${_gcc_version%.*.*}
+	_adalib=usr/lib/gcc/${_triplet}/${_gcc_version}/adalib
+	mv -v ${DESTDIR}/${_adalib}/libgnarl-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	mv -v ${DESTDIR}/${_adalib}/libgnat-${_majorver}.so ${DESTDIR}/${_sysroot}/usr/lib
+	ln -svf libgnarl-${_majorver}.so libgnarl.so
+	ln -svf libgnat-${_majorver}.so libgnat.so
+	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
+
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
 
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a

From 53fbe184a8e70c0a9bb8178dae38f89b2e2ff3a6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:40:23 +0200
Subject: [PATCH 19/25] cross-i686-pc-linux-gnu: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/bug90756.patch                      |  1 -
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-i686-pc-linux-gnu/template      | 24 ++++++++++---------
 3 files changed, 13 insertions(+), 13 deletions(-)
 delete mode 120000 srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
 delete mode 120000 srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch

diff --git a/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch b/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
deleted file mode 120000
index 02ae43b18b4..00000000000
--- a/srcpkgs/cross-i686-pc-linux-gnu/files/bug90756.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/bug90756.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch b/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-i686-pc-linux-gnu/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-pc-linux-gnu/template b/srcpkgs/cross-i686-pc-linux-gnu/template
index 34dc2a3827e..c5b0e414cae 100644
--- a/srcpkgs/cross-i686-pc-linux-gnu/template
+++ b/srcpkgs/cross-i686-pc-linux-gnu/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-i686-pc-linux-gnu'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=i686-pc-linux-gnu
@@ -10,8 +10,8 @@ _archflags="-march=i686 -mtune=generic"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
-revision=2
+version=0.32
+revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -22,8 +22,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 archs="armv6l armv7l x86_64"
@@ -32,7 +32,7 @@ nopie=yes
 nodebug=yes
 lib32disabled=yes
 create_wrksrc=yes
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -81,9 +81,7 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 	_apply_patch -p0 ${FILESDIR}/no-stack_chk_fail_local.patch
-	_apply_patch -p0 ${FILESDIR}/bug90756.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -235,7 +233,7 @@ _gcc_build() {
 	_args+=" --prefix=/usr"
 	_args+=" --libdir=/usr/lib"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -252,7 +250,6 @@ _gcc_build() {
 	_args+=" --enable-default-ssp"
 	_args+=" --enable-gnu-indirect-function"
 	_args+=" --enable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -338,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From f693975534b81ec98d829f0ca1e53837cdb9a561 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:42:23 +0200
Subject: [PATCH 20/25] cross-arm-linux-gnueabi: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-gnueabi/template      | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch b/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-gnueabi/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-gnueabi/template b/srcpkgs/cross-arm-linux-gnueabi/template
index 53b16264218..99b23a88538 100644
--- a/srcpkgs/cross-arm-linux-gnueabi/template
+++ b/srcpkgs/cross-arm-linux-gnueabi/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-arm-linux-gnueabi'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=arm-linux-gnueabi
@@ -11,7 +11,7 @@ _archflags="-march=armv5te -msoft-float -mfloat-abi=soft"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -97,7 +97,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -238,7 +237,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -255,7 +254,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -337,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 229aea4fc588ded950880719578ede2b7a50ebe1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:44:02 +0200
Subject: [PATCH 21/25] cross-arm-linux-gnueabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-arm-linux-gnueabihf/template    | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch b/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-arm-linux-gnueabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-gnueabihf/template b/srcpkgs/cross-arm-linux-gnueabihf/template
index 32006480282..85a724d3c87 100644
--- a/srcpkgs/cross-arm-linux-gnueabihf/template
+++ b/srcpkgs/cross-arm-linux-gnueabihf/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-arm-linux-gnueabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=arm-linux-gnueabihf
@@ -11,7 +11,7 @@ _archflags="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  ${GNU_SITE}/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -98,7 +98,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -238,7 +237,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -255,7 +254,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -337,6 +335,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 8d89413b2fad6d95dc25fc0e3abd4fc32e1418b6 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:46:29 +0200
Subject: [PATCH 22/25] cross-armv7l-linux-gnueabihf: update for gcc-9.2.0 +
 go/objc(++)

---
 .../files/non-nullness.patch                  |  1 -
 srcpkgs/cross-armv7l-linux-gnueabihf/template | 21 +++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)
 delete mode 120000 srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch

diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch b/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch
deleted file mode 120000
index c8b653748fe..00000000000
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/files/non-nullness.patch
+++ /dev/null
@@ -1 +0,0 @@
-../../gcc/patches/non-nullness.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-gnueabihf/template b/srcpkgs/cross-armv7l-linux-gnueabihf/template
index 23864834772..bb60304d610 100644
--- a/srcpkgs/cross-armv7l-linux-gnueabihf/template
+++ b/srcpkgs/cross-armv7l-linux-gnueabihf/template
@@ -1,8 +1,8 @@
 # Template build file for 'cross-armv7l-linux-gnueabihf'
 #
 _binutils_version=2.32
-_gcc_version=9.1.0
-_glibc_version=2.29
+_gcc_version=9.2.0
+_glibc_version=2.30
 _linux_version=4.19
 
 _triplet=armv7l-linux-gnueabihf
@@ -11,7 +11,7 @@ _archflags="-march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard"
 _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
-version=0.31
+version=0.32
 revision=1
 short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -23,8 +23,8 @@ distfiles="
  http://ftp.gnu.org/gnu/glibc/glibc-${_glibc_version}.tar.xz
  ${KERNEL_SITE}/kernel/v4.x/linux-${_linux_version}.tar.xz"
 checksum="0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
- f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ e2c4114e569afbe7edbc29131a43be833850ab9a459d81beb2588016d2bbb8af
  0c68f5655528aed4f99dae71a5b259edc93239fa899e2df79c055275c21749a1"
 
 lib32disabled=yes
@@ -33,7 +33,7 @@ nopie=yes
 nodebug=yes
 create_wrksrc=yes
 
-hostmakedepends="flex perl python3"
+hostmakedepends="gcc-objc gcc-go flex perl python3"
 makedepends="isl15-devel libmpc-devel zlib-devel"
 depends="${pkgname}-libc-${version}_${revision}"
 nostrip_files="libcaf_single.a libgcc.a libgcov.a libgcc_eh.a
@@ -98,7 +98,6 @@ _gcc_bootstrap() {
 
 	cd ${wrksrc}/gcc-${_gcc_version}
 	_apply_patch -p0 ${FILESDIR}/fix-cxxflags-passing.patch
-	_apply_patch -p0 ${FILESDIR}/non-nullness.patch
 
 	msg_normal "Building cross gcc bootstrap\n"
 
@@ -239,7 +238,7 @@ _gcc_build() {
 	_args+=" --libexecdir=/usr/lib"
 	_args+=" --target=${_triplet}"
 	_args+=" --with-sysroot=${_sysroot}"
-	_args+=" --enable-languages=c,ada,c++,fortran,lto"
+	_args+=" --enable-languages=c,ada,c++,objc,obj-c++,go,fortran,lto"
 	_args+=" --with-gnu-as"
 	_args+=" --with-gnu-ld"
 	_args+=" --disable-multilib"
@@ -256,7 +255,6 @@ _gcc_build() {
 	_args+=" --enable-default-pie"
 	_args+=" --enable-default-ssp"
 	_args+=" --disable-libquadmath"
-	_args+=" --disable-libatomic"
 	_args+=" --disable-libssp"
 	_args+=" --disable-libmpx"
 	_args+=" --disable-libmudflap"
@@ -338,6 +336,11 @@ do_install() {
 	ln -svf libgnat-${_majorver}.so libgnat.so
 	rm -vf ${DESTDIR}/${_adalib}/libgna{rl,t}.so
 
+	# We need to build libatomic in target gcc as gccgo needs it to
+	# build... but it's not needed at runtime, so remove it from the
+	# destdir so it doesn't conflict with the libatomic package
+	rm -f ${DESTDIR}/${_sysroot}/usr/lib/libatomic.*
+
 	# Remove unnecessary stuff
 	rm -f ${DESTDIR}/usr/lib*/libiberty.a
 	rm -rf ${DESTDIR}/usr/share

From 01836066b5abb28d1de1490936a54fa30c85cbbc Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:52:10 +0200
Subject: [PATCH 23/25] cross-vpkg-dummy: update to 0.32

---
 srcpkgs/cross-vpkg-dummy/template | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/cross-vpkg-dummy/template b/srcpkgs/cross-vpkg-dummy/template
index d763d7f14c4..6d29b14f73a 100644
--- a/srcpkgs/cross-vpkg-dummy/template
+++ b/srcpkgs/cross-vpkg-dummy/template
@@ -1,7 +1,7 @@
 # Template file for 'cross-vpkg-dummy'
 pkgname=cross-vpkg-dummy
-version=0.31
-revision=2
+version=0.32
+revision=1
 build_style=meta
 short_desc="Dummy meta-pkg for cross building packages with xbps-src"
 maintainer="Orphaned <orphan@voidlinux.org>"
@@ -20,9 +20,16 @@ provides="
 	libstdc++-devel-9999_1
 	libgfortran-9999_1
 	libgfortran-devel-9999_1
+	libgo-9999_1
+	libgo-devel-9999_1
+	libobjc-9999_1
+	libobjc-devel-9999_1
 	gcc-9999_1
 	gcc-fortran-9999_1
-	gcc-ada-9999_1"
+	gcc-ada-9999_1
+	gcc-go-9999_1
+	gcc-objc-9999_1
+	gcc-objc++-9999_1"
 conflicts="
 	kernel-libc-headers>=0
 	binutils>=0
@@ -33,9 +40,16 @@ conflicts="
 	libstdc++-devel>=0
 	libgfortran>=0
 	libgfortran-devel>=0
+	libgo>=0
+	libgo-devel>=0
+	libobjc>=0
+	libobjc-devel>=0
 	gcc>=0
 	gcc-fortran>=0
-	gcc-ada>=0"
+	gcc-ada>=0
+	gcc-go>=0
+	gcc-objc>=0
+	gcc-objc++>=0"
 shlib_provides="
 	libgcc_s.so.1
 	libgnat-9.so

From eebf669b42b9c1efa317deaedbb31f168cbb71a4 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 00:57:20 +0200
Subject: [PATCH 24/25] gcc: reenable on cross and enable go/objc(++) for cross
 targets

Except mips*-musl, as it doesn't have libucontext support yet.

[ci skip]
---
 srcpkgs/gcc/template | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gcc/template b/srcpkgs/gcc/template
index 069b66a11f2..6774b8a5826 100644
--- a/srcpkgs/gcc/template
+++ b/srcpkgs/gcc/template
@@ -31,7 +31,13 @@ lib32disabled=yes
 bootstrap=yes
 replaces="gcc-gcj<7.2.0 gcc-gcj-jdk-compat<7.2.0 libmpx>=0 libmpx-devel>=0"
 alternatives="cc:cc:/usr/bin/gcc"
-nocross=yes
+
+_have_gccgo=yes
+
+# MIPS does not have libucontext yet
+case "$XBPS_TARGET_MACHINE" in
+	mips*-musl) _have_gccgo=no ;;
+esac
 
 if [ "$CHROOT_READY" ]; then
 	hostmakedepends="perl flex"
@@ -68,8 +74,8 @@ fi
 
 if [ "$CHROOT_READY" ]; then
 	subpackages+=" gcc-fortran libgfortran-devel libgfortran"
-	if [ -z "$CROSS_BUILD" ]; then
-		subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	subpackages+=" gcc-objc gcc-objc++ libobjc-devel libobjc"
+	if [ "$_have_gccgo" = "yes" ]; then
 		subpackages+=" gcc-go gcc-go-tools libgo-devel libgo"
 		# we need this for gcc-go on musl
 		if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
@@ -129,7 +135,6 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 if [ "$CROSS_BUILD" ]; then
 	hostmakedepends+=" cross-${_triplet}"
-	export GFORTRAN_FOR_TARGET=" ${_triplet}-gfortran"
 	if [ "$build_option_ada" ]; then
 		hostmakedepends+=" gcc-ada libada-devel"
 	fi
@@ -219,20 +224,26 @@ do_configure() {
 		export CC_FOR_TARGET="$CC"
 		export GCC_FOR_TARGET="$CC"
 		export CXX_FOR_TARGET="$CXX"
+		export GOC_FOR_TARGET="${_triplet}-gccgo"
+		export GFORTRAN_FOR_TARGET="${_triplet}-gfortran"
 
 		_args+=" --host=$XBPS_CROSS_TRIPLET"
 		_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
 		_args+=" --enable-sjlj-exceptions=no"
-		_langs+=",fortran"
+		_langs+=",objc,obj-c++,fortran"
 	elif [ -z "$CHROOT_READY" ]; then
 		export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
 		_args+=" --build=${_triplet}"
 	else
-		_langs="c,c++,objc,obj-c++,go,fortran,lto"
+		_langs="c,c++,objc,obj-c++,fortran,lto"
 		_args+=" --build=${_triplet}"
 		_args+=" --enable-fast-character"
 	fi
 
+	if [ "$_have_gccgo" = "yes" ]; then
+		_langs+=",go"
+	fi
+
 	case "$XBPS_TARGET_MACHINE" in
 		*-musl) _args+=" --disable-libsanitizer";;
 	esac

From a8a070fee027603fc4d10652a6c5f801286cc09a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sun, 8 Sep 2019 03:54:41 +0200
Subject: [PATCH 25/25] cross-x86_64-w64-mingw32: update for gcc-9.2.0

[ci skip]
---
 srcpkgs/cross-x86_64-w64-mingw32/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/cross-x86_64-w64-mingw32/template b/srcpkgs/cross-x86_64-w64-mingw32/template
index 2e5bc454ba8..ccc30402e15 100644
--- a/srcpkgs/cross-x86_64-w64-mingw32/template
+++ b/srcpkgs/cross-x86_64-w64-mingw32/template
@@ -1,5 +1,5 @@
 # Template file for 'cross-x86_64-w64-mingw32'
-_gcc_version=9.1.0
+_gcc_version=9.2.0
 _binutils_version=2.32
 _gmp_version=6.1.2
 _mpfr_version=4.0.1
@@ -9,7 +9,7 @@ _mingw_version=6.0.0
 
 pkgname=cross-x86_64-w64-mingw32
 version=$_mingw_version
-revision=2
+revision=3
 archs="x86_64* i686*"
 create_wrksrc=yes
 hostmakedepends="flex perl python3"
@@ -31,7 +31,7 @@ distfiles="
  http://isl.gforge.inria.fr/isl-${_isl_version}.tar.bz2
  ${SOURCEFORGE_SITE}/project/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${_mingw_version}.tar.bz2"
 checksum="de38b15c902eb2725eac6af21183a5f34ea4634cb0bcef19612b50e5ed31072d
- 79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+ ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
  6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e
  87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912
  67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (18 preceding siblings ...)
  2019-09-08 15:30 ` voidlinux-github
@ 2019-09-08 19:02 ` voidlinux-github
  2019-09-08 19:03 ` voidlinux-github
  2019-09-08 20:12 ` [PR PATCH] [Closed]: " voidlinux-github
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08 19:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

New comment by jnbr on void-packages repository

https://github.com/void-linux/void-packages/pull/14289#issuecomment-529232012

Comment:
Tested on x86_64[-musl], aarch64-musl and armv7hf.
I found no new issues, uncaught exceptions on aarch64-musl still segfault but this is broken for a while and shouldn't block things.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (19 preceding siblings ...)
  2019-09-08 19:02 ` voidlinux-github
@ 2019-09-08 19:03 ` voidlinux-github
  2019-09-08 20:12 ` [PR PATCH] [Closed]: " voidlinux-github
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08 19:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/14289#issuecomment-529232202

Comment:
Cool. I'm building big software with the toolchain already (webkit etc) and everything seems to be fine on my side too.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PR PATCH] [Closed]: gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
  2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
                   ` (20 preceding siblings ...)
  2019-09-08 19:03 ` voidlinux-github
@ 2019-09-08 20:12 ` voidlinux-github
  21 siblings, 0 replies; 23+ messages in thread
From: voidlinux-github @ 2019-09-08 20:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]

There's a closed pull request on the void-packages repository

gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets
https://github.com/void-linux/void-packages/pull/14289

Description:
This updates `gcc` to 9.2.0 and while doing that, enables `gcc-go` on `musl`. It also enables `go`, `objc` and `objc++` support in crosstoolchains, allowing us to also enable them for cross targets. That mainly means our cross targets and native targets will all have `gcc` built with the same languages and subpackages, which should be a lot easier to deal with (and possibly enable crosscompiling for some GNUstep stuff etc)

(except on `mips*-musl`, as `libucontext` does not have MIPS support yet, so only enable `objc` and `objc++` on those)

Crosstoolchains updates:

- [x] aarch64
- [x] aarch64-musl
- [x] armv5tel
- [x] armv5tel-musl
- [x] armv6l
- [x] armv6l-musl
- [x] armv7l
- [x] armv7l-musl
- [x] i686
- [x] i686-musl
- [x] mips-musl
- [x] mipshf-musl
- [x] mipsel-musl
- [x] mipselhf-musl
- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [x] ppc64-musl
- [x] ppc
- [x] ppc-musl
- [x] x86_64-musl

Testing:

- [x] ppc64le
- [x] ppc64le-musl
- [x] ppc64
- [x] ppc64-musl
- [x] ppc
- [x] ppc-musl
- [ ] x86_64
- [ ] x86_64-musl
- [x] aarch64 (build)
- [x] aarch64-musl (build)
- [ ] armv7l (build)

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-09-08 20:12 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-07 17:35 [PR PATCH] [WIP] gcc: update to 9.2.0 and enable gcc-go on musl voidlinux-github
2019-09-07 18:18 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-07 18:18 ` voidlinux-github
2019-09-07 18:19 ` voidlinux-github
2019-09-07 18:19 ` voidlinux-github
2019-09-07 18:59 ` voidlinux-github
2019-09-07 19:01 ` voidlinux-github
2019-09-07 23:45 ` voidlinux-github
2019-09-07 23:48 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-07 23:48 ` voidlinux-github
2019-09-07 23:52 ` voidlinux-github
2019-09-07 23:52 ` voidlinux-github
2019-09-08  1:20 ` [PR PATCH] [Updated] gcc: update to 9.2.0 and enable gcc-go on musl + go and objc/objc++ on cross targets voidlinux-github
2019-09-08  1:20 ` voidlinux-github
2019-09-08  1:56 ` voidlinux-github
2019-09-08  1:56 ` voidlinux-github
2019-09-08  2:27 ` voidlinux-github
2019-09-08 10:31 ` voidlinux-github
2019-09-08 15:30 ` [PR PATCH] [Updated] " voidlinux-github
2019-09-08 15:30 ` voidlinux-github
2019-09-08 19:02 ` voidlinux-github
2019-09-08 19:03 ` voidlinux-github
2019-09-08 20:12 ` [PR PATCH] [Closed]: " voidlinux-github

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).