From 7ed975aac2f040f6f884cf62a2f55615ab374053 Mon Sep 17 00:00:00 2001 From: Evan Wilde Date: Wed, 26 Feb 2025 10:32:07 -0800 Subject: [PATCH] CMake: Fix swiftrt.o install location The driver just changed where it looks for swiftrt.o when performing a static-stdlib build from always looking under `/usr/lib/swift` to `/usr/lib/swift_static`. This change of behavior comes from: 7156812d251d0f4dd6e7c605940f7e5497eaa795 --- Runtimes/Core/runtime/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Runtimes/Core/runtime/CMakeLists.txt b/Runtimes/Core/runtime/CMakeLists.txt index 05d6b1d48c8ac..6308f68a0d409 100644 --- a/Runtimes/Core/runtime/CMakeLists.txt +++ b/Runtimes/Core/runtime/CMakeLists.txt @@ -159,11 +159,13 @@ if("${SwiftCore_OBJECT_FORMAT}" STREQUAL "elfx") "${SwiftCore_SWIFTC_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") target_link_libraries(swiftrt PRIVATE swiftShims) - # The driver requires that swifrt.o is under `usr/lib/swift//` - # Regardless of settings + # The driver requires that swiftrt.o is under + # `usr/lib/(swift|swift_static)//` regardless of whether the + # other files are under the platform and architecture subdirectories: + # https://github.com/swiftlang/swift-driver/blob/f66e33575150cc778289b5f573218c7a0c70bab6/Sources/SwiftDriver/Jobs/GenericUnixToolchain%2BLinkerSupport.swift#L186 install(FILES $ COMPONENT SwiftCore_runtime - DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/swift$:_static>/${SwiftCore_PLATFORM_SUBDIR}/${SwiftCore_ARCH_SUBDIR}" RENAME swiftrt.o) elseif("${SwiftCore_OBJECT_FORMAT}" STREQUAL "coffx") add_library(swiftrtT OBJECT SwiftRT-COFF.cpp)