libstdc++, libgfortran gthr workaround for musl
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 22 Apr 2015 14:24:11 +0000 (14:24 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Wed, 22 Apr 2015 14:24:11 +0000 (14:24 +0000)
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

libgfortran/ChangeLog
libgfortran/acinclude.m4
libgfortran/configure
libstdc++-v3/ChangeLog
libstdc++-v3/config/os/generic/os_defines.h
libstdc++-v3/configure.host

index 2df9030d058c45ddbf10fb69345c3d13260cc43b..3a037f21404e930b646fcaa399bdb06f4a3a02b5 100644 (file)
@@ -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
index ba890f9839118840c0a8560e1e5ef0aafb0a75fe..30b8b1a629198c7f5570798655dd1a3ef6adc1b3 100644 (file)
@@ -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])
       ;;
index e1592f732492de2c9aa27c3a5749d6c85aa5d500..07542e1387d99f9756aa24d03de1a7709670b745 100755 (executable)
@@ -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
 
index 12f87c35b11737ca7bd703fc10c44d6a8635f06a..c5c151d63ced9e36a8cbcc9d0ebde89215ea6368 100644 (file)
@@ -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.
index 45bf52a57c18e0770794dcd041c06e07047e9504..103ec0e803fadaaa13f0fe80f7c7059e9e0a85eb 100644 (file)
@@ -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
index 82ddc5240920b83c746e97c24bdef635e5bfeffb..a349ce3dbd9ee0aef18680ce5aef4b7360b31a2b 100644 (file)
@@ -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"