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/compile: Go 1.22.x failed to be bootstrapped from 386 to ppc64le #66955

Closed
cheese opened this issue Apr 22, 2024 · 5 comments
Closed

cmd/compile: Go 1.22.x failed to be bootstrapped from 386 to ppc64le #66955

cheese opened this issue Apr 22, 2024 · 5 comments
Assignees
Labels
arch-386 Issues solely affecting the 32-bit x86 architecture arch-ppc64x NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@cheese
Copy link

cheese commented Apr 22, 2024

Go version

go version go1.21.9 linux/386

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='ppc64le'
GOBIN=''
GOCACHE='/tmp/.cache/go-build'
GOENV='/tmp/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='386'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/tmp/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/tmp/go'
GOPRIVATE=''
GOPROXY=''
GOROOT='/cross/lib/go'
GOSUMDB=''
GOTMPDIR=''
GOTOOLCHAIN=''
GOTOOLDIR='/cross/lib/go/pkg/tool/linux_386'
GOVCS=''
GOVERSION='go1.21.9'
GCCGO='gccgo'
GOPPC64='power8'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4273291414=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Cross-build go-1.22 for ppc64le from 386.

  1. Prepare a go environment of 386 isa
  2. Checkout a source directory of go1.22.2
  3. Run
cd src
bash make.bash

with environments

GOARCH: ppc64le
GOOS: linux
GOHOSTARCH: 386
CGO_ENABLED: 0

The was run in a test of freedesktop-sdk-binary-seed, full log is available https://gitlab.com/freedesktop-sdk/freedesktop-sdk-binary-seed/-/jobs/6679102887

I also tested some other combinations:

  • go-1.21 386 bootstraps go-1.21 ppc64le: good
  • go-1.21 386 bootstraps go-1.22 amd64, arm64, 386: good
  • go-1.22 386 bootstraps go-1.22 ppc64le: bad

What did you see happen?

The build failed with errror log:

+ sh -c -e 'cd src
bash make.bash
'
Building Go cmd/dist using /cross/lib/go. (go1.21.9 linux/386)
Building Go toolchain1 using /cross/lib/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building commands for host, linux/386.
Building packages and commands for target, linux/ppc64le.
# time
00072 (/buildstream-build/src/time/time.go:1242)        MOVD    $-51844517355891, R5
00072 (/buildstream-build/src/time/time.go:1242)        MOVD    $-51844517355891, R5
00072 (/buildstream-build/src/time/time.go:1242)        MOVD    $-51844517355891, R5
00152 (<autogenerated>:1)       MOVD    $-51844517355891, R5
00152 (<autogenerated>:1)       MOVD    $-51844517355891, R5
00152 (<autogenerated>:1)       MOVD    $-51844517355891, R5
<autogenerated>:1: illegal combination MOVD 64CON NONE NONE NONE NONE REG
# crypto/des
00080 (/buildstream-build/src/crypto/des/block.go:187)  MOVD    $16557098929935, R5
00080 (/buildstream-build/src/crypto/des/block.go:187)  MOVD    $16557098929935, R5
00080 (/buildstream-build/src/crypto/des/block.go:187)  MOVD    $16557098929935, R5
00088 (/buildstream-build/src/crypto/des/block.go:131)  MOVD    $16557098929935, R5
00088 (/buildstream-build/src/crypto/des/block.go:131)  MOVD    $16557098929935, R5
00088 (/buildstream-build/src/crypto/des/block.go:131)  MOVD    $16557098929935, R5
<autogenerated>:1: illegal combination MOVD 64CON NONE NONE NONE NONE REG
go tool dist: FAILED: /buildstream-build/pkg/tool/linux_386/go_bootstrap install std: exit status 1
Command 'cd src
bash make.bash' failed with exitcode 2

What did you expect to see?

The build succeeds since Go 1.22 was announced boostrappable from Go 1.20+.

@mauri870 mauri870 added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. arch-ppc64x labels Apr 22, 2024
@mauri870
Copy link
Member

cc @golang/compiler @golang/ppc64

@mauri870 mauri870 added the arch-386 Issues solely affecting the 32-bit x86 architecture label Apr 22, 2024
@pmur pmur self-assigned this Apr 22, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/580796 mentions this issue: cmd/internal/obj/ppc64: fix incorrect int to int64 conversion when checking MOVD opcodes

@cheese
Copy link
Author

cheese commented Apr 23, 2024

Change https://go.dev/cl/580796 mentions this issue: cmd/internal/obj/ppc64: fix incorrect int to int64 conversion when checking MOVD opcodes

I tested the patch and it fixed the build.

@pmur
Copy link
Contributor

pmur commented Apr 24, 2024

@gopherbot please consider a backport to go 1.22. This prevents crosscompiling ppc64x code on 32 bit hosts.

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #67018 (for 1.22).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.

@dmitshur dmitshur added this to the Go1.23 milestone Apr 24, 2024
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Apr 24, 2024
@dmitshur dmitshur changed the title Go 1.22.x failed to be bootstrapped from 386 to ppc64le cmd/compile: Go 1.22.x failed to be bootstrapped from 386 to ppc64le Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-386 Issues solely affecting the 32-bit x86 architecture arch-ppc64x NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants