From 4a8ed58450d282a1a66f4fad7b424f4794264694 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 10 Jan 2018 15:18:55 +0000 Subject: [PATCH] cmd/go: check for another GCC error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit GCC always recognizes the -fsplit-stack option, but then tests whether it is supported by the selected target. If not, it reports cc1: error: ‘-fsplit-stack’ is not supported by this compiler configuration Check for that error message when deciding whether a compiler option works. Reviewed-on: https://go-review.googlesource.com/87137 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256433 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- libgo/go/cmd/go/internal/work/exec.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 6f8fa9c4d0d..cb13cf09304 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -c22eb29a62b4fd72ad2ea09ebe5fcea5b8ed78b8 +87df767807acac466edb3bb6445ad83a48141d17 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/exec.go b/libgo/go/cmd/go/internal/work/exec.go index f955573e297..963a5151ead 100644 --- a/libgo/go/cmd/go/internal/work/exec.go +++ b/libgo/go/cmd/go/internal/work/exec.go @@ -1857,9 +1857,11 @@ func (b *Builder) gccSupportsFlag(compiler []string, flag string) bool { // GCC says "unrecognized command line option". // clang says "unknown argument". // Older versions of GCC say "unrecognised debug output level". + // For -fsplit-stack GCC says "'-fsplit-stack' is not supported". supported := !bytes.Contains(out, []byte("unrecognized")) && !bytes.Contains(out, []byte("unknown")) && - !bytes.Contains(out, []byte("unrecognised")) + !bytes.Contains(out, []byte("unrecognised")) && + !bytes.Contains(out, []byte("is not supported")) b.flagCache[key] = supported return supported } -- 2.11.4.GIT