From: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com
Subject: [PATCH, go]: S/390: Fix generation of PtraceRegs
Date: Tue, 27 Jun 2017 07:52:00 -0000 [thread overview]
Message-ID: <0f1319c4-e896-ae22-3a5d-c563a5292d8c@linux.vnet.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]
Hi,
go bootstrap fails on s390x starting with r249472. With including the ptrace header the s390 special
code in mksysinfo.sh isn't used anymore:
if test "$regs" = ""; then
# s390
regs=`grep '^type __user_regs_struct struct' gen-sysinfo.go || true`
if test "$regs" != ""; then
# Substructures of __user_regs_struct on s390
upcase_fields "__user_psw_struct" "PtracePsw" >> ${OUT} || true
upcase_fields "__user_fpregs_struct" "PtraceFpregs" >> ${OUT} || true
upcase_fields "__user_per_struct" "PtracePer" >> ${OUT} || true
fi
fi
Instead we fall through to the code with the generic handling which appears to work fine. The only
difference is that the former code used to uppercase the initial letters of the struct member while
the generic handler doesn't. The only user however appear to be syscall_linux_s390(x).go.
The attached patch removes the mksysino.sh S/390 specific handling and adjusts the
syscall_linux_s390* file accordingly.
This fixes the bootstrap on s390x.
[-- Attachment #2: gcc-gofix --]
[-- Type: text/plain, Size: 2405 bytes --]
commit e2903db6cca0a97c3320ce58ec1405cc3bedb5c2
Author: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Date: Mon Jun 26 16:50:03 2017 +0200
S/390: Fix go bootstrap
diff --git a/libgo/go/syscall/syscall_linux_s390.go b/libgo/go/syscall/syscall_linux_s390.go
index a744f6b..d6d3f6a 100644
--- a/libgo/go/syscall/syscall_linux_s390.go
+++ b/libgo/go/syscall/syscall_linux_s390.go
@@ -8,9 +8,9 @@ package syscall
import "unsafe"
-func (r *PtraceRegs) PC() uint64 { return uint64(r.Psw.Addr) }
+func (r *PtraceRegs) PC() uint64 { return uint64(r.Psw.addr) }
-func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = uint32(pc) }
+func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.addr = uint32(pc) }
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
diff --git a/libgo/go/syscall/syscall_linux_s390x.go b/libgo/go/syscall/syscall_linux_s390x.go
index 44d5679..f3701dc 100644
--- a/libgo/go/syscall/syscall_linux_s390x.go
+++ b/libgo/go/syscall/syscall_linux_s390x.go
@@ -8,9 +8,9 @@ package syscall
import "unsafe"
-func (r *PtraceRegs) PC() uint64 { return r.Psw.Addr }
+func (r *PtraceRegs) PC() uint64 { return r.Psw.addr }
-func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.Addr = pc }
+func (r *PtraceRegs) SetPC(pc uint64) { r.Psw.addr = pc }
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 8fd8ead..fe0bb54 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -310,17 +310,8 @@ upcase_fields () {
# _user_regs_struct.
regs=`grep '^type _user_regs_struct struct' gen-sysinfo.go || true`
if test "$regs" = ""; then
- # s390
- regs=`grep '^type __user_regs_struct struct' gen-sysinfo.go || true`
- if test "$regs" != ""; then
- # Substructures of __user_regs_struct on s390
- upcase_fields "__user_psw_struct" "PtracePsw" >> ${OUT} || true
- upcase_fields "__user_fpregs_struct" "PtraceFpregs" >> ${OUT} || true
- upcase_fields "__user_per_struct" "PtracePer" >> ${OUT} || true
- else
- # mips*
- regs=`grep '^type _pt_regs struct' gen-sysinfo.go || true`
- fi
+ # mips*
+ regs=`grep '^type _pt_regs struct' gen-sysinfo.go || true`
fi
if test "$regs" != ""; then
regs=`echo $regs | sed -e 's/type _pt_regs struct//'`
next reply other threads:[~2017-06-27 7:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 7:52 Andreas Krebbel [this message]
2017-06-27 21:51 ` [gofrontend-dev] " Ian Lance Taylor
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=0f1319c4-e896-ae22-3a5d-c563a5292d8c@linux.vnet.ibm.com \
--to=krebbel@linux.vnet.ibm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gofrontend-dev@googlegroups.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).