cmd/cgo: record CGO_LDFLAGS env var in _cgo_flags
cmd/cgo: record CGO_LDFLAGS env var in _cgo_flags

cgo stores cgo LDFLAGS in _cgo_flags and _cgo_defun.c.
The _cgo_defun.c records the flags via
"#pragma cgo_ldflag <flag>", which external linking
relies upon for passing libraries (and search paths)
to the host linker.

The go command will allow LDFLAGS for cgo to be passed
through the environment (CGO_LDFLAGS); cgo ignores
this environment variable, and so its value doesn't
make it into the above mentioned files. This CL changes
cgo to record CGO_LDFLAGS also.

Fixes issue 5205.

R=iant, minux.ma
CC=golang-dev
https://codereview.appspot.com/8465043

Committer: Shenghou Ma <b563c57947dc20eb81988e3e3c22786764c14ca8@gmail.com>

scirelli/scirelli-go,glycerine/jeaten-go-arrayof-structof,rdp/rogerpack2005-golang,rdp/rogerpack2005-golang,mhennings/marcohennings-go,d0f/go-zh,scirelli/scirelli-go,bryanxu/go-zh,bryanxu/go-zh,mhennings/marcohennings-go,webfd/go-zh,scirelli/scirelli-go,d0f/go-zh,webfd/go-zh,sanjosh/sanjos100-tipc,bryanxu/go-zh,glycerine/jeaten-go-arrayof-structof,webfd/go-zh,glycerine/jeaten-go-arrayof-structof,glycerine/jeaten-go-arrayof-structof,d0f/go-zh,d0f/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,webfd/go-zh,mhennings/marcohennings-go,webfd/go-zh,scirelli/scirelli-go,rdp/rogerpack2005-golang,mhennings/marcohennings-go,mhennings/marcohennings-go,rdp/rogerpack2005-golang,glycerine/jeaten-go-arrayof-structof,sanjosh/sanjos100-tipc,rdp/rogerpack2005-golang,sanjosh/sanjos100-tipc,webfd/go-zh,glycerine/jeaten-go-arrayof-structof,sanjosh/sanjos100-tipc,sanjosh/sanjos100-tipc,d0f/go-zh,rdp/rogerpack2005-golang,d0f/go-zh,glycerine/jeaten-go-arrayof-structof,bryanxu/go-zh,mhennings/marcohennings-go,bryanxu/go-zh,mhennings/marcohennings-go,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,scirelli/scirelli-go,scirelli/scirelli-go,sanjosh/sanjos100-tipc,rdp/rogerpack2005-golang,webfd/go-zh,bryanxu/go-zh,sanjosh/sanjos100-tipc,rdp/rogerpack2005-golang,d0f/go-zh,scirelli/scirelli-go,d0f/go-zh,bryanxu/go-zh,mhennings/marcohennings-go,webfd/go-zh