Tweak for GoLang PowerPC Build

As many know, Go is a designed to build architecture and operating system specific binaries. These architecture and operating system specific binaries are called a target. One can target GOARCH=ppc64le GOOS=linux go build to build for the specific OS. There is a nice little tweak which considers the architectures version and optimizes the selection of the ASM (assembler code) uses when building the code.

To use the Power Architecture ppc64le for a specific target, you can use GOPPC64:

  1. power10 – runs with Power 10 only.
  2. power9 – runs with Power 9 and Power 10.
  3. power8 (the default) and runs with 8,9,10.

For example the command is GOARCH=ppc64le GOOS=linux GOPPC64=power9 go build

This may help with some various results.








Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.