从源代码构建go编译器时出错

I am trying to build the latest version (tip of the master branch) of Go from source.

The official Go documentation (https://golang.org/doc/install/source) states that you should download Go 1.4 binaries to build a more recent version. However it should be possible to build all from source.

To do this, I set variables in .bashrc :

PATH="$HOME/go/bin:$PATH"
export GOPATH=$HOME

then to build go 1.4 from source :

source ~/.bashrc
git clone https://go.googlesource.com/go
mkdir ~/go1.4
cd ~/go
git archive --format=tar go1.4.3 |tar -xv -C ~/go1.4
cd ~/go1.4/src
./make.bash

and finally build the latest version :

cd ~/go/src/
GOROOT_BOOTSTRAP=$HOME/go1.4 ./make.bash

I remember doing this months ago without problems, but today I get these errors building go 1.4 make.bash:

# cmd/pprof
.../go1.4/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
.../go1.4/pkg/linux_amd64/runtime/cgo.a(_all.o): unknown relocation type 42; compiled without -fpic?
runtime/cgo(.text): unexpected relocation type 298
runtime/cgo(.text): unexpected relocation type 298
...

Is there something wrong in my method ?

The error messages point to CGO, and environment variables that control make.bash are explained at the beginning of the file :

CGO_ENABLED: Controls cgo usage during the build. Set it to 1 to include all cgo related files, .c and .go file with "cgo" build directive, in the build. Set it to 0 to ignore them.

so if you disable CGO while building GO 1.4 :

cd ~/go1.4/src
CGO_ENABLED=0 ./make.bash

everything works and pass the tests.