diff mbox series

configure: define TARGET_LIBC_GNUSTACK on musl

Message ID 20211115082537.381066-1-ilya.lipnitskiy@gmail.com
State New
Headers show
Series configure: define TARGET_LIBC_GNUSTACK on musl | expand

Commit Message

Ilya Lipnitskiy Nov. 15, 2021, 8:25 a.m. UTC
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.GN23599@brightrain.aerifal.cx/T/#u

gcc/ChangeLog:

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

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

Comments

Jeff Law Nov. 15, 2021, 10:50 p.m. UTC | #1
On 11/15/2021 1:25 AM, Ilya Lipnitskiy via Gcc-patches wrote:
> 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.GN23599@brightrain.aerifal.cx/T/#u
>
> gcc/ChangeLog:
>
> 	* configure: Regenerate.
> 	* configure.ac: define TARGET_LIBC_GNUSTACK on musl
If musl has no executable stack support, then wouldn't we want this 
change to apply to all musl platforms, not just mips?

jeff
Ilya Lipnitskiy Nov. 16, 2021, 5:10 a.m. UTC | #2
On Mon, Nov 15, 2021 at 2:50 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
>
> On 11/15/2021 1:25 AM, Ilya Lipnitskiy via Gcc-patches wrote:
> > 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.GN23599@brightrain.aerifal.cx/T/#u
> >
> > gcc/ChangeLog:
> >
> >       * configure: Regenerate.
> >       * configure.ac: define TARGET_LIBC_GNUSTACK on musl
> If musl has no executable stack support, then wouldn't we want this
> change to apply to all musl platforms, not just mips?
The original change was MIPS-specific[0] and TARGET_LIBC_GNUSTACK is
only used by mips code today. We could change both cases to be more
generic or keep it MIPS-specific. Dragan, what do you think?

I also need to re-spin my change as my case is a more specific match
than the first and never executes with my patch.

[0]: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=54b3d52c3cca836c7c4c08cc9c02eda6c096372a
>
> jeff
>
Ilya
Jeff Law Nov. 23, 2021, 12:30 a.m. UTC | #3
On 11/15/2021 10:10 PM, Ilya Lipnitskiy wrote:
> On Mon, Nov 15, 2021 at 2:50 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
>>
>>
>> On 11/15/2021 1:25 AM, Ilya Lipnitskiy via Gcc-patches wrote:
>>> 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.GN23599@brightrain.aerifal.cx/T/#u
>>>
>>> gcc/ChangeLog:
>>>
>>>        * configure: Regenerate.
>>>        * configure.ac: define TARGET_LIBC_GNUSTACK on musl
>> If musl has no executable stack support, then wouldn't we want this
>> change to apply to all musl platforms, not just mips?
> The original change was MIPS-specific[0] and TARGET_LIBC_GNUSTACK is
> only used by mips code today. We could change both cases to be more
> generic or keep it MIPS-specific. Dragan, what do you think?
Oh yea, I forgot about that  older change.    Let me take another looksie.

jeff
diff mbox series

Patch

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,