mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: remove obsolete -cdefs flag
Now that there's no 6c compiler anymore, there's no need for cgo to generate C headers that are compatible with it. Fixes #9528 Change-Id: I43f53869719eb9a6065f1b39f66f060e604cbee0 Reviewed-on: https://go-review.googlesource.com/2482 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
f7e43f14d3
commit
b2aab72d9a
10 changed files with 16 additions and 387 deletions
|
|
@ -155,10 +155,9 @@ var dynpackage = flag.String("dynpackage", "main", "set Go package for -dynimpor
|
|||
var dynlinker = flag.Bool("dynlinker", false, "record dynamic linker information in -dynimport mode")
|
||||
|
||||
// These flags are for bootstrapping a new Go implementation,
|
||||
// to generate Go and C headers that match the data layout and
|
||||
// to generate Go types that match the data layout and
|
||||
// constant values used in the host's C libraries and system calls.
|
||||
var godefs = flag.Bool("godefs", false, "for bootstrap: write Go definitions for C file to standard output")
|
||||
var cdefs = flag.Bool("cdefs", false, "for bootstrap: write C definitions for C file to standard output")
|
||||
var objDir = flag.String("objdir", "", "object directory")
|
||||
|
||||
var gccgo = flag.Bool("gccgo", false, "generate files for use with gccgo")
|
||||
|
|
@ -185,12 +184,7 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
if *godefs && *cdefs {
|
||||
fmt.Fprintf(os.Stderr, "cgo: cannot use -cdefs and -godefs together\n")
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
if *godefs || *cdefs {
|
||||
if *godefs {
|
||||
// Generating definitions pulled from header files,
|
||||
// to be checked into Go repositories.
|
||||
// Line numbers are just noise.
|
||||
|
|
@ -282,14 +276,12 @@ func main() {
|
|||
p.Record(f)
|
||||
if *godefs {
|
||||
os.Stdout.WriteString(p.godefs(f, input))
|
||||
} else if *cdefs {
|
||||
os.Stdout.WriteString(p.cdefs(f, input))
|
||||
} else {
|
||||
p.writeOutput(f, input)
|
||||
}
|
||||
}
|
||||
|
||||
if !*godefs && !*cdefs {
|
||||
if !*godefs {
|
||||
p.writeDefs()
|
||||
}
|
||||
if nerrors > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue