-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: combining dwarf failed: Unknown load command 0x80000018 (2147483672) #32233
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
Comments
Problem appears to be here I think. Looks like the constant defined for LC_LOAD_WEAK_DYLIB is incorrect. I will send a patch. |
Awesome, thank you for the quick response, it probably has to be more like |
Change https://golang.org/cl/178723 mentions this issue: |
Change https://golang.org/cl/178726 mentions this issue: |
Test case for issue 32233. Updates #32233. Change-Id: I0e3b4a46832f39de4ef36d8fd8c6070bf9b1a019 Reviewed-on: https://go-review.googlesource.com/c/go/+/178726 Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Hi @triztian I've made an attempt to adapt your reproducer as a testcase -- see https://golang.org/cl/178726. My first attempt is problematic in that I it contains code that doesn't work with older versions of MacOS, e.g. 10.11, since it refers to the UserNotifications framework. I can add guards via #ifdef to insure that those constructs are conditionally compiled based on the OS version, e.g.
however I can't use the same trick with the cgo directives. Something like
doesn't have the desired effect, since cgo doesn't run the C preprocessor. A question for you: is it possible to reproduce the same DWARF issue without using the newer framework (e.g. just using something from the Foundation framework)? Thanks, Than |
Change https://golang.org/cl/179837 mentions this issue: |
OK, I think I have a revised testcase that works. |
@thanm I stumbled into the issue randomly because I was trying to use the I don't have an alternative way to reproduce that issue. I could look into how we can get the compiler to produce a binary that specifically uses that MACH-O command. Ah, from looking at the revised test case, did you try different frameworks randomly?, curious about it. Thank you for looking into this issue! |
Rework this recently introduced test case to insure that it works with older versions of the OS. It was using a new framework library not available on pre-10.14 to trigger the weak symbol reference; switch to using a new symbol from an existing library. Tested on MacOS 10.14 and 10.11. Updates #32233. Change-Id: I1fe2a9255fca46cb7cdf33ff7fed67bba86fdc22 Reviewed-on: https://go-review.googlesource.com/c/go/+/179837 Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Tried to install the
main
packageWhat did you expect to see?
A successful linking and executable for the macOS platform.
What did you see instead?
The following error:
go install
OutputNotes
I've created the following repo to reproduce the issue:
The subpackage
github.com/triztian/dwarfunk/lib
contains an objective-c file and successfully builds using thego build
command:I've noticed that if I edit the
objc.m
file and remove the following line, then thego install
command works.Looking at the following CL, it seems like the command is not part of the list:
Could it be that the the command has to be added and
OR
ed as depicted in theruby-macho
library?The text was updated successfully, but these errors were encountered: