]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist, cmd/go: move textdata.h, funcdata.h from pkg/GOOS_GOARCH to pkg/include
authorRuss Cox <rsc@golang.org>
Mon, 2 Mar 2015 15:30:47 +0000 (10:30 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 2 Mar 2015 18:39:01 +0000 (18:39 +0000)
There's no point to having them in every GOOS_GOARCH directory,
since they are neither GOOS- nor GOARCH-specific.
(There used to be other headers that were.)

This makes building for additional toolchains easier:
no need to run make.bash at all.

Fixes #10049.

Change-Id: I710ecaafd7a5c8cad85ccd595ea9cb6058f553b3
Reviewed-on: https://go-review.googlesource.com/6471
Reviewed-by: Rob Pike <r@golang.org>
src/cmd/dist/build.go
src/cmd/go/build.go

index 0b5519696bc7e889c46eb450009bbc58009da6c6..0d15a36982b875beb9524a765748a1f6ae2f4091 100644 (file)
@@ -613,10 +613,11 @@ func install(dir string) {
 
        // 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)
        }
 
@@ -691,7 +692,7 @@ func install(dir string) {
                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,
index 5e4d4886ade367a2d5d4149fa8bb0ed8756f43cc..a4c97d96407edeb1f3380972bc79bf09e2e706b2 100644 (file)
@@ -1709,7 +1709,7 @@ const verifyAsm = true
 
 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 {
@@ -2030,7 +2030,7 @@ func (tools gccgoToolchain) ld(b *builder, p *Package, out string, allactions []
 }
 
 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()...)