Skip to content
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

ARM flags GOARM #36

Closed
denji opened this issue Jan 3, 2017 · 8 comments · Fixed by #213
Closed

ARM flags GOARM #36

denji opened this issue Jan 3, 2017 · 8 comments · Fixed by #213
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@denji
Copy link

denji commented Jan 3, 2017

Supported architectures

Go supports the following ARM architectural families.

Architecture Status GOARM value GOARCH value
ARMv4 and below sorry, not supported n/a n/a
ARMv5 supported GOARM=5 GOARCH=arm
ARMv6 supported GOARM=6 GOARCH=arm
ARMv7 supported GOARM=7 GOARCH=arm
ARMv8 supported without GOARM GOARCH=arm64

Starting from Go 1.1, the appropriate GOARM value will be chosen if you compile the program from source on the target machine. In cross compilation situations, it is recommended that you always set an appropriate GOARM value along with GOARCH.

Supported operating systems

  • ARM on Linux. You must run an EABI kernel. These are generally known as armel for softfloat (compatible with ARMv5) or armhf for hardware floating point (ARMv6 and above).
  • ARM on Darwin: ARMv7 is required.
  • ARM on FreeBSD, OpenBSD, and NetBSD: ARMv6K or above is required.

arm

See https://golang.org/doc/install/source#environment

  • GOARM=5: use software floating point; when CPU doesn't have VFP co-processor
  • GOARM=6: use VFPv1 only; default if cross compiling; usually ARM11 or better cores (VFPv2 or better is also supported)
  • GOARM=7: use VFPv3; usually Cortex-A cores

arm64

All ARMv8-A processors.

ppc64 (big endian)

"Big-endian 64-bit PowerPC (linux/ppc64) only requires the POWER5 architecture." (from
https://golang.org/doc/go1.7#ports)

ppc64le (little endian)

"The experimental port to Linux on little-endian 64-bit PowerPC (linux/ppc64le) now requires the POWER8 architecture or later." (from
https://golang.org/doc/go1.7#ports)

mips64 (big endian)

MIPS III or higher. Builder is using MIPS64r2.

mips64le (little endian)

MIPS III or higher in little endian mode. Builders are using Loongson 2E/2F.

s390x

z196+

mips (big endian) and mipsle (little endian)

MIPS32r1, with FPU or kernel FPU emulation

@denji denji changed the title ARM flags GOARCH, GOARM? ARM flags GOARM Jan 3, 2017
@caarlos0
Copy link
Member

OK, so, here, we would have to add a goarm option together with goos and goarch, is that it?

@denji
Copy link
Author

denji commented Apr 23, 2017

@caarlos0 That's right, with GOARCH=arm64 do not need to set a variable GOARM (only with GOARCH=arm)

@caarlos0
Copy link
Member

hmm, can't we just assume GOARM=7 all the times GOARCH=arm ?

@denji
Copy link
Author

denji commented Apr 23, 2017

  • GOOS=<CROSS> GOARM=5 GOARCH=arm - use software floating point; when CPU doesn't have VFP co-processor
  • GOOS=<CROSS> GOARM=6 GOARCH=arm - use VFPv1 only; default if cross compiling; usually ARM11 or better cores (VFPv2 or better is also supported)
  • GOOS=<CROSS> GOARM=7 GOARCH=arm - use VFPv3; usually Cortex-A cores
  • GOOS=<CROSS> GOARCH=arm64 - All ARMv8-A processors.

  • GOOS=linux GOARCH=ppc64 - Big-endian 64-bit PowerPC (linux/ppc64) only requires the POWER5 architecture.
  • GOOS=linux GOARCH=ppc64le - The experimental port to Linux on little-endian 64-bit PowerPC (linux/ppc64le) now requires the POWER8 architecture or later.

  • GOOS=<CROSS> GOARCH=mips64 - MIPS III or higher. Builder is using MIPS64r2.
  • GOOS=<CROSS> GOARCH=mips64le - MIPS III or higher in little endian mode. Builders are using Loongson 2E/2F.

  • GOOS=<CROSS> GOARCH=mips - MIPS32r1 (big endian), with FPU or kernel FPU emulation.
  • GOOS=<CROSS> GOARCH=mipsle - MIPS32r1 (little endian), with FPU or kernel FPU emulation.

  • GOOS=<CROSS> GOARCH=s390x - z196+

@caarlos0
Copy link
Member

OK, so, no.

So, we can do something like this:

build:
  goos:
    - linux
   goarch:
    - arm
    - arm64
   goarm:
    - 5
    - 6
    - 7

which would generate:

  • linux-arm64
  • linux-arm-v5
  • linux-arm-v6
  • linux-arm-v7

Does that work for you?

@caarlos0 caarlos0 added this to the v1.0.0 milestone Apr 24, 2017
@caarlos0 caarlos0 added the enhancement New feature or request label Apr 24, 2017
@caarlos0 caarlos0 self-assigned this Apr 24, 2017
@caarlos0
Copy link
Member

Check #213 please...

@caarlos0
Copy link
Member

@denji can you check v0.14.0 please?

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants