Commit ba0e02b2 authored by Russ Cox's avatar Russ Cox

cgo: write _cgo_export.h to object directory, not source dir

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5540048
parent 630c8388
......@@ -396,7 +396,7 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) {
// from Go so that they are callable from C.
func (p *Package) writeExports(fgo2, fc, fm *os.File) {
fgcc := creat(*objDir + "_cgo_export.c")
fgcch := creat("_cgo_export.h")
fgcch := creat(*objDir + "_cgo_export.h")
fmt.Fprintf(fgcch, "/* Created by cgo - DO NOT EDIT. */\n")
fmt.Fprintf(fgcch, "%s\n", gccExportHeaderProlog)
......
......@@ -396,8 +396,7 @@ func (b *build) cgo(cgofiles, cgocfiles []string) (outGo, outObj []string) {
Output: output,
})
outGo = append(outGo, gofiles...)
exportH := filepath.Join(b.path, "_cgo_export.h")
b.script.addIntermediate(defunC, exportH, b.obj+"_cgo_flags")
b.script.addIntermediate(defunC, b.obj+"_cgo_export.h", b.obj+"_cgo_flags")
b.script.addIntermediate(cfiles...)
// cc _cgo_defun.c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment