Commit 3e1e66fa authored by Than McIntosh's avatar Than McIntosh

cmd/link: don't pass -gdwarf-2 to external linker

Don't pass -gdwarf-2 to the external linker when external linkage is
requested. The Go compiler is now emitting DWARF version 4, so this
doesn't seem needed any more.

Fixes #22455

Change-Id: Ic4122c55e946619a266430f2d26f06d6803dd232
Reviewed-on: https://go-review.googlesource.com/73672Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 509140a5
......@@ -1073,15 +1073,15 @@ func (ctxt *Link) hostlink() {
argv = append(argv, *flagExtld)
argv = append(argv, hostlinkArchArgs(ctxt.Arch)...)
if !*FlagS && !debug_s {
argv = append(argv, "-gdwarf-2")
} else if ctxt.HeadType == objabi.Hdarwin {
if *FlagS || debug_s {
if ctxt.HeadType == objabi.Hdarwin {
// Recent versions of macOS print
// ld: warning: option -s is obsolete and being ignored
// so do not pass any arguments.
} else {
argv = append(argv, "-s")
}
}
switch ctxt.HeadType {
case objabi.Hdarwin:
......
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