-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/link: revisit dwarf in executable files on OS X #11994
Comments
I have looked around inside osxcross now and it only supplies a dummy dsymutil so thats probably the whole reason. |
Yes, the use of dsymutil was added by https://golang.org/cl/10284 in May. |
Yes, dsymutil is only used by Go since Go 1.5. Since there is a workaround (and the fix would be to just make the workaround be the default when using external linking), I don't believe we will make any changes to this behavior for Go 1.5. We can reconsider for Go 1.6 if this turns out to be a very common problem, but it seems to me that having debug info in the common case is probably more important than having to add -s when doing something a bit unusual, like using osxcross or codesign. |
Repurposing this bug to collect issues with the "dwarf in executable" code that appear during the Go 1.5 cycle. The other so far is #11887. |
I suggest that when cross-compiling, we check whether dsymutil didn't generate a file, and just skip the DWARF combining in that case. |
There's a go 1.5 bug that requires this: golang/go#11994
Because the toolchain bootstraping process changed in Go 1.5, this change imports the "pure bootstraper" from the https://github.com/karalabe/xgo project. There's also Go 1.5 bug that required adding the `ldflags=-s` flag for OS X: golang/go#11994
Although the It leads to errors such as the following:
|
Shouldn't DWARF stipping be tied to |
Seems like this one is going to be a breaking change. @ianlancetaylor @rsc can you guys provide some guidance? |
Earlier I suggested that when cross-compiling, we check whether dsymutil didn't generate a file, and just skip the DWARF combining in that case. That still seems right to me. Does it not work around the issue as best we can? |
@ianlancetaylor It seems the correct choice to me too. Just wanted you guys to know that the current workaround can break for more complex scenarios. |
CL https://golang.org/cl/16702 mentions this issue. |
Just to get back on this issue. The fix indeed seems to have solved the linker problems. I can now cross compile on darwin with more complex C dependencies. |
This works fine with go 1.4.x. I've tried the go master branch a handful of times during the last month or so with the same result.
Error from go build:
Environment:
The clang toolchain in use is osxcross
@ianlancetaylor suggested to use
-ldflags=-s
as a work around which produced a working binary.The text was updated successfully, but these errors were encountered: