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
6 musl only uses PT_GNU_STACK to set default thread stack size and has no
7 executable stack support[0], so there is no reason not to emit the
8 .note.GNU-stack section on musl builds.
10 [0]: https://lore.kernel.org/all/20190423192534.GN23599@brightrain.aerifal.cx/T/#u
14 * configure: Regenerate.
15 * configure.ac: define TARGET_LIBC_GNUSTACK on musl
17 Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
20 gcc/configure.ac | 3 +++
21 2 files changed, 6 insertions(+)
25 @@ -31533,6 +31533,9 @@ fi
26 # Check if the target LIBC handles PT_GNU_STACK.
27 gcc_cv_libc_gnustack=unknown
29 + mips*-*-linux-musl*)
30 + gcc_cv_libc_gnustack=yes
34 if test $glibc_version_major -gt 2 \
35 --- a/gcc/configure.ac
36 +++ b/gcc/configure.ac
37 @@ -7023,6 +7023,9 @@ fi
38 # Check if the target LIBC handles PT_GNU_STACK.
39 gcc_cv_libc_gnustack=unknown
41 + mips*-*-linux-musl*)
42 + gcc_cv_libc_gnustack=yes
45 GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )