From dab7163feedc99bd94549ee490031f86f8d0a6ca Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 6 Sep 2023 11:21:11 -0700 Subject: cmd/go: permit $AR to include options Handle the AR environment variable, used by gccgo, the same way we handle the CC environment variable. This ports https://go.dev/cl/526275 to the gofrontend repo. This is needed for gccgo testing because the top-level GCC Makefile now passes a --plugin option to ar if it supports one. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/526295 --- libgo/go/cmd/go/internal/work/gccgo.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'libgo/go') diff --git a/libgo/go/cmd/go/internal/work/gccgo.go b/libgo/go/cmd/go/internal/work/gccgo.go index c1026c7..3e07f87 100644 --- a/libgo/go/cmd/go/internal/work/gccgo.go +++ b/libgo/go/cmd/go/internal/work/gccgo.go @@ -45,12 +45,8 @@ func (gccgoToolchain) linker() string { return GccgoBin } -func (gccgoToolchain) ar() string { - ar := cfg.Getenv("AR") - if ar == "" { - ar = "ar" - } - return ar +func (gccgoToolchain) ar() []string { + return envList("AR", "ar") } func checkGccgoBin() { -- cgit v1.1