summaryrefslogtreecommitdiff
path: root/etc/patches/gcc-4.7.4/musl-support/0005-libstdc-workaround-for-musl.patch
diff options
context:
space:
mode:
Diffstat (limited to 'etc/patches/gcc-4.7.4/musl-support/0005-libstdc-workaround-for-musl.patch')
-rw-r--r--etc/patches/gcc-4.7.4/musl-support/0005-libstdc-workaround-for-musl.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/etc/patches/gcc-4.7.4/musl-support/0005-libstdc-workaround-for-musl.patch b/etc/patches/gcc-4.7.4/musl-support/0005-libstdc-workaround-for-musl.patch
new file mode 100644
index 0000000..0b862e0
--- /dev/null
+++ b/etc/patches/gcc-4.7.4/musl-support/0005-libstdc-workaround-for-musl.patch
@@ -0,0 +1,50 @@
+From 6f30aa9b58c145331da46adad18dc38926252547 Mon Sep 17 00:00:00 2001
+From: Oliver Reiche <oliver.reiche@huawei.com>
+Date: Thu, 29 Jun 2023 17:02:18 +0200
+Subject: [PATCH 5/7] libstdc++ workaround for musl
+
+Backport from GCC 6.1.0
+ Git commit: 85da5c3024f731e719c4093314da8edcd1056527
+ Subversion revision: r222329
+
+Original description:
+ * config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define.
+ * configure.host (os_include_dir): Set to "os/generic" for linux-musl*.
+
+Co-authored-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
+---
+ libstdc++-v3/config/os/generic/os_defines.h | 5 +++++
+ libstdc++-v3/configure.host | 3 +++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/libstdc++-v3/config/os/generic/os_defines.h b/libstdc++-v3/config/os/generic/os_defines.h
+index 3199bf30b..b8d7c1636 100644
+--- a/libstdc++-v3/config/os/generic/os_defines.h
++++ b/libstdc++-v3/config/os/generic/os_defines.h
+@@ -33,4 +33,9 @@
+ // System-specific #define, typedefs, corrections, etc, go here. This
+ // file will come before all others.
+
++// Disable the weak reference logic in gthr.h for os/generic because it
++// is broken on every platform unless there is implementation specific
++// workaround in gthr-posix.h and at link-time for static linking.
++#define _GLIBCXX_GTHREAD_USE_WEAK 0
++
+ #endif
+diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
+index b0e2cd9ea..df7977151 100644
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -242,6 +242,9 @@ case "${host_os}" in
+ freebsd*)
+ os_include_dir="os/bsd/freebsd"
+ ;;
++ linux-musl*)
++ os_include_dir="os/generic"
++ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+ if [ "$uclibc" = "yes" ]; then
+ os_include_dir="os/uclibc"
+--
+2.30.2
+