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

macOS Linking error running with dlv debug #3710

Closed
adammw opened this issue Apr 22, 2024 · 1 comment
Closed

macOS Linking error running with dlv debug #3710

adammw opened this issue Apr 22, 2024 · 1 comment

Comments

@adammw
Copy link

adammw commented Apr 22, 2024

Please answer the following before submitting your issue:

  1. What version of Delve are you using (dlv version)? 1.22.1
  2. What version of Go are you using? (go version)? go version go1.22.2 darwin/amd64
  3. What operating system and processor architecture are you using? Mac OS 14.4.1 (23E224) amd64

Reproduction Steps

result=65280
  • 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
@aarzilli
Copy link
Member

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.

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

No branches or pull requests

3 participants