Skip to content

gccgo: Trouble cross-compiling to GOARCH=mips using gccgo #18942

@elimisteve

Description

@elimisteve

What version of Go are you using (go version)?

go version go1.8rc3 linux/amd64

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

I tried cross-compiling a trivial "hello world" Go program -- namely https://github.com/elimisteve/hello/blob/master/hello.go -- with this command:

$ GOOS=linux GOARCH=mips go1.8rc3 build -x -compiler=gccgo .

What did you expect to see?

No output and a successfully-compiled 32-bit MIPS binary in my local directory.

What did you see instead?

$ GOOS=linux GOARCH=mips go1.8rc3 build -x -compiler=gccgo .
WORK=/tmp/go-build262885004
mkdir -p $WORK/github.com/elimisteve/hello/_obj/
mkdir -p $WORK/github.com/elimisteve/hello/_obj/exe/
cd /home/ubuntu/go/src/github.com/elimisteve/hello
/usr/bin/gccgo -I $WORK -c -g -mabi=32 -march=mips32 -fgo-relative-import-path=_/home/ubuntu/go/src/github.com/elimisteve/hello -o $WORK/github.com/elimisteve/hello/_obj/_go_.o ./hello.go
# github.com/elimisteve/hello
gccgo: error: unrecognized argument in option ‘-mabi=32’
gccgo: note: valid arguments to ‘-mabi=’ are: ms sysv

This is using gccgo 6, which installed 'libgo9as a dependency when I ranapt-get install gccgo`.

At https://tip.golang.org/doc/install/gccgo it says,

The GCC 6 releases include a complete implementation of the Go 1.6.1 user libraries. The Go 1.6 runtime is not fully merged, but that should not be visible to Go programs.

so I believe this is supposed to work? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions