]> Cypherpunks repositories - gostls13.git/commitdiff
fix cgo build
authorRuss Cox <rsc@golang.org>
Fri, 17 Dec 2010 21:22:20 +0000 (13:22 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 17 Dec 2010 21:22:20 +0000 (13:22 -0800)
R=r
CC=golang-dev
https://golang.org/cl/3750041

src/Make.pkg
src/pkg/runtime/cgo/Makefile

index e4cdaae30b75da9227707100dc077189a907f517..a748ff346db0bbf7e087290b105c11ad051a31d6 100644 (file)
@@ -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
index b825c17805b7ab0eb266376af3a151486e2dbc20..3e6ca84a2c0d1855ba421df5c17c3eeaec659891 100644 (file)
@@ -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