From: Ian Lance Taylor Date: Tue, 19 Jan 2016 05:23:33 +0000 (-0800) Subject: cmd/go: fix handling of asm files for -compiler=gccgo X-Git-Tag: go1.6rc1~52 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3415d0c49ddb6c48a90919eb023c71c7e82c3189;p=gostls13.git cmd/go: fix handling of asm files for -compiler=gccgo 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 TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 6a8edaf6d2..e127524ceb 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -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 {