Build libcgo.so with $(CC), not the gcc on PATH.

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
This commit is contained in:
Ian Lance Taylor 2010-07-15 14:15:39 -07:00
parent 5958fd7f89
commit 84f67eb8e6
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -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