1
0

011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From ea650cae26da4a8fc04f0c4666f4dd776d0b5fc0 Mon Sep 17 00:00:00 2001
  2. From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
  3. Date: Sun, 14 Nov 2021 21:54:25 -0800
  4. Subject: [PATCH] configure: define TARGET_LIBC_GNUSTACK on musl
  5. musl only uses PT_GNU_STACK to set default thread stack size and has no
  6. executable stack support[0], so there is no reason not to emit the
  7. .note.GNU-stack section on musl builds.
  8. [0]: https://lore.kernel.org/all/20190423192534.GN23599@brightrain.aerifal.cx/T/#u
  9. gcc/ChangeLog:
  10. * configure: Regenerate.
  11. * configure.ac: define TARGET_LIBC_GNUSTACK on musl
  12. Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
  13. ---
  14. gcc/configure | 3 +++
  15. gcc/configure.ac | 3 +++
  16. 2 files changed, 6 insertions(+)
  17. --- a/gcc/configure
  18. +++ b/gcc/configure
  19. @@ -31533,6 +31533,9 @@ fi
  20. # Check if the target LIBC handles PT_GNU_STACK.
  21. gcc_cv_libc_gnustack=unknown
  22. case "$target" in
  23. + mips*-*-linux-musl*)
  24. + gcc_cv_libc_gnustack=yes
  25. + ;;
  26. mips*-*-linux*)
  27. if test $glibc_version_major -gt 2 \
  28. --- a/gcc/configure.ac
  29. +++ b/gcc/configure.ac
  30. @@ -7023,6 +7023,9 @@ fi
  31. # Check if the target LIBC handles PT_GNU_STACK.
  32. gcc_cv_libc_gnustack=unknown
  33. case "$target" in
  34. + mips*-*-linux-musl*)
  35. + gcc_cv_libc_gnustack=yes
  36. + ;;
  37. mips*-*-linux*)
  38. GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )
  39. ;;