diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2016-04-06 18:54:17 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2016-04-07 02:46:53 +0000 |
| commit | d481ffc1afeae8852caa3452a0e23b1cd90d1e10 (patch) | |
| tree | cc4a9b8b127cd9f4d7090815bc47990621738491 /src | |
| parent | c6e11fe03765e3fe1fc68bd794625ca0ecd833be (diff) | |
| download | go-d481ffc1afeae8852caa3452a0e23b1cd90d1e10.tar.xz | |
cmd/compile, cmd/link: eliminate uses of ArchFamily in error messages
Two of these error messages are already dead code: cmd/compile.main
and cmd/link.main already switch on $GOARCH, ensuring it must be a
prefix of the sys.Arch.Family.
The error message about uncompiled Go source files can be just be
simplified: anyone who's manually constructing Go object file archives
probably knows what tool to use to compile Go source files.
Change-Id: Ia4a67c0a1d1158379c127c91e909226d3367f3c2
Reviewed-on: https://go-review.googlesource.com/21626
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/gc/main.go | 9 | ||||
| -rw-r--r-- | src/cmd/link/internal/ld/lib.go | 7 |
2 files changed, 3 insertions, 13 deletions
diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 72e6478afe..079f4916c7 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -93,14 +93,7 @@ func doversion() { func Main() { defer hidePanic() - // Allow GOARCH=thearch.thestring or GOARCH=thearch.thestringsuffix, - // but not other values. - p := obj.Getgoarch() - - if !strings.HasPrefix(p, Thearch.LinkArch.Name) { - log.Fatalf("cannot use %cg with GOARCH=%s", Thearch.LinkArch.Family, p) - } - goarch = p + goarch = obj.Getgoarch() Ctxt = obj.Linknew(Thearch.LinkArch) Ctxt.DiagFunc = Yyerror diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 3e0bd8ebc4..305a3bc0db 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1301,7 +1301,8 @@ func ldobj(f *obj.Biobuf, pkg string, length int64, pn string, file string, when if !strings.HasPrefix(line, "go object ") { if strings.HasSuffix(pn, ".go") { - Exitf("%cl: input %s is not .%c file (use %cg to compile .go files)", SysArch.Family, pn, SysArch.Family, SysArch.Family) + Exitf("%s: uncompiled .go source file", pn) + return nil } if line == SysArch.Name { @@ -1559,10 +1560,6 @@ func mywhatsys() { goroot = obj.Getgoroot() goos = obj.Getgoos() goarch = obj.Getgoarch() - - if !strings.HasPrefix(goarch, SysArch.Name) { - log.Fatalf("cannot use %cc with GOARCH=%s", SysArch.Family, goarch) - } } // Copied from ../gc/subr.c:/^pathtoprefix; must stay in sync. |
