user2475269
user2475269

Reputation:

Mac cross compiling (or alternatives) with golang

Ok so I'm trying to compile my Awesomium go wrapper on my mac (everything works fine on linux). My problem is, when I try to compile I get

ld: warning: ignoring file /Library/Frameworks//Awesomium.framework/Awesomium, file was built for i386 which is not the architecture being linked (x86_64): /Library/Frameworks//Awesomium.framework/Awesomium Undefined symbols for architecture x86_64:

Fine. But that raises a few questions. First, I didn't have the option to download a x86_64 version for Mac, it was "the mac version" no architecture. Second, I checked a few other libraries and it seems like nothing is built x86_64.
Now I thought maybe I could make a i386 version just for osx but it seems it's extremely difficult, some say impossible, to cross compile cgo.

What are my options?

Upvotes: 0

Views: 917

Answers (1)

Mr_Pink
Mr_Pink

Reputation: 109454

I'm not sure if you're going to run into any other problems with the universal binary, but building an i386 go toolchain is fairly easy.

http://golang.org/doc/install/source

You can then set the GOHOSTARCH and GOARCH environment variables, e.g.

GOHOSTARCH=386 GOARCH=386 ./all.bash

Upvotes: 1

Related Questions