1 From 39ecf13fd2e3026d5db2baf24c67f27e09589ea0 Mon Sep 17 00:00:00 2001
2 From: Petr Sumbera <petr.sumbera@oracle.com>
3 Date: Wed, 13 Nov 2019 18:05:21 +0000
4 Subject: gccgo should use GNU ar
6 Fix following error message:
8 $ /usr/gcc/9/bin/go build main.go
11 ar -d [-SvV] archive [file...]
12 ar -m [-SvV] [-{a|b|i} posname] archive [file...]
13 ar -p [-sSvV] archive [file ...]
14 ar -q [-cSvV] archive [file...]
15 ar -r [-cSuvV] [-{a|b|i} posname] archive [file...]
16 ar -t [-sSvV] archive [file...]
17 ar -x [-CsSTvV] archive [file...]
20 The error is harmless, no functionality issue, GCCGO runs Solaris "ar" which
21 doesn't know -D option, after failure, GCCGO runs it again without -D.
23 libgo/go/cmd/go/internal/work/gccgo.go | 2 +-
24 libgo/go/go/internal/gccgoimporter/importer_test.go | 2 +-
25 2 files changed, 2 insertions(+), 2 deletions(-)
27 diff --git a/libgo/go/cmd/go/internal/work/gccgo.go b/libgo/go/cmd/go/internal/work/gccgo.go
28 index 1e8250002eec..17fec9339355 100644
29 --- a/libgo/go/cmd/go/internal/work/gccgo.go
30 +++ b/libgo/go/cmd/go/internal/work/gccgo.go
31 @@ -48,7 +48,7 @@ func (gccgoToolchain) linker() string {
32 func (gccgoToolchain) ar() string {
33 ar := cfg.Getenv("AR")
40 diff --git a/libgo/go/go/internal/gccgoimporter/importer_test.go b/libgo/go/go/internal/gccgoimporter/importer_test.go
41 index 8a7ee1aa4ffa..fecf18111709 100644
42 --- a/libgo/go/go/internal/gccgoimporter/importer_test.go
43 +++ b/libgo/go/go/internal/gccgoimporter/importer_test.go
44 @@ -180,7 +180,7 @@ func TestObjImporter(t *testing.T) {
46 runImporterTest(t, imp, initmap, &test)
48 - cmd = exec.Command("ar", "cr", afile, ofile)
49 + cmd = exec.Command("/usr/bin/gar", "cr", afile, ofile)
50 out, err = cmd.CombinedOutput()