summaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-12-17 09:51:55 -0800
committerRuss Cox <rsc@golang.org>2010-12-17 09:51:55 -0800
commit3357866fb9e2965a11c453dbd21013df0a1c893f (patch)
treed9654101bcb93f01411fbb571cdaa4f6b3e7f191 /src/pkg/runtime
parentdd717d23cdc29352ad5042f8f7090978b7df0d1a (diff)
downloadgo-3357866fb9e2965a11c453dbd21013df0a1c893f.tar.gz
misc/cgo/life: fix, add to build
#pragma dynexport is no longer needed for this use of cgo, since the gcc and gc code are now linked together into the same binary. It may still be necessary later. On the Mac, you cannot use the GOT to resolve symbols that exist in the current binary, so 6l and 8l translate the GOT-loading mov instructions into lea instructions. On ELF systems, we could use the GOT for those symbols, but for consistency 6l and 8l apply the same translation. The translation is sketchy in the extreme (depending on the relocation being in a mov instruction) but it verifies that the instruction is a mov before rewriting it to lea. Also makes typedefs global across files. Fixes issue 1335. Fixes issue 1345. R=iant, r CC=golang-dev http://codereview.appspot.com/3650042
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/cgo/Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/pkg/runtime/cgo/Makefile b/src/pkg/runtime/cgo/Makefile
index 917166e06..b825c1780 100644
--- a/src/pkg/runtime/cgo/Makefile
+++ b/src/pkg/runtime/cgo/Makefile
@@ -19,7 +19,7 @@ ifeq ($(ENABLED),1)
# Unwarranted chumminess with Make.pkg's cgo rules.
# Do not try this at home.
-GCC_OFILES=\
+CGO_OFILES=\
$(GOARCH).o\
$(GOOS)_$(GOARCH).o\
util.o\
@@ -27,7 +27,7 @@ GCC_OFILES=\
OFILES=\
iscgo.$O\
_cgo_import.$O\
- $(GCC_OFILES)\
+ $(CGO_OFILES)\
CGO_LDFLAGS=-lpthread
@@ -41,6 +41,11 @@ endif
include ../../../Make.pkg
+ifeq ($(ENABLED),1)
+_cgo_defun.c:
+ echo >$@
+endif
+
$(GOARCH).o: $(GOARCH).S
$(HOST_CC) $(_CGO_CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $^