Skip to content

Runtimes: properly link in swiftrtT?.obj on Windows #80101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Runtimes/Core/Concurrency/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ target_link_libraries(swift_Concurrency PRIVATE
$<$<PLATFORM_ID:Windows>:Synchronization>
$<$<PLATFORM_ID:Windows>:mincore>
# Link to the runtime that we are just building.
swiftCore
$<$<NOT:$<PLATFORM_ID:Darwin>>:swiftrt>)
target_link_options(swift_Concurrency PRIVATE
-nostartfiles)
swiftCore)
set_target_properties(swift_Concurrency PROPERTIES
Swift_MODULE_NAME _Concurrency)

Expand Down
12 changes: 10 additions & 2 deletions Runtimes/Core/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,16 @@ target_link_libraries(swiftCore
$<$<NOT:$<PLATFORM_ID:Darwin>>:swiftrt$<$<PLATFORM_ID:Windows>:T>>
PUBLIC
swiftShims)
target_link_options(swiftCore PRIVATE
-nostartfiles)
target_link_options(swiftCore PUBLIC
$<$<LINK_LANGUAGE:Swift>:-nostartfiles>)
string(TOLOWER "${SwiftCore_OBJECT_FORMAT}" SwiftCore_OBJECT_FORMAT_lc)
if("${SwiftCore_OBJECT_FORMAT_lc}" STREQUAL "elf")
target_link_libraries(swiftCore INTERFACE
swiftrt$<$<BOOL:NO>:>)
elseif("${SwiftCore_OBJECT_FORMAT_lc}" STREQUAL "coff")
target_link_libraries(swiftCore INTERFACE
swiftrt$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:T>)
endif()
if(NOT POLICY CMP0157)
target_compile_options(swiftCore PRIVATE
$<TARGET_OBJECTS:swiftRuntime>
Expand Down
1 change: 1 addition & 0 deletions Runtimes/Core/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ elseif("${SwiftCore_OBJECT_FORMAT}" STREQUAL "coffx")
SWIFT_STATIC_STDLIB)
target_link_libraries(swiftrtT PRIVATE swiftShims)
install(FILES $<TARGET_OBJECTS:swiftrtT>
COMPONENT SwiftCore_runtime
DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}"
RENAME swiftrtT.obj)

Expand Down