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

cmd/ld: no dwarf when using -linkmode=external on OS X #8973

Closed
rsc opened this issue Oct 21, 2014 · 6 comments
Closed

cmd/ld: no dwarf when using -linkmode=external on OS X #8973

rsc opened this issue Oct 21, 2014 · 6 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Oct 21, 2014

CL https://golang.org/cl/9025047 disabled dwarf generation when using
-linkmode=external on OS X:

changeset:   16733:3ac710a2ebf3
user:        Rob Pike <[email protected]>
date:        Tue Apr 30 14:22:28 2013 -0700
files:       src/cmd/ld/dwarf.c
description:
cmd/ld: when linking externally, only generate dwarf info for ELF

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/9025047

This makes lldb/gdb useless on Mac when using cgo outside the Go standard library.

Anyone remember why we did this?

Should look into undoing it for Go 1.4.
@rsc
Copy link
Contributor Author

rsc commented Oct 28, 2014

Comment 1:

from private mail:
Well apparently it's a mess. OS X has a separate dwarf linker. ld is supposed to add
references to all .o files into the executable. Then you can run dsymutil to read all
the .o files mentioned in the binary and combine the debug info into a .dwarf file. I've
got a patch that seems to get the debug info into the correct format for a mach o object
file, but for some reason ld doesn't include it in the list of the .o files, so the info
just disappears.

Labels changed: added release-go1.5, removed release-go1.4.

@gopherbot
Copy link
Contributor

Comment 2:

CL https://golang.org/cl/168780043 mentions this issue.

@bradfitz bradfitz modified the milestone: Go1.5 Dec 16, 2014
@josharian
Copy link
Contributor

Possibly related: #5221.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/8661 mentions this issue.

@rsc rsc closed this as completed in 8b83306 May 19, 2015
@josharian
Copy link
Contributor

CL 8661 was rolled back due to build breakage.

@josharian josharian reopened this May 19, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/10284 mentions this issue.

@rsc rsc closed this as completed in be59731 May 21, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants