Skip to content

gccgo: GOARCH is not validated #23566

Open
@gm42

Description

@gm42

Please answer these questions before submitting your issue. Thanks!

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

go version go1.9 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

$ GOARCH=386 go build -v -compiler gccgo ./mypkg/
go build: when using gccgo toolchain, please pass compiler flags using -gccgoflags, not -gcflags
mypkg
# mypkg
version.go:7:9: error: import file ‘strconv’ not found
  "strconv"
$ GOARCH=xxx go build -v -compiler gccgo ./mypkg/
go build: when using gccgo toolchain, please pass compiler flags using -gccgoflags, not -gcflags
mypkg
$ echo $?
0

What did you expect to see?

Failure when the provided GOARCH is invalid.

What did you see instead?

It builds for the default GOARCH.

If a valid architecture is provided it tries to build that one, failing if the standard library is not built for it. If a bogus one is provided, no errors are returned and the default one is picked instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions