-
Notifications
You must be signed in to change notification settings - Fork 18k
doc: document that GOARM applies to cmd/gc as well #9672
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
Starting with Go 1.3, GOARM is no longer a link time setting, so you have We do need to document this better. |
Yes, I think a documentation update is required. Some additional comments:
|
Hint to your first question: see docs for go install -installsuffix option. Similar to GOARM, GO386 affects 386 code generation. Just building for all GOOS/GOARCH combinations is not sufficient for a |
Sorry if I'm being dense, but I can't see how to produce a single toolchain installed into a single prefix that can compile both ARM5 and ARM6 binaries (just like it can also compile linux-x64 and darwin-386). If I run Am I supposed to just build the standard library with another script, and then manually use |
I meant after running GOARCH=arm make.bash --no-clean: GOARM=5 GOARCH=arm go install -installsuffix arm5 std When you want to build something, use the appropriate -installsuffix as well. Because GOARM setting affects the compiler, there is no way to avoid extra |
OK many thanks for the clarification. My comment is that it's really an unfortunate choice, and breaks the orthogonality of the multilib system you already have in place. GCC doesn't have this problem for instance. I am not qualified to comment on what could be a possible improvement to this situation, but you are surely making the life harder to embedded developers. |
CL https://golang.org/cl/12620 mentions this issue. |
Hello, I have a program, written for a specific Linux-ARM5 board, whose cpuinfo is:
The program appears to work with Go 1.2, while it segfaults at startup (illegal instruction) with 1.3 and 1.4. After closer testing, it appears related to whether the Go compiler is compiled with
GOARM=5
or not, even if we always passGOARM=5
atgo build
time. In fact, documentation is a little fuzzy on details; I always assumed that whatever you pass duringmake.bash
is just a default, that can be overriden duringgo build
.This is the result matrix of my tests:
GOARM=5 ./make.bash
followed byGOARM=5 go build
: SUCCESS./make.bash
followed byGOARM=5 go build
: SUCCESSGOARM=5 ./make.bash
followed byGOARM=5 go build
: SUCCESS./make.bash
followed byGOARM=5 go build
: SIGILLI ran
git bisect
and found out that this change in behavior was introduced by the commit 4230044. So before that commit, I can avoid usingGOARM=5
while building the Go compiler, and produce working binaries; after that commit, I need to passGOARM=5
while building the Go compiler, otherwise the binaries don't work.Notice that in all my testing I never saw the nice error message introduced in 212ce41. Maybe the fact that this message is not shown is part of this bug, or maybe it's just a different orthogonal bug, but I thought it was worth mentioning.
The text was updated successfully, but these errors were encountered: