Skip to content

Commit ca9d3f3

Browse files
committed
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
1 parent 6e6fc67 commit ca9d3f3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/Make.inc

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
# license that can be found in the LICENSE file.
44

55
# Makefile included by all other Go makefiles.
6-
# The build converts Make.inc.in to Make.inc.
7-
# Only make changes in Make.inc.in.
6+
7+
# Clear variables that must come from Makefiles,
8+
# not the environment.
9+
LIB:=
10+
TARG:=
11+
GOFILES:=
12+
HFILES:=
13+
OFILES:=
14+
YFILES:=
815

916
# GOROOT must be set.
1017
ifeq ($(GOROOT),)
@@ -44,7 +51,13 @@ O:=8
4451
else ifeq ($(GOARCH),amd64)
4552
O:=6
4653
else ifeq ($(GOARCH),arm)
54+
4755
O:=5
56+
ifeq ($(GOOS),linux)
57+
else
58+
$(error Invalid $$GOOS '$(GOOS)' for GOARCH=arm; must be linux)
59+
endif
60+
4861
else
4962
$(error Invalid $$GOARCH '$(GOARCH)'; must be 386, amd64, or arm)
5063
endif

0 commit comments

Comments
 (0)