Skip to content

Commit 9255688

Browse files
committed
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>
1 parent b358987 commit 9255688

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

src/cmd/asm/doc.go

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Flags:
3939
Generate code that can be linked into a shared library.
4040
-trimpath prefix
4141
Remove prefix from recorded source file paths.
42+
-gensymabis
43+
Write symbol ABI information to output file. Don't assemble.
4244
Input language:
4345
4446
The assembler uses mostly the same syntax for all architectures,

src/cmd/asm/internal/flags/flags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var (
2222
Shared = flag.Bool("shared", false, "generate code that can be linked into a shared library")
2323
Dynlink = flag.Bool("dynlink", false, "support references to Go symbols defined in other shared libraries")
2424
AllErrors = flag.Bool("e", false, "no limit on number of errors reported")
25-
SymABIs = flag.Bool("symabis", false, "write symbol ABI information to output file, don't assemble")
25+
SymABIs = flag.Bool("gensymabis", false, "write symbol ABI information to output file, don't assemble")
2626
)
2727

2828
var (

src/cmd/dist/build.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ func runInstall(dir string, ch chan struct{}) {
804804
if len(sfiles) > 0 {
805805
symabis = pathf("%s/symabis", workdir)
806806
var wg sync.WaitGroup
807-
asmabis := append(asmArgs[:len(asmArgs):len(asmArgs)], "-symabis", "-o", symabis)
807+
asmabis := append(asmArgs[:len(asmArgs):len(asmArgs)], "-gensymabis", "-o", symabis)
808808
asmabis = append(asmabis, sfiles...)
809809
if err := ioutil.WriteFile(goasmh, nil, 0666); err != nil {
810810
fatalf("cannot write empty go_asm.h: %s", err)

src/cmd/go/internal/work/gc.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func (gcToolchain) asm(b *Builder, a *Action, sfiles []string) ([]string, error)
265265
func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, error) {
266266
mkSymabis := func(p *load.Package, sfiles []string, path string) error {
267267
args := asmArgs(a, p)
268-
args = append(args, "-symabis", "-o", path)
268+
args = append(args, "-gensymabis", "-o", path)
269269
for _, sfile := range sfiles {
270270
if p.ImportPath == "runtime/cgo" && strings.HasPrefix(sfile, "gcc_") {
271271
continue
@@ -274,7 +274,7 @@ func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, erro
274274
}
275275

276276
// Supply an empty go_asm.h as if the compiler had been run.
277-
// -symabis parsing is lax enough that we don't need the
277+
// -gensymabis parsing is lax enough that we don't need the
278278
// actual definitions that would appear in go_asm.h.
279279
if err := b.writeFile(a.Objdir+"go_asm.h", nil); err != nil {
280280
return err

test/run.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ func (t *test) run() {
813813
t.err = fmt.Errorf("write empty go_asm.h: %s", err)
814814
return
815815
}
816-
cmd := []string{goTool(), "tool", "asm", "-symabis", "-o", "symabis"}
816+
cmd := []string{goTool(), "tool", "asm", "-gensymabis", "-o", "symabis"}
817817
cmd = append(cmd, asms...)
818818
_, err = runcmd(cmd...)
819819
if err != nil {

0 commit comments

Comments
 (0)