Bootstapping go-1.8.3 on linux-mips fails

368 views
Skip to first unread message

John Paul Adrian Glaubitz

unread,
Jun 23, 2017, 3:11:33 AM6/23/17
to golang-dev
Hi!

I have been trying to bootstrap go-1.8.3 on linux-mips and linux-mipsel on Debian
Stretch now using gccgo-7 and the go-1.8.3 sources.

Unfortunately, the build fails:

(sid_mips-dchroot)glaubitz@minkus:~/golang-1.8/go/src$ GOROOT_BOOTSTRAP=/usr ./make.bash
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using /usr.
bootstrap/cmd/internal/dwarf
bootstrap/cmd/internal/sys
bootstrap/cmd/asm/internal/flags
bootstrap/cmd/internal/bio
bootstrap/cmd/internal/obj
go build bootstrap/cmd/internal/bio: /usr/bin/mips-linux-gnu-gccgo-7: waitid: bad address
bootstrap/cmd/compile/internal/syntax
bootstrap/cmd/internal/obj/arm
bootstrap/cmd/internal/obj/arm64
bootstrap/cmd/internal/obj/mips
bootstrap/cmd/internal/obj/ppc64
bootstrap/cmd/internal/obj/s390x
bootstrap/cmd/internal/obj/x86
bootstrap/cmd/asm/internal/lex
bootstrap/cmd/internal/gcprog
bootstrap/math/big
bootstrap/debug/pe
bootstrap/cmd/asm/internal/arch
bootstrap/cmd/compile/internal/ssa
bootstrap/cmd/asm/internal/asm
go tool dist: FAILED: /usr/bin/go install -gcflags=-l -tags=math_big_pure_go -v bootstrap/cmd/...: exit status 1
(sid_mips-dchroot)glaubitz@minkus:~/golang-1.8/go/src$

Is there anything obvious that I missed?

This was tested on a recent Linux kernel version:

(sid_mips-dchroot)glaubitz@minkus:~/golang-1.8/go/src$ uname -a
Linux minkus 4.9.0-0.bpo.3-octeon #1 SMP Debian 4.9.25-1~bpo8+1 (2017-05-19) mips GNU/Linux
(sid_mips-dchroot)glaubitz@minkus:~/golang-1.8/go/src$

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glau...@debian.org
`. `' Freie Universitaet Berlin - glau...@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

Ian Lance Taylor

unread,
Jun 23, 2017, 10:12:20 AM6/23/17
to John Paul Adrian Glaubitz, golang-dev
I don't think so. I have not seen that error.

I see a possible alignment problem in the call to waitid that might
cause this. I sent https://golang.org/cl/46511 to fix it. Rebuilding
gccgo with that patch applied to libgo/go/os/wait_waitid.go might
help.

Ian

Ian Lance Taylor

unread,
Jun 23, 2017, 1:25:14 PM6/23/17
to John Paul Adrian Glaubitz, golang-dev
I committed that change to GCC trunk and GCC 7 branch. It seems
clearly correct though I don't know whether it will your specific
problem.

Ian

John Paul Adrian Glaubitz

unread,
Jul 2, 2017, 3:22:57 PM7/2/17
to Ian Lance Taylor, golang-dev
On 06/23/2017 07:25 PM, Ian Lance Taylor wrote:
> I committed that change to GCC trunk and GCC 7 branch. It seems
> clearly correct though I don't know whether it will your specific
> problem.

I tried again on both mips32 big-endian and little-endian with gcc-7 (r249793)
from the gcc-7 branch (snapshot taken on 2017-06-29).

Still fails, unfortunately:

(sid_mipsel-dchroot)glaubitz@eller:~/golang-1.8/go/src$ GOROOT_BOOTSTRAP=/usr ./make.bash
##### Building Go bootstrap tool.
cmd/dist

