Skip to content

Commit 047c2ab

Browse files
committed
cmd/link: don't pass -Wl,-S on Solaris
Solaris linker's -S has a different meaning. Fixes golang#75637. Change-Id: I51e641d5bc6d7f64ab5aa280090c70ec787a1fbf Reviewed-on: https://go-review.googlesource.com/c/go/+/707096 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent ae8eba0 commit 047c2ab

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cmd/link/dwarf_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ func TestFlagW(t *testing.T) {
386386
{"-s", false}, // -s implies -w
387387
{"-s -w=0", true}, // -w=0 negates the implied -w
388388
}
389-
if testenv.HasCGO() {
389+
if testenv.HasCGO() && runtime.GOOS != "solaris" { // Solaris linker doesn't support the -S flag
390390
tests = append(tests,
391391
testCase{"-w -linkmode=external", false},
392392
testCase{"-s -linkmode=external", false},

src/cmd/link/internal/ld/lib.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ func (ctxt *Link) hostlink() {
14521452
argv = append(argv, "-s")
14531453
}
14541454
} else if *FlagW {
1455-
if !ctxt.IsAIX() { // The AIX linker's -S has different meaning
1455+
if !ctxt.IsAIX() && !ctxt.IsSolaris() { // The AIX and Solaris linkers' -S has different meaning
14561456
argv = append(argv, "-Wl,-S") // suppress debugging symbols
14571457
}
14581458
}

0 commit comments

Comments
 (0)