From 5b3d7328eeeb36140db633b00a842b7bb27dac1ba7eefdaf789592912627779a Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Tue, 17 Dec 2019 14:37:18 +0000 Subject: [PATCH] Accepting request 756824 from home:tomdevries:branches:devel:gcc-gdb-alloca-0 - Fix build with gcc 10 [bsc#1158539, swo#24653]. * gdb-0001-remove-alloca-0-calls.patch OBS-URL: https://build.opensuse.org/request/show/756824 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=239 --- gdb-0001-remove-alloca-0-calls.patch | 57 ++++++++++++++++++++++++++++ gdb.changes | 6 +++ gdb.spec | 2 + 3 files changed, 65 insertions(+) create mode 100644 gdb-0001-remove-alloca-0-calls.patch diff --git a/gdb-0001-remove-alloca-0-calls.patch b/gdb-0001-remove-alloca-0-calls.patch new file mode 100644 index 0000000..3d729be --- /dev/null +++ b/gdb-0001-remove-alloca-0-calls.patch @@ -0,0 +1,57 @@ +Remove alloca(0) calls + +PR gdb/24653 points out that a gcc snapshot will complain about the +calls to alloca(0) in gdb. + +These calls are only needed when using the C alloca. I'm inclined to +think that no current platform needs this, so this patch removes the +calls. + +Let me know what you think. + +gdb/ChangeLog +2019-06-14 Tom Tromey + + PR gdb/24653: + * regcache.c (registers_changed): Don't call alloca. + * top.c (execute_command): Don't call alloca. + +--- + gdb/ChangeLog | 6 ++++++ + gdb/regcache.c | 7 ------- + gdb/top.c | 4 ---- + 3 files changed, 6 insertions(+), 11 deletions(-) + +diff --git a/gdb/regcache.c b/gdb/regcache.c +index 6e3eee96631..323f0f5ab4e 100644 +--- a/gdb/regcache.c ++++ b/gdb/regcache.c +@@ -454,13 +454,6 @@ void + registers_changed (void) + { + registers_changed_ptid (minus_one_ptid); +- +- /* Force cleanup of any alloca areas if using C alloca instead of +- a builtin alloca. This particular call is used to clean up +- areas allocated by low level target code which may build up +- during lengthy interactions between gdb and the target before +- gdb gives control to the user (ie watchpoints). */ +- alloca (0); + } + + void +diff --git a/gdb/top.c b/gdb/top.c +index b46de90f755..857207c3767 100644 +--- a/gdb/top.c ++++ b/gdb/top.c +@@ -560,10 +560,6 @@ execute_command (const char *p, int from_tty) + auto cleanup_if_error = make_scope_exit (bpstat_clear_actions); + scoped_value_mark cleanup = prepare_execute_command (); + +- /* Force cleanup of any alloca areas if using C alloca instead of +- a builtin alloca. */ +- alloca (0); +- + /* This can happen when command_line_input hits end of file. */ + if (p == NULL) + { diff --git a/gdb.changes b/gdb.changes index a6acaa9..860bcff 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Dec 6 14:20:21 UTC 2019 - Tom de Vries + +- Fix build with gcc 10 [bsc#1158539, swo#24653]. + * gdb-0001-remove-alloca-0-calls.patch + ------------------------------------------------------------------- Mon Nov 11 08:57:18 UTC 2019 - Ludwig Nussel diff --git a/gdb.spec b/gdb.spec index 9cac337..559a674 100644 --- a/gdb.spec +++ b/gdb.spec @@ -247,6 +247,7 @@ Patch2008: gdb-testsuite-i386-pkru-exp.patch Patch2009: gdb-s390-handle-arch13.diff Patch2010: gdb-fix-heap-use-after-free-in-typename-concat.patch Patch2011: gdb-dwarf-reader-reject-sections-with-invalid-sizes.patch +Patch2012: gdb-0001-remove-alloca-0-calls.patch # Proposed patch for PR symtab/24971 Patch2500: gdb-symtab-prefer-var-def-over-decl.patch @@ -599,6 +600,7 @@ find -name "*.info*"|xargs rm -f %patch2009 -p1 %patch2010 -p1 %patch2011 -p1 +%patch2012 -p1 %patch2500 -p1 %patch2501 -p1