# Go: Targeting a different architecture #golang

DevFeed: [Go: Targeting a different architecture #golang](<https://devfeed.tech/articles/go-targeting-a-different-architecture-golang-35406.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/go-targeting-a-different-architecture/>)

Author: Graham King

Published: 2012-06-14T00:08:58Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Cross-Compilation](<https://devfeed.tech/topics/cross-compilation.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [cross-compilation](<https://devfeed.tech/tags/cross-compilation.md>), [go](<https://devfeed.tech/tags/go.md>), [software](<https://devfeed.tech/tags/software.md>)

## AI overview

A short guide to building Go programs for a different architecture, such as building for amd64 from an i386 machine. It covers obtaining or building the compiler for the target architecture and setting the architecture before compiling the program.

## Source excerpt

Problem: You're on a i386 machine, and you need to build for amd64, or vice-versa. Solution: Get the for the other architecture. Get both, one of which you'll already have: Build the Go compiler for the other architecture: Set the architecture before building your program: The first two steps you only need to do once. Thank you zephyrtronium in freenode#go-nuts for the help. For other architectures, see Dave Cheney's An introduction to cross compilation with Go