Skip to content

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

Closed

Description

@cheese

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+.

Activity

  1. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Apr 22, 2024
  2. mauri870 commented on Apr 22, 2024

    @mauri870
    Member

    cc @golang/compiler @golang/ppc64

  3. added
    arch-386Issues solely affecting the 32-bit x86 architecture
    on Apr 22, 2024
  4. self-assigned this
    on Apr 22, 2024
  5. gopherbot commented on Apr 22, 2024

    @gopherbot
    Contributor

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

  6. cheese commented on Apr 23, 2024

    @cheese
    Author

    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.

  7. pmur commented on Apr 24, 2024

    @pmur
    Contributor

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

  8. gopherbot commented on Apr 24, 2024

    @gopherbot
    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.

  9. added this to the Go1.23 milestone on Apr 24, 2024
  10. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    and removed
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Apr 24, 2024
  11. added a commit that references this issue on Apr 24, 2024
    3aad2d0
  12. 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[/+] on Apr 24, 2024
  13. locked and limited conversation to collaborators on Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.arch-386Issues solely affecting the 32-bit x86 architecturearch-ppc64x

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions