Closed zoncoen closed 4 months ago
Thanks for reporting! When I get some time I'll look into this.
Just quickly looked into it and was able to reproduce on M1 by setting GOARCH=amd64. Haven't found a cause yet
So, R15 is a scratch register normally but is the GOT register in when linking dynamically see Go ABI. The issue that introduced this change is here: https://github.com/golang/go/issues/43661
The fix is to save the R15 register before we access any global which clobber the R15 register
Thank you for your quick support! It works for our case with replace
directive. 👍
PureGo Version
v0.7.1
Operating System
Go Version (
go version
)go version go1.22.4 linux/amd64
What steps will reproduce the problem?
Build the following code with
-buildmode=plugin
option. (ref. https://pkg.go.dev/plugin)purego@v0.5.1
succeeds building, butpurego@v0.6.1
andpurego@v0.7.1
raise the error.The complete reproduction code is here. sample error log
What is the expected result?
go build -buildmode=plugin -o plugin.so .
succeeds without error.What happens instead?
Anything else you feel useful to add?
No response