]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: don't pass -Wl,-S on AIX
authorCherry Mui <cherryyz@google.com>
Fri, 26 Sep 2025 13:56:12 +0000 (09:56 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 26 Sep 2025 17:15:40 +0000 (10:15 -0700)
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>
src/cmd/link/internal/ld/lib.go

index 623acc1ad4899799d41218e8a7fa556704d6441d..8d2763bb57f31ad599ced895a9c12f11c0483c3a 100644 (file)
@@ -1452,7 +1452,9 @@ func (ctxt *Link) hostlink() {
                        argv = append(argv, "-s")
                }
        } 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.