Commit c5b45aa9 authored by Ian Lance Taylor's avatar Ian Lance Taylor

cmd/go: use .o, not .{5,6,8}, for gccgo created object files

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5861044
parent a84e3baf
...@@ -1466,6 +1466,8 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo, ...@@ -1466,6 +1466,8 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
cgoflags := []string{} cgoflags := []string{}
// TODO: make cgo not depend on $GOARCH? // TODO: make cgo not depend on $GOARCH?
objExt := archChar
if p.Standard && p.ImportPath == "runtime/cgo" { if p.Standard && p.ImportPath == "runtime/cgo" {
cgoflags = append(cgoflags, "-import_runtime_cgo=false") cgoflags = append(cgoflags, "-import_runtime_cgo=false")
} }
...@@ -1474,6 +1476,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo, ...@@ -1474,6 +1476,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
if prefix := gccgoPrefix(p); prefix != "" { if prefix := gccgoPrefix(p); prefix != "" {
cgoflags = append(cgoflags, "-gccgoprefix="+gccgoPrefix(p)) cgoflags = append(cgoflags, "-gccgoprefix="+gccgoPrefix(p))
} }
objExt = "o"
} }
if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, cgoflags, "--", cgoCFLAGS, p.CgoFiles); err != nil { if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, cgoflags, "--", cgoCFLAGS, p.CgoFiles); err != nil {
return nil, nil, err return nil, nil, err
...@@ -1481,7 +1484,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo, ...@@ -1481,7 +1484,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
outGo = append(outGo, gofiles...) outGo = append(outGo, gofiles...)
// cc _cgo_defun.c // cc _cgo_defun.c
defunObj := obj + "_cgo_defun." + archChar defunObj := obj + "_cgo_defun." + objExt
if err := buildToolchain.cc(b, p, obj, defunObj, defunC); err != nil { if err := buildToolchain.cc(b, p, obj, defunObj, defunC); err != nil {
return nil, nil, err return nil, nil, err
} }
...@@ -1524,7 +1527,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo, ...@@ -1524,7 +1527,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
} }
// cc _cgo_import.ARCH // cc _cgo_import.ARCH
importObj := obj + "_cgo_import." + archChar importObj := obj + "_cgo_import." + objExt
if err := buildToolchain.cc(b, p, obj, importObj, importC); err != nil { if err := buildToolchain.cc(b, p, obj, importObj, importC); err != nil {
return nil, nil, err return nil, nil, err
} }
......
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