Commit 92556886 authored by Austin Clements's avatar Austin Clements

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: 's avatarIan Lance Taylor <iant@golang.org>
parent b3589876
......@@ -39,6 +39,8 @@ Flags:
Generate code that can be linked into a shared library.
-trimpath prefix
Remove prefix from recorded source file paths.
-gensymabis
Write symbol ABI information to output file. Don't assemble.
Input language:
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")
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")
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 (
......
......@@ -804,7 +804,7 @@ func runInstall(dir string, ch chan struct{}) {
if len(sfiles) > 0 {
symabis = pathf("%s/symabis", workdir)
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...)
if err := ioutil.WriteFile(goasmh, nil, 0666); err != nil {
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) {
mkSymabis := func(p *load.Package, sfiles []string, path string) error {
args := asmArgs(a, p)
args = append(args, "-symabis", "-o", path)
args = append(args, "-gensymabis", "-o", path)
for _, sfile := range sfiles {
if p.ImportPath == "runtime/cgo" && strings.HasPrefix(sfile, "gcc_") {
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.
// -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.
if err := b.writeFile(a.Objdir+"go_asm.h", nil); err != nil {
return err
......
......@@ -813,7 +813,7 @@ func (t *test) run() {
t.err = fmt.Errorf("write empty go_asm.h: %s", err)
return
}
cmd := []string{goTool(), "tool", "asm", "-symabis", "-o", "symabis"}
cmd := []string{goTool(), "tool", "asm", "-gensymabis", "-o", "symabis"}
cmd = append(cmd, asms...)
_, err = runcmd(cmd...)
if err != nil {
......
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