// For package runtime, copy some files into the work space.
if dir == "runtime" {
+ xmkdirall(pathf("%s/pkg/include", goroot))
// For use by assembly and C files.
- copyfile(pathf("%s/pkg/%s_%s/textflag.h", goroot, goos, goarch),
+ copyfile(pathf("%s/pkg/include/textflag.h", goroot),
pathf("%s/src/runtime/textflag.h", goroot), 0)
- copyfile(pathf("%s/pkg/%s_%s/funcdata.h", goroot, goos, goarch),
+ copyfile(pathf("%s/pkg/include/funcdata.h", goroot),
pathf("%s/src/runtime/funcdata.h", goroot), 0)
}
compile = []string{
pathf("%s/asm", tooldir),
"-I", workdir,
- "-I", pathf("%s/pkg/%s_%s", goroot, goos, goarch),
+ "-I", pathf("%s/pkg/include", goroot),
"-D", "GOOS_" + goos,
"-D", "GOARCH_" + goarch,
"-D", "GOOS_GOARCH_" + goos + "_" + goarch,
func (gcToolchain) asm(b *builder, p *Package, obj, ofile, sfile string) error {
// Add -I pkg/GOOS_GOARCH so #include "textflag.h" works in .s files.
- inc := filepath.Join(goroot, "pkg", fmt.Sprintf("%s_%s", goos, goarch))
+ inc := filepath.Join(goroot, "pkg", "include")
sfile = mkAbs(p.Dir, sfile)
args := []interface{}{buildToolExec, tool("asm"), "-o", ofile, "-trimpath", b.work, "-I", obj, "-I", inc, "-D", "GOOS_" + goos, "-D", "GOARCH_" + goarch, sfile}
if err := b.run(p.Dir, p.ImportPath, nil, args...); err != nil {
}
func (gccgoToolchain) cc(b *builder, p *Package, objdir, ofile, cfile string) error {
- inc := filepath.Join(goroot, "pkg", fmt.Sprintf("%s_%s", goos, goarch))
+ inc := filepath.Join(goroot, "pkg", "include")
cfile = mkAbs(p.Dir, cfile)
defs := []string{"-D", "GOOS_" + goos, "-D", "GOARCH_" + goarch}
defs = append(defs, b.gccArchArgs()...)