mirror of https://github.com/golang/go.git
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:
parent
5958fd7f89
commit
84f67eb8e6
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue