From: Russ Cox Date: Fri, 17 Dec 2010 21:22:20 +0000 (-0800) Subject: fix cgo build X-Git-Tag: weekly.2010-12-22~10 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=38323890360fdcf361a2af774a99e10ac9371758;p=gostls13.git fix cgo build R=r CC=golang-dev https://golang.org/cl/3750041 --- 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