aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2015-04-22 14:24:11 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2015-04-22 14:24:11 +0000
commit85da5c3024f731e719c4093314da8edcd1056527 (patch)
tree636830d5fd7cdbaddef6d5f2a37808ebcaf43d22
parent15aa7b447218e45da835472bbf4740ae00db9982 (diff)
downloadgcc-85da5c3024f731e719c4093314da8edcd1056527.zip
gcc-85da5c3024f731e719c4093314da8edcd1056527.tar.gz
gcc-85da5c3024f731e719c4093314da8edcd1056527.tar.bz2
libstdc++, libgfortran gthr workaround for musl
On behalf of szabolcs.nagy@arm.com [libstdc++-v3/] 2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com> * config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define. * configure.host (os_include_dir): Set to "os/generic" for linux-musl*. [libgfortran/] 2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com> * acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*. * configure: Regenerate. From-SVN: r222329
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/acinclude.m42
-rwxr-xr-xlibgfortran/configure2
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/config/os/generic/os_defines.h5
-rw-r--r--libstdc++-v3/configure.host3
6 files changed, 20 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 2df9030..3a037f2 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*.
+ * configure: Regenerate.
+
2015-04-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/65234
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index ba890f9..30b8b1a6 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -100,7 +100,7 @@ void foo (void);
[Define to 1 if the target supports #pragma weak])
fi
case "$host" in
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
AC_DEFINE(GTHREAD_USE_WEAK, 0,
[Define to 0 if the target shouldn't use #pragma weak])
;;
diff --git a/libgfortran/configure b/libgfortran/configure
index e1592f7..07542e1 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -26447,7 +26447,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>confdefs.h
fi
case "$host" in
- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
$as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 12f87c3..c5c151d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define.
+ * configure.host (os_include_dir): Set to "os/generic" for linux-musl*.
+
2015-04-22 Renlin Li <renlin.li@arm.com>
* testsuite/lib/dg-options.exp (dg-require-thread-fence): New.
diff --git a/libstdc++-v3/config/os/generic/os_defines.h b/libstdc++-v3/config/os/generic/os_defines.h
index 45bf52a..103ec0e 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 82ddc52..a349ce3 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -271,6 +271,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"