From 31619c85f31a767cda4347857f2e7cd0de5f428e Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 25 Sep 2025 12:04:10 -0700 Subject: [PATCH] Runtimes: ensure that all symbols are fully resolved on Android This ensures that the libraries are properly linked and that we do not have any unresolved symbols in the runtime (which are not satisfied by its module dependencies). --- Runtimes/Core/CMakeLists.txt | 2 +- Runtimes/Overlay/CMakeLists.txt | 2 +- Runtimes/Supplemental/Differentiation/CMakeLists.txt | 2 +- Runtimes/Supplemental/Distributed/CMakeLists.txt | 2 +- Runtimes/Supplemental/Observation/CMakeLists.txt | 2 +- Runtimes/Supplemental/StringProcessing/CMakeLists.txt | 2 +- Runtimes/Supplemental/Synchronization/CMakeLists.txt | 2 +- Runtimes/Supplemental/Volatile/CMakeLists.txt | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Runtimes/Core/CMakeLists.txt b/Runtimes/Core/CMakeLists.txt index ff1b35cd93e82..8a36576d0a327 100644 --- a/Runtimes/Core/CMakeLists.txt +++ b/Runtimes/Core/CMakeLists.txt @@ -176,7 +176,7 @@ add_compile_options( # a compromise, treat all linker warnings as errors. add_link_options($<$:LINKER:/WX>) # Ensure all symbols are fully resolved on Linux -add_link_options($<$:LINKER:-z,defs>) +add_link_options($<$:LINKER:-z,defs>) add_compile_options( $<$:-explicit-module-build> diff --git a/Runtimes/Overlay/CMakeLists.txt b/Runtimes/Overlay/CMakeLists.txt index 5f60cff85ed9e..0b616369456dc 100644 --- a/Runtimes/Overlay/CMakeLists.txt +++ b/Runtimes/Overlay/CMakeLists.txt @@ -87,7 +87,7 @@ include(ExperimentalFeatures) # a compromise, treat all linker warnings as errors. add_link_options($<$:LINKER:/WX>) # Ensure all symbols are fully resolved on Linux -add_link_options($<$:LINKER:-z,defs>) +add_link_options($<$:LINKER:-z,defs>) include(ExperimentalFeatures) diff --git a/Runtimes/Supplemental/Differentiation/CMakeLists.txt b/Runtimes/Supplemental/Differentiation/CMakeLists.txt index a7491307fc652..6c17b1ea4f653 100644 --- a/Runtimes/Supplemental/Differentiation/CMakeLists.txt +++ b/Runtimes/Supplemental/Differentiation/CMakeLists.txt @@ -89,7 +89,7 @@ add_compile_options( # `_fatalErrorForwardModeDifferentiationDisabled` # add_link_options($<$:LINKER:/WX>) # Ensure all symbols are fully resolved on Linux -add_link_options($<$:LINKER:-z,defs>) +add_link_options($<$:LINKER:-z,defs>) if(SwiftDifferentiation_ENABLE_VECTOR_TYPES) gyb_expand(SIMDDifferentiation.swift.gyb SIMDDifferentiation.swift) diff --git a/Runtimes/Supplemental/Distributed/CMakeLists.txt b/Runtimes/Supplemental/Distributed/CMakeLists.txt index 6bea6fa1cc292..217ad889b7115 100644 --- a/Runtimes/Supplemental/Distributed/CMakeLists.txt +++ b/Runtimes/Supplemental/Distributed/CMakeLists.txt @@ -100,7 +100,7 @@ add_compile_options( # a compromise, treat all linker warnings as errors. add_link_options($<$:LINKER:/WX>) # Ensure all symbols are fully resolved on Linux -add_link_options($<$:LINKER:-z,defs>) +add_link_options($<$:LINKER:-z,defs>) add_library(swiftDistributed DistributedActor.cpp diff --git a/Runtimes/Supplemental/Observation/CMakeLists.txt b/Runtimes/Supplemental/Observation/CMakeLists.txt index 59434af525484..d4cca97b5113e 100644 --- a/Runtimes/Supplemental/Observation/CMakeLists.txt +++ b/Runtimes/Supplemental/Observation/CMakeLists.txt @@ -95,7 +95,7 @@ add_compile_options( # a compromise, treat all linker warnings as errors. add_link_options($<$:LINKER:/WX>) # Ensure all symbols are fully resolved on Linux -add_link_options($<$:LINKER:-z,defs>) +add_link_options($<$:LINKER:-z,defs>) add_library(swiftObservation Sources/Observation/Locking.swift diff --git a/Runtimes/Supplemental/StringProcessing/CMakeLists.txt b/Runtimes/Supplemental/StringProcessing/CMakeLists.txt index 756f170dc0127..1e4565b7986c2 100644 --- a/Runtimes/Supplemental/StringProcessing/CMakeLists.txt +++ b/Runtimes/Supplemental/StringProcessing/CMakeLists.txt @@ -68,7 +68,7 @@ add_compile_options( # a compromise, treat all linker warnings as errors. add_link_options($<$:LINKER:/WX>) # Ensure all symbols are fully resolved on Linux -add_link_options($<$:LINKER:-z,defs>) +add_link_options($<$:LINKER:-z,defs>) add_subdirectory(_RegexParser) add_subdirectory(_StringProcessing) diff --git a/Runtimes/Supplemental/Synchronization/CMakeLists.txt b/Runtimes/Supplemental/Synchronization/CMakeLists.txt index 327ab796a1065..98ad0e23402a6 100644 --- a/Runtimes/Supplemental/Synchronization/CMakeLists.txt +++ b/Runtimes/Supplemental/Synchronization/CMakeLists.txt @@ -104,7 +104,7 @@ add_compile_options( # a compromise, treat all linker warnings as errors. add_link_options($<$:LINKER:/WX>) # Ensure all symbols are fully resolved on Linux -add_link_options($<$:LINKER:-z,defs>) +add_link_options($<$:LINKER:-z,defs>) gyb_expand(Atomics/AtomicIntegers.swift.gyb Atomics/AtomicIntegers.swift) gyb_expand(Atomics/AtomicStorage.swift.gyb Atomics/AtomicStorage.swift) diff --git a/Runtimes/Supplemental/Volatile/CMakeLists.txt b/Runtimes/Supplemental/Volatile/CMakeLists.txt index 30261e1face46..a296f7dda571c 100644 --- a/Runtimes/Supplemental/Volatile/CMakeLists.txt +++ b/Runtimes/Supplemental/Volatile/CMakeLists.txt @@ -79,7 +79,7 @@ add_compile_options( # a compromise, treat all linker warnings as errors. add_link_options($<$:LINKER:/WX>) # Ensure all symbols are fully resolved on Linux -add_link_options($<$:LINKER:-z,defs>) +add_link_options($<$:LINKER:-z,defs>) add_library(swift_Volatile Volatile.swift)