Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: Unable to build Go 1.16 on i386 with GO386=387 or GO386=softfloat #44500

Open
4a6f656c opened this issue Feb 22, 2021 · 3 comments
Open

cmd/go: Unable to build Go 1.16 on i386 with GO386=387 or GO386=softfloat #44500

4a6f656c opened this issue Feb 22, 2021 · 3 comments
Labels
Milestone

Comments

@4a6f656c
Copy link
Contributor

@4a6f656c 4a6f656c commented Feb 22, 2021

Prior to Go 1.16, it was possible to build with GO386=387 on an i386 host using Go 1.4 as a bootstrap. This now fails as follows:

dev@i386:~/src/go/src$ uname -a
Linux i386 5.4.0-60-generic #67-Ubuntu SMP Tue Jan 5 18:31:36 UTC 2021 i686 i686 i686 GNU/Linux

dev@i386:~/src/go/src$ git -C ~/src/go1.4 status
On branch release-branch.go1.4
Your branch is up to date with 'origin/release-branch.go1.4'.

dev@i386:~/src/go/src$ GOROOT_BOOTSTRAP=~/src/go1.4 GO386=387 ./make.bash
Building Go cmd/dist using /home/dev/src/go1.4. (go1.4-bootstrap-20170531 linux/386)
Building Go toolchain1 using /home/dev/src/go1.4.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
unsupported setting GO386=387. Consider using GO386=softfloat instead.

go tool dist: FAILED: /home/dev/src/go/pkg/tool/linux_386/compile -std -pack -o /tmp/go-tool-dist-002851757/internal/abi/_go_.a -p internal/abi -importcfg /tmp/go-tool-dist-002851757/internal/abi/importcfg /home/dev/src/go/src/internal/abi/abi.go /home/dev/src/go/src/internal/abi/abi_generic.go: exit status 1
go tool dist: open /tmp/go-tool-dist-002851757/internal/abi/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-002851757/internal/cpu/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-002851757/runtime/internal/sys/_go_.a: no such file or directory
go tool dist: open /tmp/go-tool-dist-002851757/runtime/internal/atomic/_go_.a: no such file or directory
unsupported setting GO386=387. Consider using GO386=softfloat instead.

go tool dist: FAILED: /home/dev/src/go/pkg/tool/linux_386/compile -std -pack -o /tmp/go-tool-dist-002851757/internal/cpu/_go_.a -p internal/cpu -importcfg /tmp/go-tool-dist-002851757/internal/cpu/importcfg -asmhdr /tmp/go-tool-dist-002851757/internal/cpu/go_asm.h -symabis /tmp/go-tool-dist-002851757/internal/cpu/symabis /home/dev/src/go/src/internal/cpu/cpu.go /home/dev/src/go/src/internal/cpu/cpu_386.go /home/dev/src/go/src/internal/cpu/cpu_x86.go: exit status 1
unsupported setting GO386=387. Consider using GO386=softfloat instead.

go tool dist: FAILED: /home/dev/src/go/pkg/tool/linux_386/compile -std -pack -o /tmp/go-tool-dist-002851757/runtime/internal/sys/_go_.a -p runtime/internal/sys -importcfg /tmp/go-tool-dist-002851757/runtime/internal/sys/importcfg -asmhdr /tmp/go-tool-dist-002851757/runtime/internal/sys/go_asm.h -symabis /tmp/go-tool-dist-002851757/runtime/internal/sys/symabis /home/dev/src/go/src/runtime/internal/sys/arch.go /home/dev/src/go/src/runtime/internal/sys/arch_386.go /home/dev/src/go/src/runtime/internal/sys/intrinsics_common.go /home/dev/src/go/src/runtime/internal/sys/intrinsics_stubs.go /home/dev/src/go/src/runtime/internal/sys/sys.go /home/dev/src/go/src/runtime/internal/sys/zgoarch_386.go /home/dev/src/go/src/runtime/internal/sys/zgoos_linux.go /home/dev/src/go/src/runtime/internal/sys/zversion.go: exit status 1
unsupported setting GO386=387. Consider using GO386=softfloat instead.

go tool dist: FAILED: /home/dev/src/go/pkg/tool/linux_386/compile -std -pack -o /tmp/go-tool-dist-002851757/runtime/internal/atomic/_go_.a -p runtime/internal/atomic -importcfg /tmp/go-tool-dist-002851757/runtime/internal/atomic/importcfg -asmhdr /tmp/go-tool-dist-002851757/runtime/internal/atomic/go_asm.h -symabis /tmp/go-tool-dist-002851757/runtime/internal/atomic/symabis /home/dev/src/go/src/runtime/internal/atomic/atomic_386.go /home/dev/src/go/src/runtime/internal/atomic/stubs.go /home/dev/src/go/src/runtime/internal/atomic/unaligned.go: exit status 1

However, this also fails with GO386=softfloat as the Go 1.4 compiler (8g) knows nothing about this:

dev@i386:~/src/go/src$ GOROOT_BOOTSTRAP=~/src/go1.4 GO386=softfloat ./make.bash
Building Go cmd/dist using /home/dev/src/go1.4. (go1.4-bootstrap-20170531 linux/386)
# _/home/dev/src/go/src/cmd/dist
/home/dev/src/go1.4/pkg/tool/linux_386/8g: unsupported setting GO386=softfloat

This can be worked around by using a binary bootstrap, however it is a breaking change to a previously working behaviour.

@randall77
Copy link
Contributor

@randall77 randall77 commented Feb 22, 2021

Yes, unfortunately the straightforward bootstrap doesn't work. You can always build a 1.16 386/softfloat distribution on amd64 and copy it over. You're done at that point, or from there you can use go1.16 to bootstrap.

You could also move the go1.4/bin/go binary to go1.4/bin/savego and make go1.4/bin/go a shell script that sets GO386=387 and then invokes go1.4/bin/savego.

Bootstrapping from 1.4 might be going away soonish, see #43930 (comment)

@randall77
Copy link
Contributor

@randall77 randall77 commented Feb 22, 2021

Changing bootstrap to 1.16 is now an official proposal #44505.

@ALTree ALTree changed the title Unable to build Go 1.16 on i386 with GO386=387 or GO386=softfloat cmd/go: Unable to build Go 1.16 on i386 with GO386=387 or GO386=softfloat Feb 23, 2021
@ALTree ALTree added this to the Unplanned milestone Feb 23, 2021
@yosifkit
Copy link

@yosifkit yosifkit commented Feb 24, 2021

A bit of a pain, but you can create a bootstrap with SSE2 and then be able to build the rest with softfloat. This doesn't help building on a non-SSE2 device, but should help packagers bootstrap 1.16 to still support devices without SSE2..

export GO386='softfloat'
GO386= ./bootstrap.bash
export GOROOT_BOOTSTRAP="../../go-$GOOS-$GOARCH-bootstrap"
./make.bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants