Commit ca9d3f34 authored by Russ Cox's avatar Russ Cox

build: avoid bad environment interactions

Specifically, $LIB is set on Windows.

Also diagnose attempt to build GOOS=darwin GOARCH=arm.
Otherwise the build fails mysteriously in package runtime.

Fixes #1065.

R=r
CC=golang-dev
https://golang.org/cl/2162043
parent 6e6fc674
...@@ -3,8 +3,15 @@ ...@@ -3,8 +3,15 @@
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
# Makefile included by all other Go makefiles. # Makefile included by all other Go makefiles.
# The build converts Make.inc.in to Make.inc.
# Only make changes in Make.inc.in. # Clear variables that must come from Makefiles,
# not the environment.
LIB:=
TARG:=
GOFILES:=
HFILES:=
OFILES:=
YFILES:=
# GOROOT must be set. # GOROOT must be set.
ifeq ($(GOROOT),) ifeq ($(GOROOT),)
...@@ -44,7 +51,13 @@ O:=8 ...@@ -44,7 +51,13 @@ O:=8
else ifeq ($(GOARCH),amd64) else ifeq ($(GOARCH),amd64)
O:=6 O:=6
else ifeq ($(GOARCH),arm) else ifeq ($(GOARCH),arm)
O:=5 O:=5
ifeq ($(GOOS),linux)
else
$(error Invalid $$GOOS '$(GOOS)' for GOARCH=arm; must be linux)
endif
else else
$(error Invalid $$GOARCH '$(GOARCH)'; must be 386, amd64, or arm) $(error Invalid $$GOARCH '$(GOARCH)'; must be 386, amd64, or arm)
endif endif
......
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