cmd/link: don't pass -Wl,-S on AIX

The AIX linker's -S flag has a different meaning. Don't pass it.

Updates #75618.

Change-Id: I98faabea3435cde255f4c2d25f34dde9f69b7ec9
Reviewed-on: https://go-review.googlesource.com/c/go/+/707097
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Cherry Mui 2025-09-26 09:56:12 -04:00
parent 4631a2d3c6
commit 459f3a3adc

View file

@ -1452,7 +1452,9 @@ func (ctxt *Link) hostlink() {
argv = append(argv, "-s") argv = append(argv, "-s")
} }
} else if *FlagW { } else if *FlagW {
argv = append(argv, "-Wl,-S") // suppress debugging symbols if !ctxt.IsAIX() { // The AIX linker's -S has different meaning
argv = append(argv, "-Wl,-S") // suppress debugging symbols
}
} }
// On darwin, whether to combine DWARF into executable. // On darwin, whether to combine DWARF into executable.