3
0
forked from pool/systemtap
systemtap/systemtap-tweak-i386-argument-passing.patch

40 lines
1.3 KiB
Diff

From: Jakub Jelinek <jakub@redhat.com>
Date: Tue Mar 21 17:04:08 2017 -0400
Subject: tweak i386 argument passing
Git-commit: 272146660f54786bb61d388f6d3a4eb20e7d9369
References: bsc#1030285
Signed-off-by: Tony Jones <tonyj@suse.de>
gcc PR80115: sys/sdt.h: tweak i386 argument passing
Use %w[arg] to request that widened forms of register names be passed
to the sys/sdt.h macro operand strings, so as to avoid nominating
sub-registers such as %sil within -m32 code, which gcc <= 6 sometimes
buggily did.
diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h
index 3b7eda797..eff315bcd 100644
--- a/includes/sys/sdt.h
+++ b/includes/sys/sdt.h
@@ -82,9 +82,11 @@
# define _SDT_ASM_STRING_1(x) _SDT_ASM_1(.asciz #x)
# define _SDT_ARGFMT(no) %n[_SDT_S##no]@_SDT_ARGTMPL(_SDT_A##no)
+
# ifndef STAP_SDT_ARG_CONSTRAINT
# define STAP_SDT_ARG_CONSTRAINT nor
# endif
+
# define _SDT_STRINGIFY(x) #x
# define _SDT_ARG_CONSTRAINT_STRING(x) _SDT_STRINGIFY(x)
# define _SDT_ARG(n, x) \
@@ -173,6 +175,8 @@ __extension__ extern unsigned long long __sdt_unsp;
#if defined __powerpc__ || defined __powerpc64__
# define _SDT_ARGTMPL(id) %I[id]%[id]
+#elif defined __i386__
+# define _SDT_ARGTMPL(id) %w[id] /* gcc.gnu.org/PR80115 */
#else
# define _SDT_ARGTMPL(id) %[id]
#endif