Jelajahi Sumber

unix: require GOOS be set in mksyscall

If you don't set GOOS and you try to regenerate
the darwin files, it appears to succeed.
However, because libc was not selected,
it generates broken code.

Change-Id: I20fb4f51dcc539a03b6c6ed03ce39b78d5987d41
Reviewed-on: https://go-review.googlesource.com/c/161719
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Josh Bleecher Snyder 6 tahun lalu
induk
melakukan
446ad8e35c
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      unix/mksyscall.go

+ 4 - 0
unix/mksyscall.go

@@ -88,6 +88,10 @@ func parseParam(p string) Param {
 func main() {
 	// Get the OS and architecture (using GOARCH_TARGET if it exists)
 	goos := os.Getenv("GOOS")
+	if goos == "" {
+		fmt.Fprintln(os.Stderr, "GOOS not defined in environment")
+		os.Exit(1)
+	}
 	goarch := os.Getenv("GOARCH_TARGET")
 	if goarch == "" {
 		goarch = os.Getenv("GOARCH")