Skip to content

Commit

Permalink
gcc: backport some more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Mar 7, 2021
1 parent d3d544a commit 994a815
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
40 changes: 40 additions & 0 deletions mingw-w64-gcc/0202-backport-2939b35.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 2939b358936bb824330888def98ad848dea41483 Mon Sep 17 00:00:00 2001
From: Eric Botcazou <[email protected]>
Date: Wed, 3 Mar 2021 12:25:03 +0100
Subject: [PATCH] Fix ICE with pathologically large frames

gcc/
PR target/99234
* config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
point back the hard frame pointer to its default location when the
frame is larger than SEH_MAX_FRAME_SIZE.
---
gcc/config/i386/i386.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 7b803661366..e23f92b58cc 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6357,7 +6357,8 @@ ix86_compute_frame_layout (void)
frame->hard_frame_pointer_offset = frame->sse_reg_save_offset;

/* If we can leave the frame pointer where it is, do so. Also, return
- the establisher frame for __builtin_frame_address (0). */
+ the establisher frame for __builtin_frame_address (0) or else if the
+ frame overflows the SEH maximum frame size. */
const HOST_WIDE_INT diff
= frame->stack_pointer_offset - frame->hard_frame_pointer_offset;
if (diff <= 255)
@@ -6375,6 +6376,8 @@ ix86_compute_frame_layout (void)
frame that is addressable with 8-bit offsets. */
frame->hard_frame_pointer_offset = frame->stack_pointer_offset - 128;
}
+ else
+ frame->hard_frame_pointer_offset = frame->hfp_save_offset;
}
}

--
2.27.0

12 changes: 9 additions & 3 deletions mingw-w64-gcc/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pkgver=10.2.0
#_majorver=${pkgver:0:1}
#_sourcedir=${_realname}-${_majorver}-${_snapshot}
_sourcedir=${_realname}-${pkgver}
pkgrel=7
pkgrel=8
pkgdesc="GCC for the MinGW-w64"
arch=('any')
url="https://gcc.gnu.org"
Expand Down Expand Up @@ -72,7 +72,8 @@ source=("https://ftp.gnu.org/gnu/gcc/${_realname}-${pkgver%%+*}/${_realname}-${p
0150-gcc-10.2.0-libgcc-ldflags.patch
0160-libbacktrace-seh.patch
0200-backport-7fc0f78.patch
0201-backport-49a714e.patch)
0201-backport-49a714e.patch
0202-backport-2939b35.patch)
sha256sums=('b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c'
'SKIP'
'bce81824fc89e5e62cca350de4c17a27e27a18a1a1ad5ca3492aec1fc5af3234'
Expand All @@ -98,7 +99,8 @@ sha256sums=('b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c'
'7f0b4e45d933e18c9d8bd2afcd83e4f52e97e2e25dd41bfa0cba755c70e591c7'
'88c1d65e763e631ad49f9a077ed631f4acac9ef4732e2818ccddaefc883b1811'
'90b0f1aae2e2f9d75520569e8fbb31a9bac507136dd103a966f063d28e2094b8'
'6bcaf2846ceeafa87912b30ed3e573d75b35bbeafebdaf675e2318b9b0058fbb')
'6bcaf2846ceeafa87912b30ed3e573d75b35bbeafebdaf675e2318b9b0058fbb'
'319b1ffe9dbede0578ffa4fd78fe803bf40ed1e0bc52251fdaaadd869f0dbf2a')
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # [email protected]
86CFFCA918CF3AF47147588051E8B148A9999C34 # [email protected]
13975A70E63C361C73AE69EF6EEB81F8981C74C7 # [email protected]
Expand Down Expand Up @@ -172,6 +174,10 @@ prepare() {
apply_patch_with_msg \
0201-backport-49a714e.patch

# https://github.com/msys2/MINGW-packages/issues/8079
apply_patch_with_msg \
0202-backport-2939b35.patch

# do not expect ${prefix}/mingw symlink - this should be superceded by
# 0005-Windows-Don-t-ignore-native-system-header-dir.patch .. but isn't!
sed -i 's/${prefix}\/mingw\//${prefix}\//g' configure
Expand Down

0 comments on commit 994a815

Please sign in to comment.