go: Use build CC when build cpu == target cpu

go compiler needs to run on the host machine. But go
build system does not differentiate between target tuples
e.g. x86_64-pc-linux-gnu and x86_64-cros-linux-gnu.

Since go binary needs to run on the host, it needs to be
built with BUILD CC, not TARGET CC. This fixes a build error
in glibc upgrade.

Go standard library will continue to be built with TARGET CC.


Change-Id: If8d1589ed91df67972477b02c53aa1070d178c73
Reviewed-on: https://cos-review.googlesource.com/c/third_party/overlays/chromiumos-overlay/+/17051
Reviewed-by: Roy Yang <royyang@google.com>
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
2 files changed