-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: wrong c-archive architecture using GNU binutils ar on macOS Mojave 10.14.1 #28796
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
What |
My
So if I prioritize the default utils instead, it actually does work:
So something about the GNU utils doesn't work with the Go build. I can keep that in mind, but it would be really nice if that could be supported directly, if possible. |
Could you examine the output of the system default ar program and the GNU binutils ar program and see what the difference is? Is there some option we could pass to the GNU ar program that will make it do the right thing? |
I'm not familiar with |
I will leave this open in the hopes that someone using MacOS can look into it. Thanks. |
same issue I am using golang(1.12.7) with pkg installed to build golang(1.12.7) from source code
|
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?
Following the instructions at https://golang.org/doc/install/source, with the latest 1.11.2 darwin/amd64 Go binary distribution as the bootstrap toolchain:
What did you expect to see?
Go project should build successfully.
What did you see instead?
Error log: https://gist.github.com/DemonWav/8caf4fbdf9642133f53502614a231a24
Issues occur with
##### ../misc/cgo/testcarchive
. I believe the issue is with this line:ld: warning: ignoring file pkg/darwin_amd64/libgo.a, file was built for archive which is not the architecture being linked (x86_64): pkg/darwin_amd64/libgo.a
Since the architecture doesn't match, it doesn't link, and the linker can't find the missing symbols.
If I instead ask for the
386
architecture (GOARCH=386 ./all.bash
), it builds successfully: https://gist.github.com/DemonWav/533894d4426e6a9dc7cc84cc613ee66dThe host is still recognized as
amd64
in the build log, though.It appears
libgo
is always compiled asi386
architecture, even when both host and target are defined asamd64
,GOARCH=amd64 GOHOSTARCH=amd64 ./all.bash
gives the same result.I'm not sure if there's something wrong with my environment or what, but I've asked on Slack and IRC and no one seems to know. I'm sorry if this isn't an issue.
The text was updated successfully, but these errors were encountered: