903-libstdc++-libgfortran-gthr-workaround-for-musl.patch 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. libstdc++, libgfortran gthr workaround for musl
  6. On behalf of szabolcs.nagy@arm.com
  7. [libstdc++-v3/]
  8. 2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
  9. * config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define.
  10. * configure.host (os_include_dir): Set to "os/generic" for linux-musl*.
  11. [libgfortran/]
  12. 2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
  13. * acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*.
  14. * configure: Regenerate.
  15. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222329 138bc75d-0d04-0410-961f-82ee72b054a4
  16. ---
  17. Index: b/libgfortran/acinclude.m4
  18. ===================================================================
  19. --- a/libgfortran/acinclude.m4
  20. +++ b/libgfortran/acinclude.m4
  21. @@ -100,7 +100,7 @@
  22. [Define to 1 if the target supports #pragma weak])
  23. fi
  24. case "$host" in
  25. - *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
  26. + *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
  27. AC_DEFINE(GTHREAD_USE_WEAK, 0,
  28. [Define to 0 if the target shouldn't use #pragma weak])
  29. ;;
  30. Index: b/libgfortran/configure
  31. ===================================================================
  32. --- a/libgfortran/configure
  33. +++ b/libgfortran/configure
  34. @@ -26447,7 +26447,7 @@
  35. fi
  36. case "$host" in
  37. - *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
  38. + *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
  39. $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
  40. Index: b/libstdc++-v3/config/os/generic/os_defines.h
  41. ===================================================================
  42. --- a/libstdc++-v3/config/os/generic/os_defines.h
  43. +++ b/libstdc++-v3/config/os/generic/os_defines.h
  44. @@ -33,4 +33,9 @@
  45. // System-specific #define, typedefs, corrections, etc, go here. This
  46. // file will come before all others.
  47. +// Disable the weak reference logic in gthr.h for os/generic because it
  48. +// is broken on every platform unless there is implementation specific
  49. +// workaround in gthr-posix.h and at link-time for static linking.
  50. +#define _GLIBCXX_GTHREAD_USE_WEAK 0
  51. +
  52. #endif
  53. Index: b/libstdc++-v3/configure.host
  54. ===================================================================
  55. --- a/libstdc++-v3/configure.host
  56. +++ b/libstdc++-v3/configure.host
  57. @@ -271,6 +271,9 @@
  58. freebsd*)
  59. os_include_dir="os/bsd/freebsd"
  60. ;;
  61. + linux-musl*)
  62. + os_include_dir="os/generic"
  63. + ;;
  64. gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
  65. if [ "$uclibc" = "yes" ]; then
  66. os_include_dir="os/uclibc"