Skip to content

x/sys/cpu: go install -buildmode=shared std failed #49942

@zhouguangyuan0718

Description

@zhouguangyuan0718

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

$ go version
go version devel go1.18-098599003b Fri Dec 3 01:09:21 2021 +0000 linux/amd64

Does this issue reproduce with the latest release?

No, it reproduce with tip.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/mnt/d/01.golang/01.GOPATH/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/mnt/d/01.golang/01.GOPATH/"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/mnt/d/01.golang/03.godev/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/mnt/d/01.golang/03.godev/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel go1.18-098599003b Fri Dec 3 01:09:21 2021 +0000"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/mnt/d/01.golang/03.godev/go/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-build2041059842=/tmp/go-build -gno-record-gcc-switches"

What did you do?

run the command go install -buildmode=shared std

What did you expect to see?

Install the libstd.so in $goroot/pkg/....

What did you see instead?

Failed.

$ go install -buildmode=shared std
# /tmp/go-build268340113/b232/libstd.so
vendor/golang.org/x/sys/cpu.darwinSupportsAVX512·f: missing section for relocation target vendor/golang.org/x/sys/cpu.darwinSupportsAVX512

In the CL https://go-review.googlesource.com/c/sys/+/361255, the implement of darwinSupportsAVX512 is removed in cpu_x86.s, but it didn't be removed in cpu_gc_x86.go.
https://github.com/golang/sys/blob/fe61309f888157de161a48facf03d9412635cffe/cpu/cpu_gc_x86.go#L21

It should be removed in cpu_gc_x86.go and sync it to golang/go.

Metadata

Metadata

Assignees

No one assigned

    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