]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cmd/go: permit $AR to include options
authorIan Lance Taylor <iant@golang.org>
Wed, 6 Sep 2023 18:21:11 +0000 (11:21 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 6 Sep 2023 18:37:20 +0000 (11:37 -0700)
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

gcc/go/gofrontend/MERGE
libgo/go/cmd/go/internal/work/gccgo.go

index 83ab3e2d64cb45933b016881a0847310dd128b0f..30710e856cba0c0dbc3a3a4867d7d7db437d8361 100644 (file)
@@ -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.
index c1026c71e0133e440d0599abfd5cfe7fe02536bd..3e07f8791ebc4d9dc7f17fa2fb863daeff884743 100644 (file)
@@ -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() {