Skip to content

Commit d080e2f

Browse files
committed
Move the longsections argument to build.ps1
1 parent b1ed0b0 commit d080e2f

File tree

9 files changed

+18
-8
lines changed

9 files changed

+18
-8
lines changed

Runtimes/Core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ add_compile_options(
181181
# We cannot selectively filter the linker warnings as we do not use the MSVC
182182
# frontned and `clang-cl` (and `clang`) currently do not support `/WX:nnnn`. As
183183
# a compromise, treat all linker warnings as errors.
184-
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX,/IGNORE:longsections>)
184+
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
185185

186186
add_compile_options(
187187
$<$<COMPILE_LANGUAGE:Swift>:-explicit-module-build>

Runtimes/Overlay/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ include(ExperimentalFeatures)
9393
# We cannot selectively filter the linker warnings as we do not use the MSVC
9494
# frontned and `clang-cl` (and `clang`) currently do not support `/WX:nnnn`. As
9595
# a compromise, treat all linker warnings as errors.
96-
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX,/IGNORE:longsections>)
96+
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
9797

9898
include(ExperimentalFeatures)
9999

Runtimes/Supplemental/Differentiation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ add_compile_options(
8787
# a compromise, treat all linker warnings as errors.
8888
# FIXME(#83444) - enable this once we fix DLL storage for
8989
# `_fatalErrorForwardModeDifferentiationDisabled`
90-
# add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX,/IGNORE:longsections>)
90+
# add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
9191

9292
if(SwiftDifferentiation_ENABLE_VECTOR_TYPES)
9393
gyb_expand(SIMDDifferentiation.swift.gyb SIMDDifferentiation.swift)

Runtimes/Supplemental/Distributed/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ add_compile_options(
9797
# We cannot selectively filter the linker warnings as we do not use the MSVC
9898
# frontned and `clang-cl` (and `clang`) currently do not support `/WX:nnnn`. As
9999
# a compromise, treat all linker warnings as errors.
100-
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX,/IGNORE:longsections>)
100+
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
101101

102102
add_library(swiftDistributed
103103
DistributedActor.cpp

Runtimes/Supplemental/Observation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ add_compile_options(
8282
# We cannot selectively filter the linker warnings as we do not use the MSVC
8383
# frontned and `clang-cl` (and `clang`) currently do not support `/WX:nnnn`. As
8484
# a compromise, treat all linker warnings as errors.
85-
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX,/IGNORE:longsections>)
85+
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
8686

8787
add_library(swiftObservation
8888
Sources/Observation/Locking.swift

Runtimes/Supplemental/StringProcessing/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ add_compile_options(
6464
# We cannot selectively filter the linker warnings as we do not use the MSVC
6565
# frontned and `clang-cl` (and `clang`) currently do not support `/WX:nnnn`. As
6666
# a compromise, treat all linker warnings as errors.
67-
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX,/IGNORE:longsections>)
67+
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
6868

6969
add_subdirectory(_RegexParser)
7070
add_subdirectory(_StringProcessing)

Runtimes/Supplemental/Synchronization/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ add_compile_options(
100100
# We cannot selectively filter the linker warnings as we do not use the MSVC
101101
# frontned and `clang-cl` (and `clang`) currently do not support `/WX:nnnn`. As
102102
# a compromise, treat all linker warnings as errors.
103-
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX,/IGNORE:longsections>)
103+
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
104104

105105
gyb_expand(Atomics/AtomicIntegers.swift.gyb Atomics/AtomicIntegers.swift)
106106
gyb_expand(Atomics/AtomicStorage.swift.gyb Atomics/AtomicStorage.swift)

Runtimes/Supplemental/Volatile/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ add_compile_options(
7676
# We cannot selectively filter the linker warnings as we do not use the MSVC
7777
# frontend and `clang-cl` (and `clang`) currently do not support `/WX:nnnn`. As
7878
# a compromise, treat all linker warnings as errors.
79-
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX,/IGNORE:longsections>)
79+
add_link_options($<$<PLATFORM_ID:Windows>:LINKER:/WX>)
8080

8181
add_library(swift_Volatile
8282
Volatile.swift)

utils/build.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,6 +1608,16 @@ function Build-CMakeProject {
16081608
} else {
16091609
@("/DEBUG")
16101610
}
1611+
1612+
# The linker flags are shared across every language, and `/IGNORE:longsections` is an
1613+
# `lld-link.exe` argument, not `link.exe`, so this can only be enabled with the GNU
1614+
# driver, which guarantees we are using `lld-link.exe`.
1615+
# TODO: Investigate supporting fission with PE/COFF, this should avoid this warning.
1616+
if ($SwiftDebugFormat -eq "dwarf") {
1617+
if ($UseGNUDriver) {
1618+
$LinkerFlags += @("-Xlinker", "/IGNORE:longsections")
1619+
}
1620+
}
16111621
}
16121622
}
16131623

0 commit comments

Comments
 (0)