Skip to content

Commit 322a585

Browse files
authored
Merge pull request #20994 from compnerd/calling-extension-o
Driver: correct the registrar extension
2 parents bcc4ba9 + c931d95 commit 322a585

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/Driver/WindowsToolChains.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ toolchains::Windows::constructInvocation(const LinkJobAction &job,
122122
SmallString<128> swiftrtPath = SharedRuntimeLibPath;
123123
llvm::sys::path::append(swiftrtPath,
124124
swift::getMajorArchitectureName(getTriple()));
125-
llvm::sys::path::append(swiftrtPath, "swiftrt.o");
125+
llvm::sys::path::append(swiftrtPath, "swiftrt.obj");
126126
Arguments.push_back(context.Args.MakeArgString(swiftrtPath));
127127

128128
addPrimaryInputsOfType(Arguments, context.Inputs, context.Args,

stdlib/public/runtime/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,15 @@ foreach(sdk ${SWIFT_CONFIGURED_SDKS})
216216
# to a version which supports it.
217217
# set(swiftrtObject "$<TARGET_OBJECTS:swiftImageRegistrationObject${SWIFT_SDK_${sdk}_OBJECT_FORMAT}-${arch_suffix}>")
218218
set(swiftrtObject ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/swiftImageRegistrationObject${SWIFT_SDK_${sdk}_OBJECT_FORMAT}-${arch_suffix}.dir/SwiftRT-${SWIFT_SDK_${sdk}_OBJECT_FORMAT}.cpp${CMAKE_C_OUTPUT_EXTENSION})
219-
set(shared_runtime_registrar "${SWIFTLIB_DIR}/${arch_subdir}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}")
220-
set(static_runtime_registrar "${SWIFTSTATICLIB_DIR}/${arch_subdir}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}")
219+
220+
if(sdk STREQUAL WINDOWS)
221+
set(extension .obj)
222+
else()
223+
set(extension .o)
224+
endif()
225+
226+
set(shared_runtime_registrar "${SWIFTLIB_DIR}/${arch_subdir}/swiftrt${extension}")
227+
set(static_runtime_registrar "${SWIFTSTATICLIB_DIR}/${arch_subdir}/swiftrt${extension}")
221228

222229
add_custom_command_target(swiftImageRegistration-${arch_suffix}
223230
COMMAND

0 commit comments

Comments
 (0)