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

golang test try to load different shared library name from CgoLDFLAGS #69605

Closed
beer-1 opened this issue Sep 24, 2024 · 4 comments
Closed

golang test try to load different shared library name from CgoLDFLAGS #69605

beer-1 opened this issue Sep 24, 2024 · 4 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@beer-1
Copy link

beer-1 commented Sep 24, 2024

Go version

1.22

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/runner/.cache/go-build'
GOENV='/home/runner/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/runner/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/runner/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/hostedtoolcache/go/1.22.7/x64'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/hostedtoolcache/go/1.22.7/x64/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.7'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/runner/work/movevm/movevm/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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1822593352=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Try to link different shared libraries depends on the build arch.

What did you see happen?

When we rebuild the shared library for testing, golang try to find shared library libmovevm.so not libmovevm.x86_64.so.

/tmp/go-build3551466219/b001/movevm.test: error while loading shared libraries: libmovevm.so: cannot open shared object file: No such file or directory

full logs

We defined shared linking in api/link_linux_glibc_x86_64.go. and our CgoLDFLAGS is properly showing

	"CgoLDFLAGS": [
		"-Wl,-rpath,/home/runner/work/movevm/movevm/api",
		"-L/home/runner/work/movevm/movevm/api",
		"-lmovevm.x86_64",
		"-lcompiler.x86_64"
	],

linking definition

If we remove this line, it is properly working.
Here is success log without make build-rust.

What did you expect to see?

Load libmovevm.x86_64.so not libmovevm.so

@beer-1 beer-1 changed the title import/path: issue golang test try to load different shared library name from CgoLDFLAGS golang test try to load different shared library name from CgoLDFLAGS Sep 24, 2024
@beer-1
Copy link
Author

beer-1 commented Sep 24, 2024

This GitHub action had no problem two weeks ago, but not sure why this happening
history: https://github.com/initia-labs/movevm/actions/workflows/test.yml?page=2

@dr2chase
Copy link
Contributor

@golang/compiler

@dr2chase dr2chase added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 26, 2024
@mknyszek mknyszek added this to the Backlog milestone Sep 27, 2024
@mknyszek mknyszek added the compiler/runtime Issues related to the Go compiler and/or runtime. label Sep 27, 2024
@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 1, 2024
@gopherbot
Copy link
Contributor

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@gopherbot gopherbot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
Development

No branches or pull requests

6 participants