]> Cypherpunks repositories - gostls13.git/commit
cmd/link: use only the configured C compiler in TestCGOLTO
authorBryan C. Mills <bcmills@google.com>
Thu, 9 Mar 2023 21:17:30 +0000 (16:17 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 9 Mar 2023 22:13:02 +0000 (22:13 +0000)
commitc9389a5849d65b74287cd2746a94748d6d64cb44
tree0311771b7b75edb53f5f5a07a7189a10ddea5385
parent7dbd6de7d45da622e532e149de616e159286e1d4
cmd/link: use only the configured C compiler in TestCGOLTO

The test had been assuming that any 'gcc' or 'clang' command found in
$PATH could be used to compile cgo dependencies for the target GOARCH
and GOOS. That assumption does not hold in general: for example,
the GOARCH/GOOS configuration may be cross-compiling, which will cause
the test to fail if the native 'gcc' and/or 'clang' is not configured
for the target architecture.

Instead, leave the 'CC' variable unset and assume only that the user
has configured it appropriate to the environment in which they are
running the test.

For #58829.

Change-Id: I9a1269ae3e0b4af281702114dabba844953f74bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/475155
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/link/cgo_test.go