Skip to content

Commit 796d127

Browse files
committed
[Build] Disable library evolution in the Static SDK for Linux.
We don't want library evolution turned on for the Static SDK. We can't do this in the `StdlibOptions.cmake` file because that's testing the *host*, not the *target* (the code in there is wrong). rdar://160455139
1 parent 876fd51 commit 796d127

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ function(_add_target_variant_c_compile_flags)
390390
list(APPEND result "-DSWIFT_COMPACT_ABSOLUTE_FUNCTION_POINTER=1")
391391
endif()
392392

393-
if(SWIFT_STDLIB_STABLE_ABI)
393+
if(SWIFT_STDLIB_STABLE_ABI AND NOT "${CFLAGS_SDK}" STREQUAL "LINUX_STATIC")
394394
list(APPEND result "-DSWIFT_LIBRARY_EVOLUTION=1")
395395
else()
396396
list(APPEND result "-DSWIFT_LIBRARY_EVOLUTION=0")

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,9 @@ function(_compile_swift_files
549549
endif()
550550

551551
# The standard library and overlays are built resiliently when SWIFT_STDLIB_STABLE_ABI=On.
552-
if(SWIFTFILE_IS_STDLIB AND NOT SWIFTFILE_IS_FRAGILE AND SWIFT_STDLIB_STABLE_ABI)
552+
if(SWIFTFILE_IS_STDLIB AND NOT SWIFTFILE_IS_FRAGILE
553+
AND SWIFT_STDLIB_STABLE_ABI
554+
AND NOT "${SWIFTFILE_SDK}" STREQUAL "LINUX_STATIC")
553555
list(APPEND swift_flags "-enable-library-evolution")
554556
list(APPEND swift_flags "-library-level" "api")
555557
list(APPEND swift_flags "-Xfrontend" "-require-explicit-availability=ignore")
@@ -721,7 +723,9 @@ function(_compile_swift_files
721723
set(sibopt_file "${module_base}.O.sib")
722724
set(sibgen_file "${module_base}.sibgen")
723725

724-
if(SWIFT_ENABLE_MODULE_INTERFACES AND NOT SWIFTFILE_IS_FRAGILE)
726+
if(SWIFT_ENABLE_MODULE_INTERFACES
727+
AND NOT SWIFTFILE_IS_FRAGILE
728+
AND NOT "${SWIFTFILE_SDK}" STREQUAL "LINUX_STATIC")
725729
set(interface_file "${module_base}.swiftinterface")
726730
set(interface_file_static "${module_base_static}.swiftinterface")
727731
set(private_interface_file "${module_base}.private.swiftinterface")

0 commit comments

Comments
 (0)