Commit 443a32e7 authored by Dave Cheney's avatar Dave Cheney

cmd/8g: don't call gc.Fatal during initalisation

Fixes #10592

Calling gc.Fatal before gc.Main has been called ends up flushing gc.bstdout before
it is properly set up. Ideally obj.Bflush would handle this case, but that type
and its callers are rather convoluted, so take the simpler route and avoid calling
gc.Fatal altogether.

Change-Id: I338b469e86edba558b6bedff35bb904bfc3d6990
Reviewed-on: https://go-review.googlesource.com/9525Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarDave Cheney <dave@cheney.net>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 04220014
......@@ -8,6 +8,8 @@ import (
"cmd/internal/gc"
"cmd/internal/obj"
"cmd/internal/obj/x86"
"fmt"
"os"
)
var thechar int = '8'
......@@ -58,7 +60,8 @@ func main() {
gc.Thearch.FREGMIN = x86.REG_X0
gc.Thearch.FREGMAX = x86.REG_X7
default:
gc.Fatal("unsupported setting GO386=%s", v)
fmt.Fprintf(os.Stderr, "unsupported setting GO386=%s\n", v)
os.Exit(1)
}
gc.Thearch.MAXWIDTH = MAXWIDTH
gc.Thearch.ReservedRegs = resvd
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment