From 6f30aa9b58c145331da46adad18dc38926252547 Mon Sep 17 00:00:00 2001 From: Oliver Reiche 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 --- 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