aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-12-17 13:22:20 -0800
committerRuss Cox <rsc@golang.org>2010-12-17 13:22:20 -0800
commit38323890360fdcf361a2af774a99e10ac9371758 (patch)
treeb9810189f1ee4d5508b5adde01a23a669fa049c7
parent6c6d53052e277bcc8f65d69a945198ba46499559 (diff)
downloadgo-38323890360fdcf361a2af774a99e10ac9371758.tar.gz
go-38323890360fdcf361a2af774a99e10ac9371758.zip
fix cgo build
R=r CC=golang-dev https://golang.org/cl/3750041
-rw-r--r--src/Make.pkg2
-rw-r--r--src/pkg/runtime/cgo/Makefile4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/Make.pkg b/src/Make.pkg
index e4cdaae30b..a748ff346d 100644
--- a/src/Make.pkg
+++ b/src/Make.pkg
@@ -114,7 +114,6 @@ dir:
ifdef CGOFILES
_cgo_defun.c: $(CGOFILES)
CGOPKGPATH=$(dir) cgo -- $(CGO_CFLAGS) $(CGOFILES)
-endif
# Ugly but necessary - cgo writes these files too.
_cgo_gotypes.go _cgo_export.c _cgo_export.h _cgo_main.c: _cgo_defun.c
@@ -122,6 +121,7 @@ _cgo_gotypes.go _cgo_export.c _cgo_export.h _cgo_main.c: _cgo_defun.c
%.cgo1.go %.cgo2.c: _cgo_defun.c
@true
+endif
# Compile rules for gcc source files.
%.o: %.c
diff --git a/src/pkg/runtime/cgo/Makefile b/src/pkg/runtime/cgo/Makefile
index b825c17805..3e6ca84a2c 100644
--- a/src/pkg/runtime/cgo/Makefile
+++ b/src/pkg/runtime/cgo/Makefile
@@ -44,6 +44,10 @@ include ../../../Make.pkg
ifeq ($(ENABLED),1)
_cgo_defun.c:
echo >$@
+
+_cgo_main.c:
+ echo 'int main() { return 0; }' >$@
+ echo 'void *crosscall2;' >>$@
endif
$(GOARCH).o: $(GOARCH).S