You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run dlv debug . and see that it errors out at the linking step:
/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/link: running cc failed: exit status 1
Undefined symbols for architecture x86_64:
"_decode_int32", referenced from:
_sample_func in 000002.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
exit status 1
The text was updated successfully, but these errors were encountered:
This is not an issue with delve. You can reproduce it with just go by doing:
$ CGO_CFLAGS='-O0 -g' go build
# example.com
$GOROOT/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: warning: -no_pie is deprecated when targeting new OS versions
Undefined symbols for architecture x86_64:
"_decode_int32", referenced from:
_sample_func in 000002.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It should be reported to https://github.com/golang/go.
You can work around this problem by doing export CGO_CFLAGS=-g before executing delve.
Please answer the following before submitting your issue:
dlv version
)?1.22.1
go version
)?go version go1.22.2 darwin/amd64
Mac OS 14.4.1 (23E224)
amd64
Reproduction Steps
go mod init
to create go.mod filego build .
and see that it succeedsgo run .
and see that it runs correctly:dlv debug .
and see that it errors out at the linking step:The text was updated successfully, but these errors were encountered: