musl only uses PT_GNU_STACK to set default thread stack size and has no
executable stack support[0], so there is no reason not to emit the
.note.GNU-stack section on musl builds.

[0]: 
https://lore.kernel.org/all/20190423192534.gn23...@brightrain.aerifal.cx/T/#u

gcc/ChangeLog:

        * configure: Regenerate.
        * configure.ac: define TARGET_LIBC_GNUSTACK on musl

Signed-off-by: Ilya Lipnitskiy <ilya.lipnits...@gmail.com>
---
 gcc/configure    | 3 +++
 gcc/configure.ac | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/gcc/configure b/gcc/configure
index 920868bcd33d..366d6d969f45 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -31263,6 +31263,9 @@ if test $glibc_version_major -gt 2 \
   gcc_cv_libc_gnustack=yes
 fi
     ;;
+  mips*-*-linux-musl*)
+    gcc_cv_libc_gnustack=yes
+    ;;
 esac
 if test x$gcc_cv_libc_gnustack = xyes; then
 
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 065080a4b399..56d5bb7785a8 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6950,6 +6950,9 @@ case "$target" in
   mips*-*-linux*)
     GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )
     ;;
+  mips*-*-linux-musl*)
+    gcc_cv_libc_gnustack=yes
+    ;;
 esac
 if test x$gcc_cv_libc_gnustack = xyes; then
   AC_DEFINE(TARGET_LIBC_GNUSTACK, 1,
-- 
2.33.1

Reply via email to