]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix handling of asm files for -compiler=gccgo
authorIan Lance Taylor <iant@golang.org>
Tue, 19 Jan 2016 05:23:33 +0000 (21:23 -0800)
committerIan Lance Taylor <iant@golang.org>
Mon, 25 Jan 2016 02:45:09 +0000 (02:45 +0000)
Pass -c to generate an object.  Pass GOPKGPATH as a symbol, not a
string.  Pass -xassembler-with-cpp so that the preprocessor is run.

Change-Id: I84690a73cc580bb05724ed07c120cec9cfd5e48b
Reviewed-on: https://go-review.googlesource.com/18733
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/build.go

index 6a8edaf6d25f065559261a555c681a2a5954019b..e127524ceb341facfbc4aa0efd2358ddb1961464 100644 (file)
@@ -2568,11 +2568,11 @@ func (tools gccgoToolchain) asm(b *builder, p *Package, obj, ofile, sfile string
        sfile = mkAbs(p.Dir, sfile)
        defs := []string{"-D", "GOOS_" + goos, "-D", "GOARCH_" + goarch}
        if pkgpath := gccgoCleanPkgpath(p); pkgpath != "" {
-               defs = append(defs, `-D`, `GOPKGPATH="`+pkgpath+`"`)
+               defs = append(defs, `-D`, `GOPKGPATH=`+pkgpath)
        }
        defs = tools.maybePIC(defs)
        defs = append(defs, b.gccArchArgs()...)
-       return b.run(p.Dir, p.ImportPath, nil, tools.compiler(), "-I", obj, "-o", ofile, defs, sfile)
+       return b.run(p.Dir, p.ImportPath, nil, tools.compiler(), "-xassembler-with-cpp", "-I", obj, "-c", "-o", ofile, defs, sfile)
 }
 
 func (gccgoToolchain) pkgpath(basedir string, p *Package) string {