Skip to content

Commit 15345ef

Browse files
[CMake][Darwin] Remove support for building the SDK overlays on Apple platforms
The SDK overlays have been provided in the Apple SDKs for many years, and the interface and implementation has diverged in more recent years such that trying to build the Swift version no longer works. Remove all of the dead code. rdar://151889154
1 parent a91dc9e commit 15345ef

File tree

21 files changed

+38
-948
lines changed

21 files changed

+38
-948
lines changed

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,6 @@ function(swift_benchmark_compile)
716716

717717
if(NOT SWIFT_BENCHMARK_BUILT_STANDALONE)
718718
set(stdlib_dependencies "swift-frontend" "swiftCore-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
719-
if((SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS) AND SWIFT_BUILD_SDK_OVERLAY)
720-
list(APPEND stdlib_dependencies "swiftDarwin-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
721-
endif()
722719
foreach(stdlib_dependency ${UNIVERSAL_LIBRARY_NAMES_${SWIFT_BENCHMARK_COMPILE_PLATFORM}})
723720
string(FIND "${stdlib_dependency}" "Unittest" find_output)
724721
if("${find_output}" STREQUAL "-1")

cmake/modules/DarwinSDKs.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ if(swift_build_freestanding AND (SWIFT_FREESTANDING_FLAVOR STREQUAL "apple"))
3838
configure_target_variant(FREESTANDING-R "FREESTANDING Release" FREESTANDING R "Release")
3939
configure_target_variant(FREESTANDING-S "FREESTANDING MinSizeRelease" FREESTANDING S "MinSizeRelease")
4040

41-
if(SWIFT_BUILD_SDK_OVERLAY)
42-
set(SWIFT_FREESTANDING_TEST_DEPENDENCIES "Darwin")
43-
else()
44-
set(SWIFT_FREESTANDING_TEST_DEPENDENCIES "")
45-
endif()
41+
set(SWIFT_FREESTANDING_TEST_DEPENDENCIES "")
4642
endif()
4743

4844
# Compatible cross-compile SDKS for Darwin OSes: IOS, IOS_SIMULATOR, TVOS,

stdlib/private/OSLog/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
set(swift_oslog_darwin_dependencies "")
2-
if(SWIFT_BUILD_SDK_OVERLAY)
3-
list(APPEND swift_oslog_darwin_dependencies "Darwin")
4-
endif()
52
if (SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY)
63
list(APPEND swift_oslog_darwin_dependencies "_Concurrency")
74
endif()
@@ -12,10 +9,8 @@ if((SWIFT_BUILD_CLANG_OVERLAYS
129
OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
1310
AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT
1411
OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT))
15-
# We need to make this dependency explicit because this library
16-
# imports Darwin and Darwin re-exports _Builtin_float,
17-
# but in most configurations we pull Darwin from the SDK,
18-
# meaning we specify no Darwin dependency in the build system
12+
# This library imports Darwin from the SDK, which re-exports
13+
# _Builtin_float which is part of this build.
1914
list(APPEND swift_oslog_darwin_dependencies _Builtin_float)
2015
endif()
2116

stdlib/private/StdlibUnittest/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
if(SWIFT_BUILD_SDK_OVERLAY)
2-
set(swift_stdlib_unittest_darwin_dependencies Darwin)
3-
else()
41
set(swift_stdlib_unittest_darwin_dependencies)
5-
endif()
62

73
if((SWIFT_BUILD_CLANG_OVERLAYS
84
OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
95
AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT
106
OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT))
11-
# We need to make this dependency explicit because this library
12-
# imports Darwin and Darwin re-exports _Builtin_float,
13-
# but in most configurations we pull Darwin from the SDK,
14-
# meaning we specify no Darwin dependency in the build system
7+
# This library imports Darwin from the SDK, which re-exports
8+
# _Builtin_float which is part of this build.
159
list(APPEND swift_stdlib_unittest_darwin_dependencies _Builtin_float)
1610
endif()
1711

stdlib/private/SwiftPrivate/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@ set(swift_swiftprivate_compile_flags
22
"-parse-stdlib"
33
"-Xfrontend" "-disable-access-control")
44

5-
if(SWIFT_BUILD_SDK_OVERLAY)
6-
set(swift_swiftprivate_darwin_dependencies Darwin)
7-
else()
85
set(swift_swiftprivate_darwin_dependencies)
9-
endif()
106

117
if((SWIFT_BUILD_CLANG_OVERLAYS
128
OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
139
AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT
1410
OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT))
15-
# We need to make this dependency explicit because this library
16-
# imports Darwin and Darwin re-exports _Builtin_float,
17-
# but in most configurations we pull Darwin from the SDK,
18-
# meaning we specify no Darwin dependency in the build system
11+
# This library imports Darwin from the SDK, which re-exports
12+
# _Builtin_float which is part of this build.
1913
list(APPEND swift_swiftprivate_darwin_dependencies _Builtin_float)
2014
endif()
2115

stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,14 @@ else()
1414
set(swift_private_libc_extras_incorporate_object_libraries "swiftCommandLineSupport")
1515
endif()
1616

17-
if(SWIFT_BUILD_SDK_OVERLAY)
18-
set(swift_private_libc_extras_darwin_dependencies Darwin)
19-
else()
2017
set(swift_private_libc_extras_darwin_dependencies)
21-
endif()
2218

2319
if((SWIFT_BUILD_CLANG_OVERLAYS
2420
OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
2521
AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT
2622
OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT))
27-
# We need to make this dependency explicit because this library
28-
# imports Darwin and Darwin re-exports _Builtin_float,
29-
# but in most configurations we pull Darwin from the SDK,
30-
# meaning we specify no Darwin dependency in the build system
23+
# This library imports Darwin from the SDK, which re-exports
24+
# _Builtin_float which is part of this build.
3125
list(APPEND swift_private_libc_extras_darwin_dependencies _Builtin_float)
3226
endif()
3327

stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
if(SWIFT_BUILD_SDK_OVERLAY)
2-
set(swift_private_thread_extras_darwin_dependencies Darwin)
3-
else()
41
set(swift_private_thread_extras_darwin_dependencies)
5-
endif()
62

73
if((SWIFT_BUILD_CLANG_OVERLAYS
84
OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
95
AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT
106
OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT))
11-
# We need to make this dependency explicit because this library
12-
# imports Darwin and Darwin re-exports _Builtin_float,
13-
# but in most configurations we pull Darwin from the SDK,
14-
# meaning we specify no Darwin dependency in the build system
7+
# This library imports Darwin from the SDK, which re-exports
8+
# _Builtin_float which is part of this build.
159
list(APPEND swift_private_thread_extras_darwin_dependencies _Builtin_float)
1610
endif()
1711

stdlib/private/SwiftReflectionTest/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
if(SWIFT_BUILD_SDK_OVERLAY)
2-
set(swift_reflection_test_darwin_dependencies Darwin)
3-
else()
41
set(swift_reflection_test_darwin_dependencies)
5-
endif()
62

73
if((SWIFT_BUILD_CLANG_OVERLAYS
84
OR SWIFT_BUILD_TEST_SUPPORT_MODULES)
95
AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT
106
OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT))
11-
# We need to make this dependency explicit because this library
12-
# imports Darwin and Darwin re-exports _Builtin_float,
13-
# but in most configurations we pull Darwin from the SDK,
14-
# meaning we specify no Darwin dependency in the build system
7+
# This library imports Darwin from the SDK, which re-exports
8+
# _Builtin_float which is part of this build.
159
list(APPEND swift_reflection_test_darwin_dependencies _Builtin_float)
1610
endif()
1711

stdlib/public/Cxx/std/CMakeLists.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,6 @@ add_dependencies(sdk-overlay CxxStdlib-apinotes)
1919
add_dependencies(compiler CxxStdlib-apinotes)
2020

2121

22-
# Swift compiler currently assumes that the Darwin overlay is a dependency of
23-
# CxxStdlib, and fails to build CxxStdlib if Darwin.swiftmodule in build dir
24-
# is built with a different (older) version of the compiler. To workaround this,
25-
# declare the Darwin overlay as a dependency of CxxStdlib.
26-
set(swift_cxxstdlib_darwin_dependencies)
27-
if(SWIFT_BUILD_STDLIB AND SWIFT_BUILD_SDK_OVERLAY)
28-
set(swift_cxxstdlib_darwin_dependencies Darwin)
29-
endif()
30-
3122
set(swift_cxxstdlib_dependencies)
3223
if(NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)
3324
set(swift_cxxstdlib_dependencies _Builtin_float)
@@ -44,12 +35,6 @@ add_swift_target_library(swiftCxxStdlib STATIC NO_LINK_NAME IS_STDLIB IS_SWIFT_O
4435
String.swift
4536

4637
SWIFT_MODULE_DEPENDS Cxx ${swift_cxxstdlib_dependencies}
47-
SWIFT_MODULE_DEPENDS_IOS ${swift_cxxstdlib_darwin_dependencies}
48-
SWIFT_MODULE_DEPENDS_OSX ${swift_cxxstdlib_darwin_dependencies}
49-
SWIFT_MODULE_DEPENDS_TVOS ${swift_cxxstdlib_darwin_dependencies}
50-
SWIFT_MODULE_DEPENDS_WATCHOS ${swift_cxxstdlib_darwin_dependencies}
51-
SWIFT_MODULE_DEPENDS_XROS ${swift_cxxstdlib_darwin_dependencies}
52-
SWIFT_MODULE_DEPENDS_MACCATALYST ${swift_cxxstdlib_darwin_dependencies}
5338
SWIFT_MODULE_DEPENDS_ANDROID Android
5439

5540
SWIFT_COMPILE_FLAGS ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}

stdlib/public/Differentiation/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ else()
1616
set(swiftDifferentiationSIMDFiles)
1717
endif()
1818

19-
if(SWIFT_BUILD_SDK_OVERLAY)
20-
set(swiftDifferentiationDarwinDependencies Darwin)
21-
else()
22-
set(swiftDifferentiationDarwinDependencies)
23-
endif()
24-
2519
add_swift_target_library(swift_Differentiation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
2620
Differentiable.swift
2721
DifferentialOperators.swift
@@ -37,11 +31,6 @@ add_swift_target_library(swift_Differentiation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPE
3731
TgmathDerivatives.swift.gyb
3832
${swiftDifferentiationSIMDFiles}
3933

40-
SWIFT_MODULE_DEPENDS_OSX ${swiftDifferentiationDarwinDependencies}
41-
SWIFT_MODULE_DEPENDS_IOS ${swiftDifferentiationDarwinDependencies}
42-
SWIFT_MODULE_DEPENDS_TVOS ${swiftDifferentiationDarwinDependencies}
43-
SWIFT_MODULE_DEPENDS_WATCHOS ${swiftDifferentiationDarwinDependencies}
44-
SWIFT_MODULE_DEPENDS_XROS ${swiftDifferentiationDarwinDependencies}
4534
SWIFT_MODULE_DEPENDS_ANDROID Android
4635
SWIFT_MODULE_DEPENDS_LINUX Glibc
4736
SWIFT_MODULE_DEPENDS_LINUX_STATIC Musl

0 commit comments

Comments
 (0)