or, if set explicitly, has _race appended to it.
-ldflags 'flag list'
arguments to pass on each 5l, 6l, 8l, or 9l linker invocation.
+ -asmflags 'flag list'
+ arguments to pass on each asm assembler invocation.
-tags 'tag list'
a list of build tags to consider satisfied during the build.
For more information about build tags, see the description of
var buildI bool // -i flag
var buildO = cmdBuild.Flag.String("o", "", "output file")
var buildWork bool // -work flag
+var buildAsmflags []string // -asmflags flag
var buildGcflags []string // -gcflags flag
var buildLdflags []string // -ldflags flag
var buildGccgoflags []string // -gccgoflags flag
cmd.Flag.BoolVar(&buildV, "v", false, "")
cmd.Flag.BoolVar(&buildX, "x", false, "")
cmd.Flag.BoolVar(&buildWork, "work", false, "")
+ cmd.Flag.Var((*stringsFlag)(&buildAsmflags), "asmflags", "")
cmd.Flag.Var((*stringsFlag)(&buildGcflags), "gcflags", "")
cmd.Flag.Var((*stringsFlag)(&buildLdflags), "ldflags", "")
cmd.Flag.Var((*stringsFlag)(&buildGccgoflags), "gccgoflags", "")
// Add -I pkg/GOOS_GOARCH so #include "textflag.h" works in .s files.
inc := filepath.Join(goroot, "pkg", "include")
sfile = mkAbs(p.Dir, sfile)
- args := []interface{}{buildToolExec, tool("asm"), "-o", ofile, "-trimpath", b.work, "-I", obj, "-I", inc, "-D", "GOOS_" + goos, "-D", "GOARCH_" + goarch, sfile}
+ args := []interface{}{buildToolExec, tool("asm"), "-o", ofile, "-trimpath", b.work, "-I", obj, "-I", inc, "-D", "GOOS_" + goos, "-D", "GOARCH_" + goarch, buildAsmflags, sfile}
if err := b.run(p.Dir, p.ImportPath, nil, args...); err != nil {
return err
}
- if verifyAsm && goarch != "arm64" {
+ // Disable checks when additional flags are passed, as the old assemblers
+ // don't implement some of them (e.g., -shared).
+ if verifyAsm && goarch != "arm64" && len(buildAsmflags) == 0 {
if err := toolVerify(b, p, "old"+archChar()+"a", ofile, args); err != nil {
return err
}
print the commands but do not run them.
-p n
the number of builds that can be run in parallel.
- The default is the number of CPUs available.
+ The default is the number of CPUs available, except
+ on darwin/arm which defaults to 1.
-race
enable data race detection.
Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64.
or, if set explicitly, has _race appended to it.
-ldflags 'flag list'
arguments to pass on each 5l, 6l, 8l, or 9l linker invocation.
+ -asmflags 'flag list'
+ arguments to pass on each asm assembler invocation.
-tags 'tag list'
a list of build tags to consider satisfied during the build.
For more information about build tags, see the description of
- "std" is like all but expands to just the packages in the standard
Go library.
+- "cmd" expands to the Go repository's commands and their
+internal libraries.
+
An import path is a pattern if it includes one or more "..." wildcards,
each of which can match any string, including the empty string and
strings containing slashes. Such a pattern expands to all package