openwrt/toolchain/gcc/patches/8.1.0/930-fix-mips-noexecstack.patch

112 lines
3.7 KiB
Diff
Raw Normal View History

toolchain/gcc: add GCC 8.1.0 Changes compared to GCC 7.x 001-revert_register_mode_search.patch dropped The underlying issue is described at the end of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58139 It is fixed by the upstream commit: https://github.com/gcc-mirror/gcc/commit/3fa2798aa887d141d86985240f03e2f3809e7e62 020-PR-libstdc-81797-Add-.NOTPARALLEL-to-include-Makefil.patch dropped due to already upstream 100-PR-rtl-optimization-83496.patch dropped due to already upstream 910-mbsd_multi.patch modified to fix ambiguous overloaded inform() call error gcc/input.h header: define UNKNOWN_LOCATION ((source_location) 0) - inform (0, "someone does not honour COPTS correctly, passed %d times", - honour_copts); + inform (UNKNOWN_LOCATION, "someone does not honour COPTS correctly, passed %d times", + honour_copts); 940-no-clobber-stamp-bits.patch dropped due to fixed upstream by another way upstream commit: https://github.com/gcc-mirror/gcc/commit/87b2d547f8ac9778d66909b8726fe967d1efbc74 950-cpp_file_path_translation.patch dropped, Both -fmacro-prefix-map and -ffile-prefix-map are added to gcc 8.1.0, if I understand it correctly, we should use -fmacro-prefix-map usage: -fmacro-prefix-map=@var{old}=@var{new} upstream commit: https://github.com/gcc-mirror/gcc/commit/859b51f83662d01e4f158ea9327db9ca37fe70b3 -iremap exists as a flag for a long time, for backward compatibility, I think we should keep the variable name unchanged but change its value in rules.mk for gcc 8.x and higher. Compile and run tested on x86_64 Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2018-06-21 15:08:10 +00:00
From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001
From: Andrew McDonnell <bugs@andrewmcdonnell.net>
Date: Fri, 3 Oct 2014 19:09:00 +0930
Subject: Add .note.GNU-stack section
See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html
Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html
Re: [Patch, MIPS] Add .note.GNU-stack section
From: Steve Ellcey <sellcey at mips dot com>
On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote:
>
>
> On Wed, Sep 10, 2014 at 9:27 AM, <pinskia@gmail.com> wrote:
> This works except you did not update the assembly files in
> libgcc or glibc. We (Cavium) have the same patch in our tree
> for a few released versions.
> Mind just checking yours in then Andrew?
> Thanks!
> -eric
I talked to Andrew about what files he changed in GCC and created and
tested this new patch. Andrew also mentioned changing some assembly
files in glibc but I don't see any use of '.section .note.GNU-stack' in
any assembly files in glibc (for any platform) so I wasn't planning on
creating a glibc to add them to mips glibc assembly language files.
OK to check in this patch?
Steve Ellcey
sellcey@mips.com
2014-09-26 Steve Ellcey <sellcey@mips.com>
---
gcc/config/mips/mips.c | 3 +++
libgcc/config/mips/crti.S | 4 ++++
libgcc/config/mips/crtn.S | 3 +++
libgcc/config/mips/mips16.S | 4 ++++
libgcc/config/mips/vr4120-div.S | 4 ++++
5 files changed, 18 insertions(+)
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -22627,6 +22627,9 @@ mips_starting_frame_offset (void)
#undef TARGET_STARTING_FRAME_OFFSET
#define TARGET_STARTING_FRAME_OFFSET mips_starting_frame_offset
+#undef TARGET_ASM_FILE_END
+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-mips.h"
--- a/libgcc/config/mips/crti.S
+++ b/libgcc/config/mips/crti.S
@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+
+/* An executable stack is *not* required for these functions. */
+ .section .note.GNU-stack,"",%progbits
+
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
--- a/libgcc/config/mips/crtn.S
+++ b/libgcc/config/mips/crtn.S
@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+/* An executable stack is *not* required for these functions. */
+ .section .note.GNU-stack,"",%progbits
+
/* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
--- a/libgcc/config/mips/mips16.S
+++ b/libgcc/config/mips/mips16.S
@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI
values using the soft-float calling convention, but do the actual
operation using the hard floating point instructions. */
+/* An executable stack is *not* required for these functions. */
+ .section .note.GNU-stack,"",%progbits
+ .previous
+
#if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64)
/* This file contains 32-bit assembly code. */
--- a/libgcc/config/mips/vr4120-div.S
+++ b/libgcc/config/mips/vr4120-div.S
@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI
-mfix-vr4120. div and ddiv do not give the correct result when one
of the operands is negative. */
+/* An executable stack is *not* required for these functions. */
+ .section .note.GNU-stack,"",%progbits
+ .previous
+
.set nomips16
#define DIV \