Skip to content

doc: document that GOARM applies to cmd/gc as well #9672

@rasky

Description

@rasky

Hello, I have a program, written for a specific Linux-ARM5 board, whose cpuinfo is:

Processor   : ARM926EJ-S rev 5 (v5l)
BogoMIPS    : 56.52
Features    : swp half fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant : 0x0
CPU part    : 0x926
CPU revision    : 5

Hardware    : Bluegiga APX4 Development Kit
Revision    : 9050003
Serial      : 000000004d9ec28b

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 pass GOARM=5 at go build time. In fact, documentation is a little fuzzy on details; I always assumed that whatever you pass during make.bash is just a default, that can be overriden during go build.

This is the result matrix of my tests:

  • Go 1.2: GOARM=5 ./make.bash followed by GOARM=5 go build: SUCCESS
  • Go 1.2: ./make.bash followed by GOARM=5 go build: SUCCESS
  • Go 1.3+: GOARM=5 ./make.bash followed by GOARM=5 go build: SUCCESS
  • Go 1.3+: ./make.bash followed by GOARM=5 go build: SIGILL

I ran git bisect and found out that this change in behavior was introduced by the commit 4230044. So before that commit, I can avoid using GOARM=5 while building the Go compiler, and produce working binaries; after that commit, I need to pass GOARM=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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions