From ba5ccc45167841e03de401ea5022880133df659c Mon Sep 17 00:00:00 2001 From: Eric Miotto <1094986+edymtt@users.noreply.github.com> Date: Fri, 7 Feb 2025 08:12:51 -0800 Subject: [PATCH 1/3] Runtimes: generate optimization record on Darwin Addresses rdar://143152066 --- Runtimes/Core/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Runtimes/Core/CMakeLists.txt b/Runtimes/Core/CMakeLists.txt index 54c25b0bbb5aa..541529305539d 100644 --- a/Runtimes/Core/CMakeLists.txt +++ b/Runtimes/Core/CMakeLists.txt @@ -171,6 +171,9 @@ add_compile_options( "$<$:SHELL:-enable-experimental-feature Extern>" "$<$:SHELL:-enable-experimental-feature ValueGenerics>" "$<$:SHELL:-enable-experimental-feature AddressableParameters>" + # TODO: we should reevaluate if it still makes sense to restrict this + # to Darwin, https://github.com/swiftlang/swift/issues/79279 + "$<$,$>:-save-optimization-record=bitstream>" "$<$:SHELL:-Xfrontend -enable-experimental-concise-pound-file>" "$<$:SHELL:-Xfrontend -enable-lexical-lifetimes=false>" "$<$:SHELL:-Xfrontend -disable-implicit-concurrency-module-import>" From 7924cc1a77a5e877c81ceaffa66eb2ebc643113b Mon Sep 17 00:00:00 2001 From: Eric Miotto <1094986+edymtt@users.noreply.github.com> Date: Fri, 7 Feb 2025 08:55:31 -0800 Subject: [PATCH 2/3] Runtimes: use `-enable-experimental-concise-pound-file` only for Core. As per #32700, this is only meant for `Swift.swiftinterface`. Addresses rdar://143152066 --- Runtimes/Core/CMakeLists.txt | 1 - Runtimes/Core/core/CMakeLists.txt | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Runtimes/Core/CMakeLists.txt b/Runtimes/Core/CMakeLists.txt index 541529305539d..f514fa58c8c3c 100644 --- a/Runtimes/Core/CMakeLists.txt +++ b/Runtimes/Core/CMakeLists.txt @@ -174,7 +174,6 @@ add_compile_options( # TODO: we should reevaluate if it still makes sense to restrict this # to Darwin, https://github.com/swiftlang/swift/issues/79279 "$<$,$>:-save-optimization-record=bitstream>" - "$<$:SHELL:-Xfrontend -enable-experimental-concise-pound-file>" "$<$:SHELL:-Xfrontend -enable-lexical-lifetimes=false>" "$<$:SHELL:-Xfrontend -disable-implicit-concurrency-module-import>" "$<$:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>" diff --git a/Runtimes/Core/core/CMakeLists.txt b/Runtimes/Core/core/CMakeLists.txt index 23f9741d2f887..e08c45b855eaa 100644 --- a/Runtimes/Core/core/CMakeLists.txt +++ b/Runtimes/Core/core/CMakeLists.txt @@ -274,6 +274,9 @@ if(APPLE AND BUILD_SHARED_LIBS) endif() target_compile_options(swiftCore PRIVATE + # STAGING: Temporarily avoids having to write #fileID in Swift.swiftinterface. + # see also 327ea8bce2d1107a847d444651b19ca6a2901c9e + "$<$:SHELL:-Xfrontend -enable-experimental-concise-pound-file>" $<$:-parse-stdlib> $<$:-nostdimport> $<$:-explicit-module-build> From 66d466580141ab68578a62824c3d2e48eb28522b Mon Sep 17 00:00:00 2001 From: Eric Miotto <1094986+edymtt@users.noreply.github.com> Date: Fri, 7 Feb 2025 09:12:31 -0800 Subject: [PATCH 3/3] Runtimes: hoist more flags from swiftCore to all Core libraries Addresses rdar://143152066 --- Runtimes/Core/CMakeLists.txt | 4 ++++ Runtimes/Core/core/CMakeLists.txt | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Runtimes/Core/CMakeLists.txt b/Runtimes/Core/CMakeLists.txt index f514fa58c8c3c..23c46afbf4a4d 100644 --- a/Runtimes/Core/CMakeLists.txt +++ b/Runtimes/Core/CMakeLists.txt @@ -157,6 +157,8 @@ add_link_options($<$:LINKER:/WX>) add_compile_options( "$<$:SHELL:-library-level api>" "$<$:SHELL:-runtime-compatibility-version none>" + "$<$:-disable-autolinking-runtime-compatibility-dynamic-replacements>" + "$<$:SHELL:-Xfrontend -disable-autolinking-runtime-compatibility-concurrency>" "$<$:SHELL:-enable-experimental-feature NoncopyableGenerics2>" "$<$:SHELL:-enable-experimental-feature SuppressedAssociatedTypes>" "$<$:SHELL:-enable-experimental-feature SE427NoInferenceOnExtension>" @@ -174,9 +176,11 @@ add_compile_options( # TODO: we should reevaluate if it still makes sense to restrict this # to Darwin, https://github.com/swiftlang/swift/issues/79279 "$<$,$>:-save-optimization-record=bitstream>" + "$<$:-warn-implicit-overrides>" "$<$:SHELL:-Xfrontend -enable-lexical-lifetimes=false>" "$<$:SHELL:-Xfrontend -disable-implicit-concurrency-module-import>" "$<$:SHELL:-Xfrontend -disable-implicit-string-processing-module-import>" + "$<$:-no-link-objc-runtime>" "$<$:SHELL:-Xfrontend -enforce-exclusivity=unchecked>" "$<$:SHELL:-Xfrontend -enable-ossa-modules>" "$<$:SHELL:-Xfrontend -empty-abi-descriptor>" diff --git a/Runtimes/Core/core/CMakeLists.txt b/Runtimes/Core/core/CMakeLists.txt index e08c45b855eaa..5b09bfa435e6f 100644 --- a/Runtimes/Core/core/CMakeLists.txt +++ b/Runtimes/Core/core/CMakeLists.txt @@ -280,11 +280,7 @@ target_compile_options(swiftCore PRIVATE $<$:-parse-stdlib> $<$:-nostdimport> $<$:-explicit-module-build> - $<$:-disable-autolinking-runtime-compatibility-dynamic-replacements> - $<$:-no-link-objc-runtime> - $<$:-warn-implicit-overrides> "$<$:SHELL:-Xfrontend -group-info-path -Xfrontend ${CMAKE_CURRENT_SOURCE_DIR}/GroupInfo.json>" - "$<$:SHELL:-Xfrontend -disable-autolinking-runtime-compatibility-concurrency>" "$<$:SHELL:-Xfrontend -disable-objc-attr-requires-foundation-module>" "$<$:SHELL:-Xfrontend -require-explicit-availability=ignore>" "$<$:SHELL:-Xfrontend -prespecialize-generic-metadata>")