From 01fdb2818e25f73f12320385d43f97f658d3d6ee Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Tue, 9 Oct 2018 16:20:28 -0700 Subject: [PATCH] [CMake] Make sure to link swiftrt.o when building the Swift Dispatch overlay. Because we are linking libdispatch through clang rather than swift, we need to explicitly add swiftrt.o, which is needed by ELF and COFF to register metadata sections. Fixes rdar://problem/44941707. --- src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 80bbd54b1..9782fed83 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -115,7 +115,8 @@ if(ENABLE_SWIFT) target_sources(dispatch PRIVATE swift/DispatchStubs.cc - ${CMAKE_CURRENT_BINARY_DIR}/swiftDispatch.o) + ${CMAKE_CURRENT_BINARY_DIR}/swiftDispatch.o + ${SWIFT_RUNTIME_LIBDIR}/swiftrt.o) if(CMAKE_BUILD_TYPE MATCHES Debug) target_link_libraries(dispatch PRIVATE