##### Building Go toolchain using /usr.
bootstrap/cmd/internal/sys
bootstrap/cmd/internal/dwarf
bootstrap/cmd/asm/internal/flags
bootstrap/cmd/internal/bio
go build bootstrap/cmd/asm/internal/flags: /usr/bin/mipsel-linux-gnu-gccgo-7: waitid: bad address
bootstrap/cmd/compile/internal/syntax
bootstrap/cmd/internal/gcprog
bootstrap/cmd/internal/obj
bootstrap/math/big
bootstrap/debug/pe
bootstrap/cmd/internal/obj/arm
bootstrap/cmd/internal/obj/arm64
bootstrap/cmd/internal/obj/mips
bootstrap/cmd/internal/obj/ppc64
bootstrap/cmd/internal/obj/s390x
bootstrap/cmd/internal/obj/x86
bootstrap/cmd/link/internal/ld
bootstrap/cmd/asm/internal/arch
bootstrap/cmd/compile/internal/ssa
bootstrap/cmd/link/internal/amd64
bootstrap/cmd/link/internal/arm
bootstrap/cmd/link/internal/arm64
bootstrap/cmd/link/internal/mips
bootstrap/cmd/link/internal/mips64
bootstrap/cmd/link/internal/ppc64
go build bootstrap/cmd/link/internal/mips: /usr/bin/mipsel-linux-gnu-gccgo-7: waitid: bad address
bootstrap/cmd/link/internal/s390x
go build bootstrap/cmd/link/internal/mips64: /usr/bin/mipsel-linux-gnu-gccgo-7: waitid: bad address
bootstrap/cmd/link/internal/x86
bootstrap/cmd/compile/internal/gc
bootstrap/cmd/compile/internal/amd64
bootstrap/cmd/compile/internal/arm
bootstrap/cmd/compile/internal/arm64
bootstrap/cmd/compile/internal/mips
bootstrap/cmd/compile/internal/mips64
bootstrap/cmd/compile/internal/ppc64
bootstrap/cmd/compile/internal/s390x
go build bootstrap/cmd/compile/internal/arm: /usr/bin/mipsel-linux-gnu-gccgo-7: waitid: bad address
bootstrap/cmd/compile/internal/x86
go tool dist: FAILED: /usr/bin/go install -gcflags=-l -tags=math_big_pure_go -v bootstrap/cmd/...: exit status 1
(sid_mipsel-dchroot)glaubitz@eller:~/golang-1.8/go/src$ go version
go version go1.8.1 gccgo (Debian 7.1.0-8) 7.1.0 linux/mipso32
(sid_mipsel-dchroot)glaubitz@eller:~/golang-1.8/go/src$

Ian Lance Taylor

unread,
Jul 4, 2017, 5:32:26 PM7/4/17
to John Paul Adrian Glaubitz, golang-dev
Sorry it didn't help. I don't have access to a MIPS system so
unfortunately you are going to have to debug this yourself. Let me
know if I can help.

Ian

John Paul Adrian Glaubitz

unread,
Jul 5, 2017, 9:36:59 AM7/5/17
to Ian Lance Taylor, golang-dev
On 07/04/2017 11:32 PM, Ian Lance Taylor wrote:
> Sorry it didn't help. I don't have access to a MIPS system so
> unfortunately you are going to have to debug this yourself. Let me
> know if I can help.

Ok, no problem. Apparently Debian's Go maintainers are working on ironing
out these issues. I learned yesterday that they use gccgo for building
golang itself but not for building any actual Go packages as many packages,
especially more complex ones compile to broken binaries (Segfaults etc).

I'll focus on hacking on the sparc64 port again. I already have a question
which I will post in a separate thread.

Adrian

anthon...@gmail.com

unread,
Jul 28, 2017, 2:46:44 PM7/28/17
to golang-dev, adrian....@googlemail.com
Just a follow up on this issue in case anyone else stumbles upon it like I did too:

 * The issue is being tracked in Debian at https://bugs.debian.org/867358:
     "mips/mipsel: mips-linux-gnu-gccgo-7: waitid: bad address

 * James Cowgill told us that this was actually a kernel bug, which he submitted
    a fix in March 2017:

 * The patch came in two parts, but for some reasons, only the first part was committed:

 * Upon that discovery, James Cowgill wrote a Ping (July 17)

 * James Hogan reviewed the patch (today, July 28)

Hope the patch will be applied to the official Linux kernel tree soon.

Cheers,
Anthony
Reply all
Reply to author
Forward
0 new messages