mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] powerpc64: use a type for mcontext_t regs field
@ 2019-02-12 15:35 A. Wilcox
  2019-02-12 16:18 ` Rich Felker
  0 siblings, 1 reply; 12+ messages in thread
From: A. Wilcox @ 2019-02-12 15:35 UTC (permalink / raw)
  To: musl; +Cc: A. Wilcox

GCC Go dereferences `regs` for `nip`.  Without this change, compilation
fails with the following message:

../../../libgo/runtime/go-signal.c: In function ‘getSiginfo’:
../../../libgo/runtime/go-signal.c:225:56: warning: dereferencing ‘void *’ pointer
  ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.regs->nip;
                                                        ^~
../../../libgo/runtime/go-signal.c:225:56: error: request for member ‘nip’ in something not a structure or union
---
 arch/powerpc64/bits/signal.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc64/bits/signal.h b/arch/powerpc64/bits/signal.h
index 34693a68..6736c69a 100644
--- a/arch/powerpc64/bits/signal.h
+++ b/arch/powerpc64/bits/signal.h
@@ -8,6 +8,8 @@
 
 #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 
+#include <bits/user.h>
+
 typedef unsigned long greg_t, gregset_t[48];
 
 typedef struct {
@@ -29,7 +31,7 @@ typedef struct sigcontext {
 	int _pad0;
 	unsigned long handler;
 	unsigned long oldmask;
-	void *regs;
+	struct pt_regs *regs;
 	gregset_t gp_regs;
 	fpregset_t fp_regs;
 	vrregset_t *v_regs;
-- 
2.19.2



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-02-12 18:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 15:35 [PATCH] powerpc64: use a type for mcontext_t regs field A. Wilcox
2019-02-12 16:18 ` Rich Felker
2019-02-12 17:05   ` David Edelsohn
2019-02-12 17:23     ` Rich Felker
2019-02-12 18:17       ` David Edelsohn
2019-02-12 18:21         ` Rich Felker
2019-02-12 18:24           ` David Edelsohn
2019-02-12 18:32             ` Rich Felker
2019-02-12 18:36     ` A. Wilcox
2019-02-12 18:42       ` James Larrowe
2019-02-12 18:53         ` A. Wilcox
2019-02-12 18:48       ` David Edelsohn

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).