You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
I’m on arm64 Darwin and wanted to view the asm output for amd64 Darwin.
Using a simple hello world example, this worked and output arm asm:
$ go tool compile -S hello.go
This worked and built a full x86 binary:
$ GOARCH=amd64 go build hello.go
But this failed:
$ GOARCH=amd64 go tool compile -S hello.go
hello.go:4:5: could not import fmt (file not found)
To fix it, I downloaded a binary release for amd64 and pointed go tool to its pkg directory. This now works:
$ GOARCH=amd64 go tool compile -I /path/to/go/release/pkg/darwin_amd64 -S hello.go
My question: is there an easier way that I’ve missed? Presumably go build had built fmt _somehow_ since it successfully made an x86 binary. I read the docs for go build and cmd/compile to see if I could get build to output the packagefiles it produces in a way that cmd/compile can point to or some such, but I didn’t see an obvious way.
-eli
Ian Lance Taylor
unread,
Oct 2, 2022, 10:00:26 PM10/2/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message