pkujhd / goloader

load and run golang code at runtime.
Apache License 2.0
497 stars 58 forks source link

Do I have to build the host program with `-w`? #67

Closed TheMightyGit closed 1 year ago

TheMightyGit commented 1 year ago

Fails to build (host program, not plugin)

$ go build ./cmd/marvbench
# github.com/TheMightyGit/marvbench/cmd/marvbench
go.info.runtime.itabLock: relocation target go.info.github.com/pkujhd/goloader.mutex not defined
go.info.runtime.itabTable: relocation target go.info.*github.com/pkujhd/goloader.itabTableType not defined

Builds

$ go build --ldflags="-w" ./cmd/marvbench
$

go.mod (snippet)

github.com/pkujhd/goloader v0.0.0-20221206082715-6b332ca22390

go version

$ go version
go version go1.19.1 darwin/amd64
pkujhd commented 1 year ago

@TheMightyGit , you may try the pr https://github.com/pkujhd/goloader/pull/66

eh-steve commented 1 year ago

Yeah this was fixed in these commits in that PR

pkujhd commented 1 year ago

@TheMightyGit , you may try the pr #66

already port PR to fix the bug by commit https://github.com/pkujhd/goloader/commit/0b5d8fa4407c35c098106fa74205811b81a05dc0