Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Dimitar Dimitrov <dimitar@dinux.eu>
To: gdb-patches@sourceware.org
Cc: Dimitar Dimitrov <dimitar@dinux.eu>
Subject: [PATCH] Fix build with latest GCC 9.0 tree
Date: Mon, 17 Dec 2018 19:31:00 -0000	[thread overview]
Message-ID: <20181217193052.24157-1-dimitar@dinux.eu> (raw)

A recent patch [1] to fix a GCC PR [2] actually broke the GDB build.
To fix, remove the stack pointer clobber. GCC will ignore the clobber
marker, and will not save or restore the stack pointer.

I ran "make check-gdb" on x86_64 to ensure there are no regressions.

gdb/ChangeLog:

2018-12-17  Dimitar Dimitrov  <dimitar@dinux.eu>

	* nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Remove sp clobbers.

[1] https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00532.html
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gdb/nat/linux-ptrace.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index 1f21ef03a3..58aed199bf 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -128,14 +128,14 @@ linux_ptrace_test_ret_to_nx (void)
 			".globl linux_ptrace_test_ret_to_nx_instr;"
 			"linux_ptrace_test_ret_to_nx_instr:"
 			"ret"
-			: : "r" (return_address) : "%esp", "memory");
+			: : "r" (return_address) : "memory");
 #elif defined __x86_64__
 	  asm volatile ("pushq %0;"
 			".globl linux_ptrace_test_ret_to_nx_instr;"
 			"linux_ptrace_test_ret_to_nx_instr:"
 			"ret"
 			: : "r" ((uint64_t) (uintptr_t) return_address)
-			: "%rsp", "memory");
+			: "memory");
 #else
 # error "!__i386__ && !__x86_64__"
 #endif
-- 
2.11.0


             reply	other threads:[~2018-12-17 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 19:31 Dimitar Dimitrov [this message]
2018-12-18  3:05 ` Simon Marchi
2018-12-19  6:13   ` Dimitar Dimitrov
2018-12-19 15:46     ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181217193052.24157-1-dimitar@dinux.eu \
    --to=dimitar@dinux.eu \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox