From 5008927c5c1ad78808697967d1ee834ae653b76c Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 25 Aug 2010 17:53:24 -0400 Subject: [PATCH] libcgo: update Makefile to use Make.inc Fix printf format string. R=r CC=golang-dev https://golang.org/cl/1959044 --- src/libcgo/Makefile | 16 ++++++---------- src/libcgo/darwin_amd64.c | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/libcgo/Makefile b/src/libcgo/Makefile index ff928f14cd..380bc596e9 100755 --- a/src/libcgo/Makefile +++ b/src/libcgo/Makefile @@ -2,10 +2,7 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -# ugly hack to deal with whitespaces in $GOROOT -nullstring := -space := $(nullstring) # a space at the end -QUOTED_GOROOT=$(subst $(space),\ ,$(GOROOT)) +include ../Make.inc all: libcgo.so @@ -16,9 +13,8 @@ OFILES=\ $(GOARCH).o\ util.o\ -CFLAGS_386=-m32 -CFLAGS_amd64=-m64 - +HOST_CFLAGS_386=-m32 +HOST_CFLAGS_amd64=-m64 LDFLAGS_linux=-shared -lpthread -lm LDFLAGS_darwin=-dynamiclib -Wl,-undefined,dynamic_lookup /usr/lib/libpthread.dylib @@ -26,13 +22,13 @@ LDFLAGS_freebsd=-pthread -shared -lm LDFLAGS_windows=-shared -lm -mthreads %.o: %.c - $(CC) $(CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $*.c + $(HOST_CC) $(HOST_CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $*.c %.o: %.S - $(CC) $(CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $*.S + $(HOST_CC) $(HOST_CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $*.S libcgo.so: $(OFILES) - $(CC) $(CFLAGS_$(GOARCH)) -o libcgo.so $(OFILES) $(LDFLAGS_$(GOOS)) + $(HOST_CC) $(HOST_CFLAGS_$(GOARCH)) -o libcgo.so $(OFILES) $(LDFLAGS_$(GOOS)) $(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)/libcgo.so: libcgo.so cp libcgo.so $(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH) diff --git a/src/libcgo/darwin_amd64.c b/src/libcgo/darwin_amd64.c index 9d7255fbd5..59fff059ae 100644 --- a/src/libcgo/darwin_amd64.c +++ b/src/libcgo/darwin_amd64.c @@ -56,7 +56,7 @@ inittls(void) fprintf(stderr, "\twanted 0x108 and 0x109\n"); fprintf(stderr, "\tgot"); for(i=0; i