]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: recognize clang linker error in testCGOLTO
authorIan Lance Taylor <iant@golang.org>
Wed, 2 Jun 2021 14:43:57 +0000 (07:43 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 2 Jun 2021 15:45:31 +0000 (15:45 +0000)
Also recognize a case in which GCC does not run (from
https://build.golang.org/log/7f6d8b35c905b9829f05906beccca44f208aa569).

Fixes #46517

Change-Id: I4fe4164a5df92b2dec08fd767f65a4d5479f3f36
Reviewed-on: https://go-review.googlesource.com/c/go/+/324169
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
src/cmd/link/cgo_test.go

index 09390daeb7e1b4e9da5756acf65cfefa88862292..26ab8024541d6cfc66b1b6694e4725779bd0d81a 100644 (file)
@@ -121,11 +121,14 @@ func testCGOLTO(t *testing.T, cc string, test int) {
                t.Logf("go build failed: %v", err)
 
                // Error messages we've seen indicating that LTO is not supported.
+               // These errors come from GCC or clang, not Go.
                var noLTO = []string{
                        `unrecognized command line option "-flto"`,
                        "unable to pass LLVM bit-code files to linker",
                        "file not recognized: File format not recognized",
                        "LTO support has not been enabled",
+                       "linker command failed with exit code",
+                       "gcc: can't load library",
                }
                for _, msg := range noLTO {
                        if bytes.Contains(out, []byte(msg)) {