Commit 5008927c authored by Russ Cox's avatar Russ Cox

libcgo: update Makefile to use Make.inc

Fix printf format string.

R=r
CC=golang-dev
https://golang.org/cl/1959044
parent e6308654
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
# Use of this source code is governed by a BSD-style # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file. # license that can be found in the LICENSE file.
# ugly hack to deal with whitespaces in $GOROOT include ../Make.inc
nullstring :=
space := $(nullstring) # a space at the end
QUOTED_GOROOT=$(subst $(space),\ ,$(GOROOT))
all: libcgo.so all: libcgo.so
...@@ -16,9 +13,8 @@ OFILES=\ ...@@ -16,9 +13,8 @@ OFILES=\
$(GOARCH).o\ $(GOARCH).o\
util.o\ util.o\
CFLAGS_386=-m32 HOST_CFLAGS_386=-m32
CFLAGS_amd64=-m64 HOST_CFLAGS_amd64=-m64
LDFLAGS_linux=-shared -lpthread -lm LDFLAGS_linux=-shared -lpthread -lm
LDFLAGS_darwin=-dynamiclib -Wl,-undefined,dynamic_lookup /usr/lib/libpthread.dylib LDFLAGS_darwin=-dynamiclib -Wl,-undefined,dynamic_lookup /usr/lib/libpthread.dylib
...@@ -26,13 +22,13 @@ LDFLAGS_freebsd=-pthread -shared -lm ...@@ -26,13 +22,13 @@ LDFLAGS_freebsd=-pthread -shared -lm
LDFLAGS_windows=-shared -lm -mthreads LDFLAGS_windows=-shared -lm -mthreads
%.o: %.c %.o: %.c
$(CC) $(CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $*.c $(HOST_CC) $(HOST_CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $*.c
%.o: %.S %.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) 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 $(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)/libcgo.so: libcgo.so
cp libcgo.so $(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH) cp libcgo.so $(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)
......
...@@ -56,7 +56,7 @@ inittls(void) ...@@ -56,7 +56,7 @@ inittls(void)
fprintf(stderr, "\twanted 0x108 and 0x109\n"); fprintf(stderr, "\twanted 0x108 and 0x109\n");
fprintf(stderr, "\tgot"); fprintf(stderr, "\tgot");
for(i=0; i<ntofree; i++) for(i=0; i<ntofree; i++)
fprintf(stderr, " %#x", tofree[i]); fprintf(stderr, " %#x", (unsigned)tofree[i]);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
abort(); abort();
} }
...@@ -78,7 +78,7 @@ inittls(void) ...@@ -78,7 +78,7 @@ inittls(void)
asm volatile("movq %%gs:0x8a8, %0" : "=r"(y)); asm volatile("movq %%gs:0x8a8, %0" : "=r"(y));
if(x != 0x123456789abcdef0ULL || y != 0x0fedcba987654321) { if(x != 0x123456789abcdef0ULL || y != 0x0fedcba987654321) {
printf("libcgo: thread-local storage %#x not at %%gs:0x8a0 - x=%#llx y=%#llx\n", k1, x, y); printf("libcgo: thread-local storage %#x not at %%gs:0x8a0 - x=%#llx y=%#llx\n", (unsigned)k1, x, y);
abort(); abort();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment