mirror of
https://github.com/golang/go
synced 2024-11-19 05:04:43 -07:00
cmd/go: use correct link flags if main package contains C++/ObjC files
LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/117470043
This commit is contained in:
parent
668a55a882
commit
fe513d8b3e
@ -1708,7 +1708,7 @@ func packInternal(b *builder, afile string, ofiles []string) error {
|
||||
|
||||
func (gcToolchain) ld(b *builder, p *Package, out string, allactions []*action, mainpkg string, ofiles []string) error {
|
||||
importArgs := b.includeArgs("-L", allactions)
|
||||
cxx := false
|
||||
cxx := len(p.CXXFiles) > 0
|
||||
for _, a := range allactions {
|
||||
if a.p != nil && len(a.p.CXXFiles) > 0 {
|
||||
cxx = true
|
||||
@ -1846,8 +1846,8 @@ func (tools gccgoToolchain) ld(b *builder, p *Package, out string, allactions []
|
||||
ldflags := b.gccArchArgs()
|
||||
cgoldflags := []string{}
|
||||
usesCgo := false
|
||||
cxx := false
|
||||
objc := false
|
||||
cxx := len(p.CXXFiles) > 0
|
||||
objc := len(p.MFiles) > 0
|
||||
|
||||
// Prefer the output of an install action to the output of a build action,
|
||||
// because the install action will delete the output of the build action.
|
||||
|
Loading…
Reference in New Issue
Block a user