Skip to content

gccgo: fail to bootstrap go1.21 #60913

@zhsj

Description

@zhsj

What version of Go are you using (go version)?

$ go version
go version go1.18 gccgo (Debian 12.3.0-4) 12.3.0 linux/amd64

Does this issue reproduce with the latest release?

Haven't tested with gcc13.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/zsj/.cache/go-build"
GOENV="/home/zsj/.config/go/env"
GOEXE=""
GOEXPERIMENT="fieldtrack,regabiwrappers"
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/zsj/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/zsj/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/usr"
GOSUMDB="sum.golang.google.cn"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/gcc/x86_64-linux-gnu/12"
GOVCS=""
GOVERSION="go1.18 gccgo (Debian 12.3.0-4) 12.3.0"
GCCGO="/usr/bin/x86_64-linux-gnu-gccgo-12"
GOAMD64="v1"
AR="ar"
CC="x86_64-linux-gnu-gcc-12"
CXX="x86_64-linux-gnu-g++-12"
CGO_ENABLED="1"
GOMOD="/home/zsj/Workspaces/debian/package/pkg-go/golang/src/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4044047194=/tmp/go-build -gno-record-gcc-switches -funwind-tables"

What did you do?

GOROOT_BOOTSTRAP=$(go-12 env GOROOT) ./make.bash

What did you expect to see?

No error.

What did you see instead?

      |                            ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/profile.go:14:28: error: import file 'internal/lazyregexp' not found
   14 |         "internal/lazyregexp"
      |                            ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:22:24: error: reference to undefined name 'lazyregexp'
   22 |         countStartRE = lazyregexp.New(`\A(\w+) profile: total \d+\n\z`)
      |                        ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:23:24: error: reference to undefined name 'lazyregexp'
   23 |         countRE      = lazyregexp.New(`\A(\d+) @(( 0x[0-9a-f]+)+)\n\z`)
      |                        ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:25:24: error: reference to undefined name 'lazyregexp'
   25 |         heapHeaderRE = lazyregexp.New(`heap profile: *(\d+): *(\d+) *\[ *(\d+): *(\d+) *\] *@ *(heap[_a-z0-9]*)/?(\d*)`)
      |                        ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:26:24: error: reference to undefined name 'lazyregexp'
   26 |         heapSampleRE = lazyregexp.New(`(-?\d+): *(-?\d+) *\[ *(\d+): *(\d+) *] @([ x0-9a-f]*)`)
      |                        ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:28:30: error: reference to undefined name 'lazyregexp'
   28 |         contentionSampleRE = lazyregexp.New(`(\d+) *(\d+) @([ x0-9a-f]*)`)
      |                              ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:30:23: error: reference to undefined name 'lazyregexp'
   30 |         hexNumberRE = lazyregexp.New(`0x[0-9a-f]+`)
      |                       ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:32:26: error: reference to undefined name 'lazyregexp'
   32 |         growthHeaderRE = lazyregexp.New(`heap profile: *(\d+): *(\d+) *\[ *(\d+): *(\d+) *\] @ growthz`)
      |                          ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:34:33: error: reference to undefined name 'lazyregexp'
   34 |         fragmentationHeaderRE = lazyregexp.New(`heap profile: *(\d+): *(\d+) *\[ *(\d+): *(\d+) *\] @ fragmentationz`)
      |                                 ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:36:26: error: reference to undefined name 'lazyregexp'
   36 |         threadzStartRE = lazyregexp.New(`--- threadz \d+ ---`)
      |                          ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:37:26: error: reference to undefined name 'lazyregexp'
   37 |         threadStartRE  = lazyregexp.New(`--- Thread ([[:xdigit:]]+) \(name: (.*)/(\d+)\) stack: ---`)
      |                          ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:39:22: error: reference to undefined name 'lazyregexp'
   39 |         procMapsRE = lazyregexp.New(`([[:xdigit:]]+)-([[:xdigit:]]+)\s+([-rwxp]+)\s+([[:xdigit:]]+)\s+([[:xdigit:]]+):([[:xdigit:]]+)\s+([[:digit:]]+)\s*(\S+)?`)
      |                      ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:41:23: error: reference to undefined name 'lazyregexp'
   41 |         briefMapsRE = lazyregexp.New(`\s*([[:xdigit:]]+)-([[:xdigit:]]+):\s*(\S+)(\s.*@)?([[:xdigit:]]+)?`)
      |                       ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:634:9: error: range clause must have array, slice, string, map, or channel type
  634 |         for _, s := range hexStrings {
      |         ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/profile.go:195:13: error: reference to undefined name 'lazyregexp'
  195 | var libRx = lazyregexp.New(`([.]so$|[.]so[._][0-9]+)`)
      |             ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/internal/profile/legacy_profile.go:634:13: error: invalid type for range clause
  634 |         for _, s := range hexStrings {
      |             ^
note: module requires Go 1.20
# bootstrap/cmd/compile/internal/types
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/cmd/compile/internal/types/goversion.go:10:28: error: import file 'internal/lazyregexp' not found
   10 |         "internal/lazyregexp"
      |                            ^
/home/zsj/Workspaces/debian/package/pkg-go/golang/src/cmd/compile/internal/types/goversion.go:84:19: error: reference to undefined name 'lazyregexp'
   84 | var goVersionRE = lazyregexp.New(`^go([1-9]\d*)\.(0|[1-9]\d*)$`)
      |                   ^
note: module requires Go 1.20
# bootstrap/cmd/cgo
/usr/bin/ld: warning: stub.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: $WORK/b014/_pkg_.a(_go_.o):(.data.rel.ro.bootstrap_1internal_1abi.FuncPCABIInternal..f+0x0): undefined reference to `bootstrap_1internal_1abi.FuncPCABIInternal'
/usr/bin/ld: $WORK/b014/_pkg_.a(_go_.o):(.data.rel.ro.bootstrap_1internal_1abi.FuncPCABI0..f+0x0): undefined reference to `bootstrap_1internal_1abi.FuncPCABI0'
collect2: error: ld returned 1 exit status
# bootstrap/cmd/link
/usr/bin/ld: warning: stub.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: $WORK/b014/_pkg_.a(_go_.o):(.data.rel.ro.bootstrap_1internal_1abi.FuncPCABIInternal..f+0x0): undefined reference to `bootstrap_1internal_1abi.FuncPCABIInternal'
/usr/bin/ld: $WORK/b014/_pkg_.a(_go_.o):(.data.rel.ro.bootstrap_1internal_1abi.FuncPCABI0..f+0x0): undefined reference to `bootstrap_1internal_1abi.FuncPCABI0'
collect2: error: ld returned 1 exit status
# bootstrap/cmd/asm
/usr/bin/ld: warning: stub.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: $WORK/b014/_pkg_.a(_go_.o):(.data.rel.ro.bootstrap_1internal_1abi.FuncPCABIInternal..f+0x0): undefined reference to `bootstrap_1internal_1abi.FuncPCABIInternal'
/usr/bin/ld: $WORK/b014/_pkg_.a(_go_.o):(.data.rel.ro.bootstrap_1internal_1abi.FuncPCABI0..f+0x0): undefined reference to `bootstrap_1internal_1abi.FuncPCABI0'
collect2: error: ld returned 1 exit status
go tool dist: FAILED: /usr/bin/go install -tags=math_big_pure_go compiler_bootstrap purego bootstrap/cmd/...: exit status 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions