Skip to content

Commit

Permalink
toolchain/gcc: remove upstreamed patch, add backport
Browse files Browse the repository at this point in the history
This patch has been upstream since GCC 10.
Dragan Mladjenovic (2):
      Emit .note.GNU-stack for soft-float linux targets.
      Emit .note.GNU-stack for hard-float linux targets.

Link: https://gcc.gnu.org/g:a3c1e1f2ff88
Link: https://gcc.gnu.org/g:54b3d52c3cca

Add backport patch to define TARGET_LIBC_GNUSTACK on musl to add
.note.GNU-stack on hard-float MIPS targets.

Link: https://gcc.gnu.org/g:25abbb924968

The net effect should be the exact same functionality while following
upstream code instead of a custom outdated patch.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
  • Loading branch information
lipnitsk authored and hauke committed Dec 17, 2021
1 parent eabb4a5 commit 475b366
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 111 deletions.
@@ -0,0 +1,46 @@
From ea650cae26da4a8fc04f0c4666f4dd776d0b5fc0 Mon Sep 17 00:00:00 2001
From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Date: Sun, 14 Nov 2021 21:54:25 -0800
Subject: [PATCH] configure: define TARGET_LIBC_GNUSTACK on musl

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(+)

--- a/gcc/configure
+++ b/gcc/configure
@@ -30954,6 +30954,9 @@ fi
# Check if the target LIBC handles PT_GNU_STACK.
gcc_cv_libc_gnustack=unknown
case "$target" in
+ mips*-*-linux-musl*)
+ gcc_cv_libc_gnustack=yes
+ ;;
mips*-*-linux*)

if test $glibc_version_major -gt 2 \
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6788,6 +6788,9 @@ fi
# Check if the target LIBC handles PT_GNU_STACK.
gcc_cv_libc_gnustack=unknown
case "$target" in
+ mips*-*-linux-musl*)
+ gcc_cv_libc_gnustack=yes
+ ;;
mips*-*-linux*)
GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )
;;
111 changes: 0 additions & 111 deletions toolchain/gcc/patches/11.2.0/930-fix-mips-noexecstack.patch

This file was deleted.

0 comments on commit 475b366

Please sign in to comment.