Can't build my program using gccgo on Mac OS X 10.9 Mavericks

1,113 views
Skip to first unread message

michal

unread,
Aug 23, 2014, 6:54:29 PM8/23/14
to golan...@googlegroups.com
Hi guys,

I installed gcc 4.9 with gccgo using brew on my Mac, but I can't compile any go source code using it, because the compiler can't find the standard packages:

parser.go:4:10: error: import file 'os' not found

 import "os

 

I tried building the file using these commands (the effect was the same):


gccgo -c parser.go


and


go build -x -compiler gccgo -o parser_gccgo parser.go


WORK=/var/folders/ct/kyccx04s641gsvy_7ff5qx300000gn/T/go-build492002372

mkdir -p $WORK/command-line-arguments/_obj/

cd /Users/tom/Projects/go

gccgo -I $WORK -c -g -m64 -fgo-relative-import-path=_/Users/tom/Projects/go -o $WORK/command-line-arguments/_obj/main.o ./parser.go


The same file builds fine using the standard go compiler.


My 'go env':


GOARCH="amd64"

GOBIN=""

GOCHAR="6"

GOEXE=""

GOHOSTARCH="amd64"

GOHOSTOS="darwin"

GOOS="darwin"

GOPATH="/Users/tom/Projects/go"

GORACE=""

GOROOT="/usr/local/go"

GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"

CC="clang"

GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"

CXX="clang++"

CGO_ENABLED="1" 


I also tried creating the same variables as my system env variables (using export), but it didn't help. 


Can you guys help me to resolve this problem? 



Ian Lance Taylor

unread,
Aug 24, 2014, 9:34:04 PM8/24/14
to michal, golang-nuts
On Sat, Aug 23, 2014 at 3:54 PM, michal <fron...@gmail.com> wrote:
>
> I installed gcc 4.9 with gccgo using brew on my Mac, but I can't compile any
> go source code using it, because the compiler can't find the standard
> packages:

Unfortunately gccgo does not work on Darwin
(http://gcc.gnu.org/PR46986). Sorry.

Ian

Rodrick Brown

unread,
Aug 24, 2014, 10:03:49 PM8/24/14
to michal, golan...@googlegroups.com
$ brew install go 

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages