From 30409e9a1d91e64089b06046acab00b54e677e79 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:30:38 +0200
Subject: [PATCH 01/13] cross-x86_64-linux-musl: add libgomp tls patch

---
 srcpkgs/cross-x86_64-linux-musl/files/invalid_tls_model.patch | 1 +
 srcpkgs/cross-x86_64-linux-musl/template                      | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-x86_64-linux-musl/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-x86_64-linux-musl/files/invalid_tls_model.patch b/srcpkgs/cross-x86_64-linux-musl/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-x86_64-linux-musl/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.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 db5343cbafc..80c4a088850 100644
--- a/srcpkgs/cross-x86_64-linux-musl/template
+++ b/srcpkgs/cross-x86_64-linux-musl/template
@@ -10,7 +10,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 archs="i686* x86_64 ppc64le"
 short_desc="Cross toolchain for x86_64 with musl"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
@@ -86,6 +86,7 @@ _gcc_bootstrap() {
 	_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
 
 	sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
 	sed -i 's/lib64/lib/' gcc/config/i386/linux64.h

From f5907faba33b9b47c115caad44962e33f38a22e1 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:32:12 +0200
Subject: [PATCH 02/13] cross-aarch64-linux-musl: add libgomp tls patch

---
 srcpkgs/cross-aarch64-linux-musl/files/invalid_tls_model.patch | 1 +
 srcpkgs/cross-aarch64-linux-musl/template                      | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-aarch64-linux-musl/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-aarch64-linux-musl/files/invalid_tls_model.patch b/srcpkgs/cross-aarch64-linux-musl/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-aarch64-linux-musl/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index 6e234194955..8a939a85239 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -11,7 +11,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -84,6 +84,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From 4bafc2ce58eca31ae3dd320f96950644212a26eb Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:40:07 +0200
Subject: [PATCH 03/13] cross-arm-linux-musleabi: add libgomp tls patch

---
 srcpkgs/cross-arm-linux-musleabi/files/invalid_tls_model.patch | 1 +
 srcpkgs/cross-arm-linux-musleabi/template                      | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabi/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-arm-linux-musleabi/files/invalid_tls_model.patch b/srcpkgs/cross-arm-linux-musleabi/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabi/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabi/template b/srcpkgs/cross-arm-linux-musleabi/template
index f0596daf888..0b11b2d20c5 100644
--- a/srcpkgs/cross-arm-linux-musleabi/template
+++ b/srcpkgs/cross-arm-linux-musleabi/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for ARMv5 TE target (musl)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From e791bcd4ab1d1d74020da8ba8bd9f206e1588be2 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:42:43 +0200
Subject: [PATCH 04/13] cross-arm-linux-musleabihf: add libgomp tls patch

---
 .../cross-arm-linux-musleabihf/files/invalid_tls_model.patch   | 1 +
 srcpkgs/cross-arm-linux-musleabihf/template                    | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-arm-linux-musleabihf/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-arm-linux-musleabihf/files/invalid_tls_model.patch b/srcpkgs/cross-arm-linux-musleabihf/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-arm-linux-musleabihf/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-arm-linux-musleabihf/template b/srcpkgs/cross-arm-linux-musleabihf/template
index d1b050bfce6..4788bcb740d 100644
--- a/srcpkgs/cross-arm-linux-musleabihf/template
+++ b/srcpkgs/cross-arm-linux-musleabihf/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for ARMv6 LE Hard Float target (musl)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From c24d7c6ca82c565485acea9c7139444220da5001 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:43:07 +0200
Subject: [PATCH 05/13] cross-armv7l-linux-musleabihf: add libgomp tls patch

---
 .../files/invalid_tls_model.patch                              | 1 +
 srcpkgs/cross-armv7l-linux-musleabihf/template                 | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-armv7l-linux-musleabihf/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/files/invalid_tls_model.patch b/srcpkgs/cross-armv7l-linux-musleabihf/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-armv7l-linux-musleabihf/template b/srcpkgs/cross-armv7l-linux-musleabihf/template
index 33f481abd95..be629f57af7 100644
--- a/srcpkgs/cross-armv7l-linux-musleabihf/template
+++ b/srcpkgs/cross-armv7l-linux-musleabihf/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for ARMv7 LE Hard Float target (musl)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From b9e2d74d0a5480ebcf3ad326c5cd5344df228ab3 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:43:35 +0200
Subject: [PATCH 06/13] cross-i686-linux-musl: add libgomp tls patch

---
 srcpkgs/cross-i686-linux-musl/files/invalid_tls_model.patch | 1 +
 srcpkgs/cross-i686-linux-musl/template                      | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-i686-linux-musl/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-i686-linux-musl/files/invalid_tls_model.patch b/srcpkgs/cross-i686-linux-musl/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-i686-linux-musl/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-i686-linux-musl/template b/srcpkgs/cross-i686-linux-musl/template
index 8ee17c8d647..840e9c111ed 100644
--- a/srcpkgs/cross-i686-linux-musl/template
+++ b/srcpkgs/cross-i686-linux-musl/template
@@ -11,7 +11,7 @@ _archflags="-march=i686"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for i686 target (musl)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From 14877c7f31bd1d0ceabb1317f9f77061e4baf350 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:44:09 +0200
Subject: [PATCH 07/13] cross-mips-linux-musl: add libgomp tls patch

---
 srcpkgs/cross-mips-linux-musl/files/invalid_tls_model.patch | 1 +
 srcpkgs/cross-mips-linux-musl/template                      | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-mips-linux-musl/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-mips-linux-musl/files/invalid_tls_model.patch b/srcpkgs/cross-mips-linux-musl/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-mips-linux-musl/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-musl/template b/srcpkgs/cross-mips-linux-musl/template
index 909adb66231..fb3c15a8b50 100644
--- a/srcpkgs/cross-mips-linux-musl/template
+++ b/srcpkgs/cross-mips-linux-musl/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for MIPS32r2 BE softfloat target (musl)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From b74f145f99c489541028fba506289c52dfb52837 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:44:48 +0200
Subject: [PATCH 08/13] cross-mips-linux-muslhf: add libgomp tls patch

---
 srcpkgs/cross-mips-linux-muslhf/files/invalid_tls_model.patch | 1 +
 srcpkgs/cross-mips-linux-muslhf/template                      | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-mips-linux-muslhf/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-mips-linux-muslhf/files/invalid_tls_model.patch b/srcpkgs/cross-mips-linux-muslhf/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-mips-linux-muslhf/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mips-linux-muslhf/template b/srcpkgs/cross-mips-linux-muslhf/template
index 79e0313b4fa..dec00464d33 100644
--- a/srcpkgs/cross-mips-linux-muslhf/template
+++ b/srcpkgs/cross-mips-linux-muslhf/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for MIPS32r2 BE hardfloat target (musl)"
 maintainer="hipperson0 <hipperson0@gmail.com>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From f842de8673d17f7a302f96b6545a908387133981 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:45:23 +0200
Subject: [PATCH 09/13] cross-mipsel-linux-musl: add libgomp tls patch

---
 srcpkgs/cross-mipsel-linux-musl/files/invalid_tls_model.patch | 1 +
 srcpkgs/cross-mipsel-linux-musl/template                      | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-mipsel-linux-musl/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-mipsel-linux-musl/files/invalid_tls_model.patch b/srcpkgs/cross-mipsel-linux-musl/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-mipsel-linux-musl/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-musl/template b/srcpkgs/cross-mipsel-linux-musl/template
index 27a090a9916..ca8faac54ea 100644
--- a/srcpkgs/cross-mipsel-linux-musl/template
+++ b/srcpkgs/cross-mipsel-linux-musl/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for MIPS32r2 LE softfloat target (musl)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From a24dab7bc3ce08234a36a47a60a26b50a3589343 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:45:39 +0200
Subject: [PATCH 10/13] cross-mipsel-linux-muslhf: add libgomp tls patch

---
 .../cross-mipsel-linux-muslhf/files/invalid_tls_model.patch    | 1 +
 srcpkgs/cross-mipsel-linux-muslhf/template                     | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-mipsel-linux-muslhf/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-mipsel-linux-muslhf/files/invalid_tls_model.patch b/srcpkgs/cross-mipsel-linux-muslhf/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-mipsel-linux-muslhf/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-mipsel-linux-muslhf/template b/srcpkgs/cross-mipsel-linux-muslhf/template
index af841ed82bf..2fb5ef91cb0 100644
--- a/srcpkgs/cross-mipsel-linux-muslhf/template
+++ b/srcpkgs/cross-mipsel-linux-muslhf/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for MIPS32r2 LE hardfloat target (musl)"
 maintainer="Juan RP <xtraeme@voidlinux.org>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From beda80e0f123e77134db43029d3128ca68f3c509 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:46:03 +0200
Subject: [PATCH 11/13] cross-powerpc-linux-musl: add libgomp tls patch

---
 srcpkgs/cross-powerpc-linux-musl/files/invalid_tls_model.patch | 1 +
 srcpkgs/cross-powerpc-linux-musl/template                      | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-powerpc-linux-musl/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-powerpc-linux-musl/files/invalid_tls_model.patch b/srcpkgs/cross-powerpc-linux-musl/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-powerpc-linux-musl/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc-linux-musl/template b/srcpkgs/cross-powerpc-linux-musl/template
index 38adfc76157..92dcf918bf8 100644
--- a/srcpkgs/cross-powerpc-linux-musl/template
+++ b/srcpkgs/cross-powerpc-linux-musl/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 
 short_desc="Cross toolchain for PowerPC (musl)"
 maintainer="Thomas Batten <stenstorpmc@gmail.com>"
@@ -92,6 +92,7 @@ _gcc_bootstrap() {
 	_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
 
 	msg_normal "Building cross gcc bootstrap\n"
 

From e78f6fcd014ff134ea60b441020e0291b9859dcb Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:46:24 +0200
Subject: [PATCH 12/13] cross-powerpc64-linux-musl: add libgomp tls patch

---
 .../cross-powerpc64-linux-musl/files/invalid_tls_model.patch   | 1 +
 srcpkgs/cross-powerpc64-linux-musl/template                    | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-powerpc64-linux-musl/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-powerpc64-linux-musl/files/invalid_tls_model.patch b/srcpkgs/cross-powerpc64-linux-musl/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-powerpc64-linux-musl/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64-linux-musl/template b/srcpkgs/cross-powerpc64-linux-musl/template
index 6c1d96db582..5e8687935de 100644
--- a/srcpkgs/cross-powerpc64-linux-musl/template
+++ b/srcpkgs/cross-powerpc64-linux-musl/template
@@ -9,7 +9,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for powerpc64 with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 

From e39fc5c6af095b4461c14b161417edea84842d99 Mon Sep 17 00:00:00 2001
From: Johannes <johannes.brechtmann@gmail.com>
Date: Sat, 29 Jun 2019 23:46:56 +0200
Subject: [PATCH 13/13] cross-powerpc64le-linux-musl: add libgomp tls patch

[ci skip]
---
 .../cross-powerpc64le-linux-musl/files/invalid_tls_model.patch | 1 +
 srcpkgs/cross-powerpc64le-linux-musl/template                  | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
 create mode 120000 srcpkgs/cross-powerpc64le-linux-musl/files/invalid_tls_model.patch

diff --git a/srcpkgs/cross-powerpc64le-linux-musl/files/invalid_tls_model.patch b/srcpkgs/cross-powerpc64le-linux-musl/files/invalid_tls_model.patch
new file mode 120000
index 00000000000..8f276dc0538
--- /dev/null
+++ b/srcpkgs/cross-powerpc64le-linux-musl/files/invalid_tls_model.patch
@@ -0,0 +1 @@
+../../gcc/patches/invalid_tls_model.patch
\ No newline at end of file
diff --git a/srcpkgs/cross-powerpc64le-linux-musl/template b/srcpkgs/cross-powerpc64le-linux-musl/template
index 18aa4e447f3..6f95059e732 100644
--- a/srcpkgs/cross-powerpc64le-linux-musl/template
+++ b/srcpkgs/cross-powerpc64le-linux-musl/template
@@ -9,7 +9,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.31
-revision=1
+revision=2
 short_desc="Cross toolchain for powerpc64le with musl"
 maintainer="q66 <daniel@octaforge.org>"
 homepage="https://www.voidlinux.org/"
@@ -87,6 +87,7 @@ _gcc_bootstrap() {
 	_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
 
 	sed -i 's/lib64/lib/' gcc/config/rs6000/linux64.h
 
