Skip to content

Commit 0b3df25

Browse files
authored
Merge pull request swiftlang#83881 from Steelskin/fabrice/ignore-linker-warning-long-sections
Runtime: Ignore long section names linker warnings
2 parents 8cea77e + 854a250 commit 0b3df25

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

utils/build.ps1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,18 @@ function Build-CMakeProject {
16181618
} else {
16191619
@("/DEBUG")
16201620
}
1621+
1622+
# The linker flags are shared across every language, and `/IGNORE:longsections` is an
1623+
# `lld-link.exe` argument, not `link.exe`, so this can only be enabled when we use
1624+
# `lld-link.exe` for linking.
1625+
# TODO: Investigate supporting fission with PE/COFF, this should avoid this warning.
1626+
if ($SwiftDebugFormat -eq "dwarf") {
1627+
if ($UseGNUDriver) {
1628+
$LinkerFlags += @("-Xlinker", "/IGNORE:longsections")
1629+
} elseif (-not $UseMSVCCompilers.Contains("C") -and -not $UseMSVCCompilers.Contains("CXX")) {
1630+
$LinkerFlags += @("/IGNORE:longsections")
1631+
}
1632+
}
16211633
}
16221634
}
16231635

0 commit comments

Comments
 (0)