Skip to content

x/text: building as a plugin failure on darwin/arm64 #58826

@zoncoen

Description

@zoncoen

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

$ go version
go version go1.20.1 darwin/arm64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/zoncoen/Library/Caches/go-build"
GOENV="/Users/zoncoen/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/zoncoen/dev/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/zoncoen/dev"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/zoncoen/dev/src/github.com/zoncoen-sample/go1.20-plugin-issue/go.mod"
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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7b/75304vxx7szc4b0lph6y311c0000gp/T/go-build328686675=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go build fails with -buildmode=plugin flag on darwin/arm64 if the code imports golang.org/x/text.

$ go build -buildmode=plugin -o plugin.so .
$ cat main.go
package main

import "golang.org/x/text/date"

func EtcUTC() int {
        return date.EtcUTC
}

The complete reproducing code is here.

What did you expect to see?

go build succeeds without error.

What did you see instead?

$ go build -buildmode=plugin -o plugin.so .
# golang.org/x/text/internal/language
:1: REGTMP used in large offset load: 00204 (/Users/zoncoen/dev/pkg/mod/golang.org/x/text@v0.7.0/internal/language/coverage.go:18)       MOVD    2189(R27), R5

I have confirmed that it builds correctly on linux/amd64.

Metadata

Metadata

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions