From 3415d0c49ddb6c48a90919eb023c71c7e82c3189 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 18 Jan 2016 21:23:33 -0800 Subject: [PATCH] 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 --- src/cmd/go/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 { -- 2.50.0