Building Go 1.21 for openbsd/386

180 views
Skip to first unread message

Jan Mercl

unread,
Feb 22, 2023, 1:42:56 PM2/22/23
to golang-nuts
The subject target is not distributed by the Go team. Attempting to build if from sources in a qemu 4GB VM [OpenBSD 7.2 (GENERIC.MP) #404: Tue Sep 27 12:54:46 MDT 2022] via

        $ GOROOT_BOOTSTRAP=~/go1.19 nohup ./make.bash

  produces

        Building Go toolchain1 using /home/jnml/go1.19.
        Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
        Building Go toolchain2 using go_bootstrap and Go toolchain1.
        # cmd/compile/internal/ssa
        fatal error: runtime: out of memory
       
        runtime stack:
        runtime.throw({0x87b8037, 0x16})
        /home/jnml/goroot/src/runtime/panic.go:1047 +0x4d fp=0xcf7c860c sp=0xcf7c85f8 pc=0x80832fd
        runtime.sysMapOS(0x89c00000, 0x400000)
        /home/jnml/goroot/src/runtime/mem_bsd.go:71 +0x144 fp=0xcf7c8638 sp=0xcf7c860c pc=0x805d764
        runtime.sysMap(0x89c00000, 0x400000, 0x8d4bc10)
        /home/jnml/goroot/src/runtime/mem.go:142 +0x3f fp=0xcf7c8648 sp=0xcf7c8638 pc=0x805d59f
        runtime.(*mheap).grow(0x8d3e3e0, 0x9)
        /home/jnml/goroot/src/runtime/mheap.go:1459 +0x2b1 fp=0xcf7c869c sp=0xcf7c8648 pc=0x8073d51
        runtime.(*mheap).allocSpan(0x8d3e3e0, 0x9, 0x0, 0x78)
        /home/jnml/goroot/src/runtime/mheap.go:1191 +0x2f2 fp=0xcf7c872c sp=0xcf7c869c pc=0x8073382
        runtime.(*mheap).alloc.func1()
        /home/jnml/goroot/src/runtime/mheap.go:910 +0x7c fp=0xcf7c8750 sp=0xcf7c872c pc=0x8072cfc
        runtime.systemstack()
        /home/jnml/goroot/src/runtime/asm_386.s:370 +0x35 fp=0xcf7c8754 sp=0xcf7c8750 pc=0x80b2305
       
        goroutine 4282 [running]:
        ...

Has anyone successfully built this target from sources and can share how to build Go 1.21 for openbsd/386?

Thanks in advance.

-j

drc...@google.com

unread,
Feb 28, 2023, 1:47:21 PM2/28/23
to golang-nuts
Try also GOMAXPROCS=1 ?  At some point not too long ago we made that dial down the concurrency in the compiler (before, it would do concurrent builds/compiles anyway) and that should reduce the maximum footprint.
Reply all
Reply to author
Forward
0 new messages