Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llgo running _demo/math/math.go get error : Undefined symbols for architecture x86_64 #367

Open
2458zhanghehe opened this issue Jun 20, 2024 · 1 comment

Comments

@2458zhanghehe
Copy link

when using llgo run . running _demo/math/math.go get error:

Undefined symbols for architecture x86_64:
  "_internal/cpu.X86", referenced from:
      _math.init$hasPatch in 661363be1bd784975e2a005f92f4b60cfdb12b43c29d86a19616165bebe38d40-d-0649bb.o
  "_internal/cpu.init", referenced from:
      _math.init$hasPatch in 661363be1bd784975e2a005f92f4b60cfdb12b43c29d86a19616165bebe38d40-d-0649bb.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

go version : 1.21.4.
macOS : 13.6.7

It was correct when using go1.22.4, but the go+ plugin got connect error in go1.22.4

go env :

GO111MODULE=''
GOARCH='amd64'
GOBIN='/Users/zhangyifan/go/bin'
GOCACHE='/Users/zhangyifan/Library/Caches/go-build'
GOENV='/Users/zhangyifan/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/zhangyifan/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/zhangyifan/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_amd64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/zhangyifan/Documents/llgo/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 x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/nc/j_4dvjq50w37k5l3tmsm8jn80000gn/T/go-build2288917245=/tmp/go-build -gno-record-gcc-switches -fno-common'

Environment variables

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export LLGOROOT="/Users/zhangyifan/Documents/llgo"
export LLGO_LIB_PYTHON="/opt/anaconda3/lib/python3.11"
export DYLD_LIBRARY_PATH="/opt/anaconda3/lib:$DYLD_LIBRARY_PATH"
export GOROOT=/usr/local/go
export PATH=$PATH:$HOME/go/bin
export PATH=$PATH:$GOROOT/bin
#export GOPATH=$HOME/go
#export GOBIN=$HOME/go/bin
@spongehah
Copy link
Contributor

This hash version 54e3210 is working properly, but it does not work properly after updating to the latest version

go version
go1.21.4 darwin-amd64
gop version
gop v1.2.6 devel darwin-amd64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants