]> Cypherpunks repositories - gostls13.git/commitdiff
Build libcgo.so with $(CC), not the gcc on PATH.
authorIan Lance Taylor <iant@golang.org>
Thu, 15 Jul 2010 21:15:39 +0000 (14:15 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 15 Jul 2010 21:15:39 +0000 (14:15 -0700)
Change make.bash to make sure that $(CC) is defined to match
the compiler used to build the tools.

R=rsc
CC=golang-dev
https://golang.org/cl/1853041

src/libcgo/Makefile
src/make.bash

index 0d65af70c7d078644fe9a97a68f2c5e22aca0bc3..13374719dbff1a4faa377e4ffcdc35bfe753e9cc 100755 (executable)
@@ -26,13 +26,13 @@ LDFLAGS_freebsd=-pthread -shared -lm
 LDFLAGS_windows=-shared -lm -mthreads
 
 %.o: %.c
-       gcc $(CFLAGS_$(GOARCH)) -O2 -fPIC -o $@ -c $*.c
+       $(CC) $(CFLAGS_$(GOARCH)) -O2 -fPIC -o $@ -c $*.c
 
 %.o: %.S
-       gcc $(CFLAGS_$(GOARCH)) -O2 -fPIC -o $@ -c $*.S
+       $(CC) $(CFLAGS_$(GOARCH)) -O2 -fPIC -o $@ -c $*.S
 
 libcgo.so: $(OFILES)
-       gcc $(CFLAGS_$(GOARCH)) -o libcgo.so $(OFILES) $(LDFLAGS_$(GOOS))
+       $(CC) $(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)
index b718bb9562fc1d6edf98e5fb7cf4e7cc264c5dad..b95635b5655c0ff8817032e92c5e6029ccd7d436 100755 (executable)
@@ -12,6 +12,7 @@ unset CDPATH  # in case user has it set
 
 rm -f "$GOBIN"/quietgcc
 CC=${CC:-gcc}
+export CC
 sed -e "s|@CC@|$CC|" < "$GOROOT"/src/quietgcc.bash > "$GOBIN"/quietgcc
 chmod +x "$GOBIN"/quietgcc