Commit b9d36a8d by Ian Lance Taylor

cmd/go: use gccSupportsFlag for -fsplit-stack

    
    Don't assume that all (or only) 386/amd64 compilers support
    -fsplit-stack.
    
    Reviewed-on: https://go-review.googlesource.com/48592

From-SVN: r250216
parent b70bb05b
9294e79fced202ade7eb236bbe78b766e7e0374f a77b1091fa83cfaf200e6dad26e92e42483bae43
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -3092,8 +3092,7 @@ func (tools gccgoToolchain) cc(b *builder, p *Package, objdir, ofile, cfile stri ...@@ -3092,8 +3092,7 @@ func (tools gccgoToolchain) cc(b *builder, p *Package, objdir, ofile, cfile stri
if pkgpath := gccgoCleanPkgpath(p); pkgpath != "" { if pkgpath := gccgoCleanPkgpath(p); pkgpath != "" {
defs = append(defs, `-D`, `GOPKGPATH="`+pkgpath+`"`) defs = append(defs, `-D`, `GOPKGPATH="`+pkgpath+`"`)
} }
switch goarch { if b.gccSupportsFlag("-fsplit-stack") {
case "386", "amd64":
defs = append(defs, "-fsplit-stack") defs = append(defs, "-fsplit-stack")
} }
defs = tools.maybePIC(defs) defs = tools.maybePIC(defs)
...@@ -3428,8 +3427,7 @@ func (b *builder) cgo(a *action, cgoExe, obj string, pcCFLAGS, pcLDFLAGS, cgofil ...@@ -3428,8 +3427,7 @@ func (b *builder) cgo(a *action, cgoExe, obj string, pcCFLAGS, pcLDFLAGS, cgofil
} }
if _, ok := buildToolchain.(gccgoToolchain); ok { if _, ok := buildToolchain.(gccgoToolchain); ok {
switch goarch { if b.gccSupportsFlag("-fsplit-stack") {
case "386", "amd64":
cgoCFLAGS = append(cgoCFLAGS, "-fsplit-stack") cgoCFLAGS = append(cgoCFLAGS, "-fsplit-stack")
} }
cgoflags = append(cgoflags, "-gccgo") cgoflags = append(cgoflags, "-gccgo")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment