mirror of https://github.com/golang/go.git
cmd/asm: rename -symabis to -gensymabis
Currently, both asm and compile have a -symabis flag, but in asm it's a boolean flag that means to generate a symbol ABIs file and in the compiler its a string flag giving the path of the symbol ABIs file to consume. I'm worried about this false symmetry biting us in the future, so rename asm's flag to -gensymabis. Updates #27539. Change-Id: I8b9c18a852d2838099718f8989813f19d82e7434 Reviewed-on: https://go-review.googlesource.com/c/149818 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
b358987666
commit
9255688610
|
|
@ -39,6 +39,8 @@ Flags:
|
||||||
Generate code that can be linked into a shared library.
|
Generate code that can be linked into a shared library.
|
||||||
-trimpath prefix
|
-trimpath prefix
|
||||||
Remove prefix from recorded source file paths.
|
Remove prefix from recorded source file paths.
|
||||||
|
-gensymabis
|
||||||
|
Write symbol ABI information to output file. Don't assemble.
|
||||||
Input language:
|
Input language:
|
||||||
|
|
||||||
The assembler uses mostly the same syntax for all architectures,
|
The assembler uses mostly the same syntax for all architectures,
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ var (
|
||||||
Shared = flag.Bool("shared", false, "generate code that can be linked into a shared library")
|
Shared = flag.Bool("shared", false, "generate code that can be linked into a shared library")
|
||||||
Dynlink = flag.Bool("dynlink", false, "support references to Go symbols defined in other shared libraries")
|
Dynlink = flag.Bool("dynlink", false, "support references to Go symbols defined in other shared libraries")
|
||||||
AllErrors = flag.Bool("e", false, "no limit on number of errors reported")
|
AllErrors = flag.Bool("e", false, "no limit on number of errors reported")
|
||||||
SymABIs = flag.Bool("symabis", false, "write symbol ABI information to output file, don't assemble")
|
SymABIs = flag.Bool("gensymabis", false, "write symbol ABI information to output file, don't assemble")
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -804,7 +804,7 @@ func runInstall(dir string, ch chan struct{}) {
|
||||||
if len(sfiles) > 0 {
|
if len(sfiles) > 0 {
|
||||||
symabis = pathf("%s/symabis", workdir)
|
symabis = pathf("%s/symabis", workdir)
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
asmabis := append(asmArgs[:len(asmArgs):len(asmArgs)], "-symabis", "-o", symabis)
|
asmabis := append(asmArgs[:len(asmArgs):len(asmArgs)], "-gensymabis", "-o", symabis)
|
||||||
asmabis = append(asmabis, sfiles...)
|
asmabis = append(asmabis, sfiles...)
|
||||||
if err := ioutil.WriteFile(goasmh, nil, 0666); err != nil {
|
if err := ioutil.WriteFile(goasmh, nil, 0666); err != nil {
|
||||||
fatalf("cannot write empty go_asm.h: %s", err)
|
fatalf("cannot write empty go_asm.h: %s", err)
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ func (gcToolchain) asm(b *Builder, a *Action, sfiles []string) ([]string, error)
|
||||||
func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, error) {
|
func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, error) {
|
||||||
mkSymabis := func(p *load.Package, sfiles []string, path string) error {
|
mkSymabis := func(p *load.Package, sfiles []string, path string) error {
|
||||||
args := asmArgs(a, p)
|
args := asmArgs(a, p)
|
||||||
args = append(args, "-symabis", "-o", path)
|
args = append(args, "-gensymabis", "-o", path)
|
||||||
for _, sfile := range sfiles {
|
for _, sfile := range sfiles {
|
||||||
if p.ImportPath == "runtime/cgo" && strings.HasPrefix(sfile, "gcc_") {
|
if p.ImportPath == "runtime/cgo" && strings.HasPrefix(sfile, "gcc_") {
|
||||||
continue
|
continue
|
||||||
|
|
@ -274,7 +274,7 @@ func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, erro
|
||||||
}
|
}
|
||||||
|
|
||||||
// Supply an empty go_asm.h as if the compiler had been run.
|
// Supply an empty go_asm.h as if the compiler had been run.
|
||||||
// -symabis parsing is lax enough that we don't need the
|
// -gensymabis parsing is lax enough that we don't need the
|
||||||
// actual definitions that would appear in go_asm.h.
|
// actual definitions that would appear in go_asm.h.
|
||||||
if err := b.writeFile(a.Objdir+"go_asm.h", nil); err != nil {
|
if err := b.writeFile(a.Objdir+"go_asm.h", nil); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -813,7 +813,7 @@ func (t *test) run() {
|
||||||
t.err = fmt.Errorf("write empty go_asm.h: %s", err)
|
t.err = fmt.Errorf("write empty go_asm.h: %s", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cmd := []string{goTool(), "tool", "asm", "-symabis", "-o", "symabis"}
|
cmd := []string{goTool(), "tool", "asm", "-gensymabis", "-o", "symabis"}
|
||||||
cmd = append(cmd, asms...)
|
cmd = append(cmd, asms...)
|
||||||
_, err = runcmd(cmd...)
|
_, err = runcmd(cmd...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue