1
0

209-musl_libstdc++.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. --- a/libgfortran/acinclude.m4
  18. +++ b/libgfortran/acinclude.m4
  19. @@ -100,7 +100,7 @@ void foo (void);
  20. [Define to 1 if the target supports #pragma weak])
  21. fi
  22. case "$host" in
  23. - *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
  24. + *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
  25. AC_DEFINE(GTHREAD_USE_WEAK, 0,
  26. [Define to 0 if the target shouldn't use #pragma weak])
  27. ;;
  28. --- a/libgfortran/configure
  29. +++ b/libgfortran/configure
  30. @@ -26456,7 +26456,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>con
  31. fi
  32. case "$host" in
  33. - *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
  34. + *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
  35. $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
  36. --- a/libstdc++-v3/config/os/generic/os_defines.h
  37. +++ b/libstdc++-v3/config/os/generic/os_defines.h
  38. @@ -33,4 +33,9 @@
  39. // System-specific #define, typedefs, corrections, etc, go here. This
  40. // file will come before all others.
  41. +// Disable the weak reference logic in gthr.h for os/generic because it
  42. +// is broken on every platform unless there is implementation specific
  43. +// workaround in gthr-posix.h and at link-time for static linking.
  44. +#define _GLIBCXX_GTHREAD_USE_WEAK 0
  45. +
  46. #endif
  47. --- a/libstdc++-v3/configure.host
  48. +++ b/libstdc++-v3/configure.host
  49. @@ -273,6 +273,9 @@ case "${host_os}" in
  50. freebsd*)
  51. os_include_dir="os/bsd/freebsd"
  52. ;;
  53. + linux-musl*)
  54. + os_include_dir="os/generic"
  55. + ;;
  56. gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
  57. if [ "$uclibc" = "yes" ]; then
  58. os_include_dir="os/uclibc"