Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccgo: "unsupported GOOS/GOARCH pair" using gccgo - regression #24398

Open
aykevl opened this issue Mar 15, 2018 · 9 comments

Comments

@aykevl
Copy link

commented Mar 15, 2018

It looks like issue #12272 is back in go 1.10, while it was still gone in go 1.9.4. It emits this error "unsupported GOOS/GOARCH pair" even when using -compiler=gccgo. As per #12272 (comment), I think it should be fixed again.

Go version: go1.10 linux/amd64

Note: I'm trying to write a cross-compiler wrapper to the ESP32 (see here), which compiles with GOOS=esp32 and GOARCH=xtensa (I had to choose something for those values).

@gopherbot gopherbot added this to the Gccgo milestone Mar 15, 2018

@andybons andybons changed the title "unsupported GOOS/GOARCH pair" using gccgo - regression gccgo: "unsupported GOOS/GOARCH pair" using gccgo - regression Mar 15, 2018

@andybons

This comment has been minimized.

Copy link
Member

commented Mar 15, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2018

I can't recreate this. Please show us the exact command that you are running and the exact output that you see. Thanks.

@aykevl

This comment has been minimized.

Copy link
Author

commented Apr 10, 2018

Here is a way to reproduce:

$ GOOS=linux GOARCH=xtensa go build -compiler=gccgo gohello
cmd/go: unsupported GOOS/GOARCH pair linux/xtensa

Note that it also fails when not doing any building, as with the following command:

$ GOOS=linux GOARCH=xtensa go version
cmd/go: unsupported GOOS/GOARCH pair linux/xtensa

Background: I was trying to build a wrapper around the go command to build very simple Go programs for the ESP32. This worked, somewhat: I got a blinking light and working goroutines/channels, but I dropped the project. I had to switch to go <1.10 for building it.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Apr 10, 2018

OK, I can recreate this if I use the gc version of the go tool, but not if I use the gccgo version of the go tool. Is that what you are doing?

@aykevl

This comment has been minimized.

Copy link
Author

commented Apr 10, 2018

I'm not entirely sure what you mean? Are there two different versions of the go command?
I downloaded the go toolchain from https://golang.org/dl and executed the command as in the previous comment.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Apr 10, 2018

Yes, there are two slightly different versions of the go command. If you install gccgo, you will get a gccgo-specific version of the command, which will default to -compiler=gccgo. If you do not install gccgo, you won't be able to use gccgo anyhow. Simply downloading the gc toolchain from golang.org/dl will not make -compiler=gccgo work; you must also install gccgo.

@aykevl

This comment has been minimized.

Copy link
Author

commented Apr 10, 2018

Actually, I have gccgo installed, from the Debian archive (Debian stretch). So that shouldn't be the problem.

Note that I have used go build -compiler=gccgo, with a version downloaded from golang.org, it's just that the latest version stopped working. As far as I can see, everything is equal in my configuration except for the go tool version.

~$ which go
/usr/local/go/bin/go

~$ /usr/local/go/bin/go version
go version go1.10 linux/amd64

~$ /usr/local/go1.8/bin/go version
go version go1.8.3 linux/amd64

~$ GOOS=linux GOARCH=xtensa /usr/local/go/bin/go build -compiler=gccgo foobar
cmd/go: unsupported GOOS/GOARCH pair linux/xtensa

~$ GOOS=linux GOARCH=xtensa /usr/local/go1.8/bin/go build -compiler=gccgo foobar
can't load package: package foobar: cannot find package "foobar" in any of:
	/usr/local/go/src/foobar (from $GOROOT)
	/home/ayke/src/foobar (from $GOPATH)
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Apr 11, 2018

If you have installed gccgo, then in the same directory as the gccgo executable there is a go executable. Run that instead of /usr/local/go/bin/go.

I'm not saying that there isn't a bug here. There is a bug. I'm just giving you a workaround.

@aykevl

This comment has been minimized.

Copy link
Author

commented Apr 11, 2018

Ah, I didn't know about that! Thanks for the hint.
On my Debian installation it seems to be called x86_64-linux-gnu-go-6.

$ GOOS=linux GOARCH=xtensa x86_64-linux-gnu-go-6 version
go version go1.6.1 gccgo (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 linux/amd64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.