mirror of https://github.com/golang/go.git
cmd/link: on Mach-O, generate LC_UUID by default
On Mach-O, default to "-B gobuildid", so it generates the UUID based on Go buildid by default. Fixes #68678. Cq-Include-Trybots: luci.golang.try:gotip-darwin-amd64_14,gotip-darwin-arm64_13 Change-Id: I6c1a6bcafd8370a13174657e05d7d9620a8d4f12 Reviewed-on: https://go-review.googlesource.com/c/go/+/618598 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Than McIntosh <thanm@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
0bb2183d45
commit
6a4feb5644
|
|
@ -807,6 +807,9 @@ func elfwritefreebsdsig(out *OutBuf) int {
|
||||||
|
|
||||||
func addbuildinfo(ctxt *Link) {
|
func addbuildinfo(ctxt *Link) {
|
||||||
val := *flagHostBuildid
|
val := *flagHostBuildid
|
||||||
|
if val == "" || val == "none" {
|
||||||
|
return
|
||||||
|
}
|
||||||
if val == "gobuildid" {
|
if val == "gobuildid" {
|
||||||
buildID := *flagBuildid
|
buildID := *flagBuildid
|
||||||
if buildID == "" {
|
if buildID == "" {
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ var (
|
||||||
flagN = flag.Bool("n", false, "no-op (deprecated)")
|
flagN = flag.Bool("n", false, "no-op (deprecated)")
|
||||||
FlagS = flag.Bool("s", false, "disable symbol table")
|
FlagS = flag.Bool("s", false, "disable symbol table")
|
||||||
flag8 bool // use 64-bit addresses in symbol table
|
flag8 bool // use 64-bit addresses in symbol table
|
||||||
flagHostBuildid = flag.String("B", "", "set ELF NT_GNU_BUILD_ID `note` or Mach-O UUID; use \"gobuildid\" to generate it from the Go build ID")
|
flagHostBuildid = flag.String("B", "", "set ELF NT_GNU_BUILD_ID `note` or Mach-O UUID; use \"gobuildid\" to generate it from the Go build ID; \"none\" to disable")
|
||||||
flagInterpreter = flag.String("I", "", "use `linker` as ELF dynamic linker")
|
flagInterpreter = flag.String("I", "", "use `linker` as ELF dynamic linker")
|
||||||
flagCheckLinkname = flag.Bool("checklinkname", true, "check linkname symbol references")
|
flagCheckLinkname = flag.Bool("checklinkname", true, "check linkname symbol references")
|
||||||
FlagDebugTramp = flag.Int("debugtramp", 0, "debug trampolines")
|
FlagDebugTramp = flag.Int("debugtramp", 0, "debug trampolines")
|
||||||
|
|
@ -294,9 +294,10 @@ func Main(arch *sys.Arch, theArch Arch) {
|
||||||
*flagBuildid = "go-openbsd"
|
*flagBuildid = "go-openbsd"
|
||||||
}
|
}
|
||||||
|
|
||||||
if *flagHostBuildid != "" {
|
if *flagHostBuildid == "" && *flagBuildid != "" && ctxt.IsDarwin() {
|
||||||
addbuildinfo(ctxt)
|
*flagHostBuildid = "gobuildid"
|
||||||
}
|
}
|
||||||
|
addbuildinfo(ctxt)
|
||||||
|
|
||||||
// enable benchmarking
|
// enable benchmarking
|
||||||
var bench *benchmark.Metrics
|
var bench *benchmark.Metrics
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue