mt76: update to the latest version, adds a number of stability fixes
[openwrt.git] / toolchain / gcc / patches / 5.2.0 / 209-musl_libstdc++.patch
1 From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
2 Date: Wed, 22 Apr 2015 14:24:11 +0000 (+0000)
3 Subject: libstdc++, libgfortran gthr workaround for musl
4 X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=1e5f711c11cb80ce609db9e9c1d8b2da0f7b5b61
5
6 libstdc++, libgfortran gthr workaround for musl
7
8 On behalf of szabolcs.nagy@arm.com
9
10 [libstdc++-v3/]
11 2015-04-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>
12
13         * config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define.
14         * configure.host (os_include_dir): Set to "os/generic" for linux-musl*.
15
16 [libgfortran/]
17 2015-04-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>
18
19         * acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*.
20         * configure: Regenerate.
21
22
23
24 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222329 138bc75d-0d04-0410-961f-82ee72b054a4
25 ---
26
27 --- a/libgfortran/acinclude.m4
28 +++ b/libgfortran/acinclude.m4
29 @@ -100,7 +100,7 @@ void foo (void);
30               [Define to 1 if the target supports #pragma weak])
31    fi
32    case "$host" in
33 -    *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
34 +    *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
35        AC_DEFINE(GTHREAD_USE_WEAK, 0,
36                 [Define to 0 if the target shouldn't use #pragma weak])
37        ;;
38 --- a/libgfortran/configure
39 +++ b/libgfortran/configure
40 @@ -26447,7 +26447,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>con
41  
42    fi
43    case "$host" in
44 -    *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
45 +    *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
46  
47  $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
48  
49 --- a/libstdc++-v3/config/os/generic/os_defines.h
50 +++ b/libstdc++-v3/config/os/generic/os_defines.h
51 @@ -33,4 +33,9 @@
52  // System-specific #define, typedefs, corrections, etc, go here.  This
53  // file will come before all others.
54  
55 +// Disable the weak reference logic in gthr.h for os/generic because it
56 +// is broken on every platform unless there is implementation specific
57 +// workaround in gthr-posix.h and at link-time for static linking.
58 +#define _GLIBCXX_GTHREAD_USE_WEAK 0
59 +
60  #endif
61 --- a/libstdc++-v3/configure.host
62 +++ b/libstdc++-v3/configure.host
63 @@ -273,6 +273,9 @@ case "${host_os}" in
64    freebsd*)
65      os_include_dir="os/bsd/freebsd"
66      ;;
67 +  linux-musl*)
68 +    os_include_dir="os/generic"
69 +    ;;
70    gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
71      if [ "$uclibc" = "yes" ]; then
72        os_include_dir="os/uclibc"