Skip to content

cmd/link: undefined symbol when dynamically linking linux/arm64 -buildmode=shared #70222

Closed as not planned
@qinlonglong123

Description

@qinlonglong123

Go version

go1.22.1 linux/arm64

Output of go env in your module/workspace:

GO111MODULE='off'
GOARCH='arm64'
GOBIN=''
GOCACHE='/usr1/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/opt/go_workpace/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/opt/go_workpace'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/root/go/'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/root/go/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD=''
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 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3307636971=/tmp/go-build -gno-record-gcc-switches'

What did you do?

package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

I'm trying to use the Golang/go linkshared feature on Linux/ARM64, Here is my command to run:

go version
go install -a -buildmode=shared -linkshared std
go build -a -linkshared -o main_shared main.go
./main_shared

What did you see happen?

./main_shared: symbol lookup error: /root/go/pkg/linux_arm64_dynlink/libstd.so: undefined symbol: __aarch64_ldadd8_acq_rel

What did you expect to see?

Output the expected string Hello, World!

Metadata

Metadata

Assignees

No one assigned

    Labels

    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions