[gcc r14-3760] cmd/go: permit $AR to include options

Ian Lance Taylor ian@gcc.gnu.org
Wed Sep 6 18:38:01 GMT 2023


https://gcc.gnu.org/g:dab7163feedc99bd94549ee490031f86f8d0a6ca

commit r14-3760-gdab7163feedc99bd94549ee490031f86f8d0a6ca
Author: Ian Lance Taylor <iant@golang.org>
Date:   Wed Sep 6 11:21:11 2023 -0700

    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

Diff:
---
 gcc/go/gofrontend/MERGE                | 2 +-
 libgo/go/cmd/go/internal/work/gccgo.go | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 83ab3e2d64cb..30710e856cba 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-d04b024021bb7dbaa434a6d902bd12beb08e315f
+53cdfab53ce79d8dfc1df01a696d4ffc43f17c3d
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/libgo/go/cmd/go/internal/work/gccgo.go b/libgo/go/cmd/go/internal/work/gccgo.go
index c1026c71e013..3e07f8791ebc 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() {


More information about the Gcc-cvs mailing list