Skip to content

[SR-648] Add option to create statically linked binaries (take 2) #5394

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 4 commits into from
Nov 30, 2016
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
20 changes: 17 additions & 3 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ function(_add_swift_library_single target name)
cmake_parse_arguments(SWIFTLIB_SINGLE
"${SWIFTLIB_SINGLE_options}"
"MODULE_TARGET;SDK;ARCHITECTURE;INSTALL_IN_COMPONENT;DEPLOYMENT_VERSION_OSX;DEPLOYMENT_VERSION_IOS;DEPLOYMENT_VERSION_TVOS;DEPLOYMENT_VERSION_WATCHOS"
"DEPENDS;LINK_LIBRARIES;FRAMEWORK_DEPENDS;FRAMEWORK_DEPENDS_WEAK;LLVM_COMPONENT_DEPENDS;C_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS;LINK_FLAGS;PRIVATE_LINK_LIBRARIES;INTERFACE_LINK_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES;FILE_DEPENDS"
"DEPENDS;LINK_LIBRARIES;FRAMEWORK_DEPENDS;FRAMEWORK_DEPENDS_WEAK;LLVM_COMPONENT_DEPENDS;C_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS;LINK_FLAGS;PRIVATE_LINK_LIBRARIES;INTERFACE_LINK_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY;FILE_DEPENDS"
${ARGN})

set(SWIFTLIB_SINGLE_SOURCES ${SWIFTLIB_SINGLE_UNPARSED_ARGUMENTS})
Expand Down Expand Up @@ -739,6 +739,12 @@ function(_add_swift_library_single target name)
$<TARGET_OBJECTS:${object_library}${VARIANT_SUFFIX}>)
endforeach()

set(SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS_SHARED_ONLY)
foreach(object_library ${SWIFTLIB_SINGLE_INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY})
list(APPEND SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS_SHARED_ONLY
$<TARGET_OBJECTS:${object_library}${VARIANT_SUFFIX}>)
endforeach()

set(SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES)
if(XCODE AND SWIFTLIB_SINGLE_TARGET_LIBRARY)
set(SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES
Expand All @@ -747,11 +753,17 @@ function(_add_swift_library_single target name)
${SWIFT_SOURCE_DIR}/cmake/dummy.cpp)
endif()

set(INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS ${SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS})
if(${libkind} STREQUAL "SHARED")
list(APPEND INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS
${SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS_SHARED_ONLY})
endif()

add_library("${target}" ${libkind}
${SWIFT_SECTIONS_OBJECT_BEGIN}
${SWIFTLIB_SINGLE_SOURCES}
${SWIFTLIB_SINGLE_EXTERNAL_SOURCES}
${SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS}
${INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS}
${SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES}
${SWIFT_SECTIONS_OBJECT_END})
_set_target_prefix_and_suffix("${target}" "${libkind}" "${SWIFTLIB_SINGLE_SDK}")
Expand Down Expand Up @@ -1270,7 +1282,7 @@ function(add_swift_library name)
cmake_parse_arguments(SWIFTLIB
"${SWIFTLIB_options}"
"INSTALL_IN_COMPONENT;DEPLOYMENT_VERSION_OSX;DEPLOYMENT_VERSION_IOS;DEPLOYMENT_VERSION_TVOS;DEPLOYMENT_VERSION_WATCHOS"
"DEPENDS;LINK_LIBRARIES;SWIFT_MODULE_DEPENDS;SWIFT_MODULE_DEPENDS_OSX;SWIFT_MODULE_DEPENDS_IOS;SWIFT_MODULE_DEPENDS_TVOS;SWIFT_MODULE_DEPENDS_WATCHOS;SWIFT_MODULE_DEPENDS_FREEBSD;SWIFT_MODULE_DEPENDS_LINUX;FRAMEWORK_DEPENDS;FRAMEWORK_DEPENDS_WEAK;FRAMEWORK_DEPENDS_OSX;FRAMEWORK_DEPENDS_IOS_TVOS;LLVM_COMPONENT_DEPENDS;FILE_DEPENDS;TARGET_SDKS;C_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS_OSX;SWIFT_COMPILE_FLAGS_IOS;SWIFT_COMPILE_FLAGS_TVOS;SWIFT_COMPILE_FLAGS_WATCHOS;LINK_FLAGS;PRIVATE_LINK_LIBRARIES;INTERFACE_LINK_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES"
"DEPENDS;LINK_LIBRARIES;SWIFT_MODULE_DEPENDS;SWIFT_MODULE_DEPENDS_OSX;SWIFT_MODULE_DEPENDS_IOS;SWIFT_MODULE_DEPENDS_TVOS;SWIFT_MODULE_DEPENDS_WATCHOS;SWIFT_MODULE_DEPENDS_FREEBSD;SWIFT_MODULE_DEPENDS_LINUX;FRAMEWORK_DEPENDS;FRAMEWORK_DEPENDS_WEAK;FRAMEWORK_DEPENDS_OSX;FRAMEWORK_DEPENDS_IOS_TVOS;LLVM_COMPONENT_DEPENDS;FILE_DEPENDS;TARGET_SDKS;C_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS;SWIFT_COMPILE_FLAGS_OSX;SWIFT_COMPILE_FLAGS_IOS;SWIFT_COMPILE_FLAGS_TVOS;SWIFT_COMPILE_FLAGS_WATCHOS;LINK_FLAGS;PRIVATE_LINK_LIBRARIES;INTERFACE_LINK_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES;INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY"
${ARGN})
set(SWIFTLIB_SOURCES ${SWIFTLIB_UNPARSED_ARGUMENTS})

Expand Down Expand Up @@ -1491,6 +1503,7 @@ function(add_swift_library name)
LINK_FLAGS ${SWIFTLIB_LINK_FLAGS}
PRIVATE_LINK_LIBRARIES ${swiftlib_private_link_libraries_targets}
INCORPORATE_OBJECT_LIBRARIES ${SWIFTLIB_INCORPORATE_OBJECT_LIBRARIES}
INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY ${SWIFTLIB_INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY}
${SWIFTLIB_DONT_EMBED_BITCODE_keyword}
${SWIFTLIB_API_NOTES_NON_OVERLAY_keyword}
${SWIFTLIB_IS_STDLIB_keyword}
Expand Down Expand Up @@ -1682,6 +1695,7 @@ function(add_swift_library name)
PRIVATE_LINK_LIBRARIES ${SWIFTLIB_PRIVATE_LINK_LIBRARIES}
INTERFACE_LINK_LIBRARIES ${SWIFTLIB_INTERFACE_LINK_LIBRARIES}
INCORPORATE_OBJECT_LIBRARIES ${SWIFTLIB_INCORPORATE_OBJECT_LIBRARIES}
INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY ${SWIFTLIB_INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY}
${SWIFTLIB_DONT_EMBED_BITCODE_keyword}
${SWIFTLIB_API_NOTES_NON_OVERLAY_keyword}
${SWIFTLIB_IS_STDLIB_keyword}
Expand Down
6 changes: 6 additions & 0 deletions include/swift/Option/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ def no_static_stdlib: Flag<["-"], "no-static-stdlib">,
Flags<[HelpHidden]>,
HelpText<"Don't statically link the Swift standard library">;

def static_executable : Flag<["-"], "static-executable">,
HelpText<"Statically link the executable">;
def no_static_executable : Flag<["-"], "no-static-executable">,
Flags<[HelpHidden]>,
HelpText<"Don't statically link the executable">;

def use_ld : Joined<["-"], "use-ld=">,
Flags<[DoesNotAffectIncrementalBuild]>,
HelpText<"Specifies the linker to be used">;
Expand Down
30 changes: 30 additions & 0 deletions lib/Driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,33 @@ add_swift_library(swiftDriver STATIC
DEPENDS SwiftOptions
LINK_LIBRARIES swiftAST swiftBasic swiftFrontend swiftOption)

# Generate the static-stdlib-args.lnk file used by -static-stdlib option
# for 'GenericUnix' (eg linux)
if(SWIFT_BUILD_STATIC_STDLIB)
set(static_stdlib_lnk_file_list)
foreach(sdk ${SWIFT_CONFIGURED_SDKS})
if("${SWIFT_SDK_${sdk}_OBJECT_FORMAT}" STREQUAL "ELF")
string(TOLOWER "${sdk}" lowercase_sdk)
if(SWIFT_LINUX_ICU_STATICLIB)
set(ICU_STATICLIB "TRUE")
else()
set(ICU_STATICLIB "FALSE")
endif()
set(linkfile "${lowercase_sdk}/static-stdlib-args.lnk")
add_custom_command_target(swift_static_stdlib_${sdk}_args
COMMAND
"${SWIFT_SOURCE_DIR}/utils/gen-static-stdlib-link-args"
"${sdk}"
"${SWIFTSTATICLIB_DIR}/${linkfile}"
"${ICU_STATICLIB}"
OUTPUT
"${SWIFTSTATICLIB_DIR}/${linkfile}")

list(APPEND static_stdlib_lnk_file_list ${swift_static_stdlib_${sdk}_args})
swift_install_in_component(stdlib
FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
DESTINATION "lib/swift_static/${lowercase_sdk}")
endif()
endforeach()
add_custom_target(swift_static_lnk_args ALL DEPENDS ${static_stdlib_lnk_file_list})
endif()
57 changes: 35 additions & 22 deletions lib/Driver/ToolChains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,12 @@ toolchains::Darwin::constructInvocation(const LinkJobAction &job,
assert(context.Output.getPrimaryOutputType() == types::TY_Image &&
"Invalid linker output type.");

if (context.Args.hasFlag(options::OPT_static_executable,
options::OPT_no_static_executable,
false)) {
llvm::report_fatal_error("-static-executable is not supported on Darwin");
}

const Driver &D = getDriver();
const llvm::Triple &Triple = getTriple();

Expand Down Expand Up @@ -1357,33 +1363,42 @@ toolchains::GenericUnix::constructInvocation(const LinkJobAction &job,

// Link the standard library.
Arguments.push_back("-L");
if (context.Args.hasFlag(options::OPT_static_stdlib,
options::OPT_no_static_stdlib,
false)) {
if (context.Args.hasFlag(options::OPT_static_executable,
options::OPT_no_static_executable,
false)) {
SmallString<128> StaticRuntimeLibPath;
getRuntimeStaticLibraryPath(StaticRuntimeLibPath, context.Args, *this);
Arguments.push_back(context.Args.MakeArgString(StaticRuntimeLibPath));
// The following libraries are required to build a satisfactory
// static program
Arguments.push_back("-ldl");
Arguments.push_back("-lpthread");
Arguments.push_back("-lbsd");
Arguments.push_back("-licui18n");
Arguments.push_back("-licuuc");
// The runtime uses dlopen to look for the protocol conformances.
// Therefore, we need to ensure they appear in the dynamic table.
// This happens automatically for dynamically-linked programs, but
// in this case we have to take additional measures.
Arguments.push_back("-Xlinker");
Arguments.push_back("-export-dynamic");
Arguments.push_back("-Xlinker");
Arguments.push_back("--exclude-libs");
Arguments.push_back("-Xlinker");
Arguments.push_back("ALL");

SmallString<128> linkFilePath = StaticRuntimeLibPath;
llvm::sys::path::append(linkFilePath, "static-executable-args.lnk");
auto linkFile = linkFilePath.str();

if (llvm::sys::fs::is_regular_file(linkFile)) {
Arguments.push_back(context.Args.MakeArgString(Twine("@") + linkFile));
} else {
llvm::report_fatal_error("-static-executable not supported on this platform");
}
}
else if (context.Args.hasFlag(options::OPT_static_stdlib,
options::OPT_no_static_stdlib,
false)) {
SmallString<128> StaticRuntimeLibPath;
getRuntimeStaticLibraryPath(StaticRuntimeLibPath, context.Args, *this);
Arguments.push_back(context.Args.MakeArgString(StaticRuntimeLibPath));

SmallString<128> linkFilePath = StaticRuntimeLibPath;
llvm::sys::path::append(linkFilePath, "static-stdlib-args.lnk");
auto linkFile = linkFilePath.str();
if (llvm::sys::fs::is_regular_file(linkFile)) {
Arguments.push_back(context.Args.MakeArgString(Twine("@") + linkFile));
} else {
llvm::report_fatal_error(linkFile + " not found");
}
}
else {
Arguments.push_back(context.Args.MakeArgString(RuntimeLibPath));
Arguments.push_back("-lswiftCore");
}


Expand All @@ -1404,8 +1419,6 @@ toolchains::GenericUnix::constructInvocation(const LinkJobAction &job,
Twine("-u", llvm::getInstrProfRuntimeHookVarName())));
}

// Always add the stdlib
Arguments.push_back("-lswiftCore");

// Add any autolinking scripts to the arguments
for (const Job *Cmd : context.Inputs) {
Expand Down
17 changes: 14 additions & 3 deletions stdlib/public/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,13 @@ else()
# effort has been completed.
#set(LINK_FLAGS
# -Wl,--whole-archive swiftRuntime -Wl,--no-whole-archive)
find_package(ICU REQUIRED COMPONENTS uc i18n)
list(APPEND swift_core_private_link_libraries
ICU_UC ICU_I18N)
if("${SWIFT_PATH_TO_LIBICU_BUILD}" STREQUAL "")
find_package(ICU REQUIRED COMPONENTS uc i18n)
list(APPEND swift_core_private_link_libraries
ICU_UC ICU_I18N)
else()
list(APPEND swift_core_private_link_libraries -licui18n -licuuc -licudata)
endif()
endif()

if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
Expand Down Expand Up @@ -209,6 +213,12 @@ if(SWIFT_CHECK_ESSENTIAL_STDLIB)
target_link_libraries(swift_stdlib_essential ${RUNTIME_DEPENDENCY})
endif()


set(shared_only_libs)
if(SWIFT_BUILD_STATIC_STDLIB AND "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "LINUX")
list(APPEND shared_only_libs swiftImageInspectionShared)
endif()

add_swift_library(swiftCore ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STDLIB_CORE
${SWIFTLIB_SOURCES}
# The copy_shim_headers target dependency is required to let the
Expand All @@ -224,5 +234,6 @@ add_swift_library(swiftCore ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_STD
LINK_FLAGS ${swift_core_link_flags}
PRIVATE_LINK_LIBRARIES ${swift_core_private_link_libraries}
INCORPORATE_OBJECT_LIBRARIES swiftRuntime swiftStdlibStubs
INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY ${shared_only_libs}
FRAMEWORK_DEPENDS ${swift_core_framework_depends}
INSTALL_IN_COMPONENT stdlib)
44 changes: 44 additions & 0 deletions stdlib/public/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,57 @@ set(LLVM_OPTIONAL_SOURCES
MutexPThread.cpp
MutexWin32.cpp
CygwinPort.cpp
ImageInspectionELF.cpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't ImageInspectionELF.cpp included in the core swift_runtime_sources above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When compiling for Linux it is removed from swift_runtime_sources so that it is not added to libswiftCore.a but instead used in libswiftImageInspectionShared.a
For other ELF targets it remains in swift_runtime_source - this may change as this static option is tested on other ELF targets

ImageInspectionStatic.cpp
${swift_runtime_sources}
${swift_runtime_objc_sources}
${swift_runtime_leaks_sources})

set(swift_runtime_library_compile_flags ${swift_runtime_compile_flags})
list(APPEND swift_runtime_library_compile_flags -DswiftCore_EXPORTS)

set(sdk "${SWIFT_HOST_VARIANT_SDK}")
if(SWIFT_BUILD_STATIC_STDLIB AND "${sdk}" STREQUAL "LINUX")
list(REMOVE_ITEM swift_runtime_sources ImageInspectionELF.cpp)
set(static_binary_lnk_file_list)
string(TOLOWER "${sdk}" lowercase_sdk)

# These two libaries are only used with the static swiftcore
add_library(swiftImageInspectionStatic STATIC ImageInspectionStatic.cpp)
set_target_properties(swiftImageInspectionStatic PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${SWIFTSTATICLIB_DIR}/${lowercase_sdk}")

add_library(swiftImageInspectionShared STATIC ImageInspectionELF.cpp)
set_target_properties(swiftImageInspectionShared PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${SWIFTSTATICLIB_DIR}/${lowercase_sdk}")

swift_install_in_component(stdlib
TARGETS swiftImageInspectionStatic swiftImageInspectionShared
DESTINATION "lib/swift_static/${lowercase_sdk}")

# Generate the static-executable-args.lnk file used for ELF systems (eg linux)
set(linkfile "${lowercase_sdk}/static-executable-args.lnk")
add_custom_command_target(swift_static_binary_${sdk}_args
COMMAND
"${CMAKE_COMMAND}" -E copy
"${SWIFT_SOURCE_DIR}/utils/${lowercase}/static-executable-args.lnk"
"${SWIFTSTATICLIB_DIR}/${linkfile}"
OUTPUT
"${SWIFTSTATICLIB_DIR}/${linkfile}")

list(APPEND static_binary_lnk_file_list ${swift_static_binary_${sdk}_args})
swift_install_in_component(stdlib
FILES "${SWIFTSTATICLIB_DIR}/${linkfile}"
DESTINATION "lib/swift_static/${lowercase_sdk}")
add_custom_target(static_binary_magic ALL DEPENDS ${static_binary_lnk_file_list})

add_swift_library(swiftImageInspectionShared OBJECT_LIBRARY TARGET_LIBRARY
ImageInspectionELF.cpp
C_COMPILE_FLAGS ${swift_runtime_library_compile_flags}
LINK_FLAGS ${swift_runtime_linker_flags}
INSTALL_IN_COMPONENT never_install)
endif()

add_swift_library(swiftRuntime OBJECT_LIBRARY TARGET_LIBRARY
${swift_runtime_sources}
${swift_runtime_objc_sources}
Expand Down
64 changes: 64 additions & 0 deletions stdlib/public/runtime/ImageInspectionStatic.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//===-- ImageInspectionStatic.cpp -------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// Implementation of functions to read data sections from static executable.
//
//===----------------------------------------------------------------------===//

#include "ImageInspection.h"
#include <cstring>

// Currently only tested on linux but should work for any ELF platform
#if defined(__ELF__) && defined(__linux__)

// These are defined in swift_sections.S to mark the start of a section with the
// length of the data followed immediately by the section data
struct alignas(uint64_t) Section;
extern const Section protocolConformancesStart asm(".swift2_protocol_conformances_start");
extern const Section typeMetadataStart asm(".swift2_type_metadata_start");

struct SectionInfo {
uint64_t size;
const char *data;
};

static SectionInfo
getSectionInfo(const Section *section) {
SectionInfo info;
memcpy(&info.size, section, sizeof(uint64_t));
info.data = reinterpret_cast<const char *>(section) + sizeof(uint64_t);
return info;
}

void
swift::initializeProtocolConformanceLookup() {
auto protocolConformances = getSectionInfo(&protocolConformancesStart);
addImageProtocolConformanceBlockCallback(protocolConformances.data,
protocolConformances.size);
}

void
swift::initializeTypeMetadataRecordLookup() {
auto typeMetadata = getSectionInfo(&typeMetadataStart);
addImageTypeMetadataRecordBlockCallback(typeMetadata.data,
typeMetadata.size);
}

// This is called from Errors.cpp when dumping a stack trace entry.
// It could be implemented by parsing the ELF information in the
// executable. For now it returns 0 for error (cant lookup address).
int
swift::lookupSymbol(const void *address, SymbolInfo *info) {
return 0;
}

#endif
6 changes: 6 additions & 0 deletions unittests/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
("${SWIFT_HOST_VARIANT_ARCH}" STREQUAL "${SWIFT_PRIMARY_VARIANT_ARCH}"))

if(SWIFT_BUILD_STATIC_STDLIB AND "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "LINUX")
set(swift_runtime_test_extra_sources
"${CMAKE_CURRENT_SOURCE_DIR}/../../stdlib/public/runtime/ImageInspectionELF.cpp")
endif()

add_subdirectory(LongTests)

set(PLATFORM_SOURCES)
Expand Down Expand Up @@ -36,6 +41,7 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
# from the swiftCore dylib, so we need to link to both the runtime archive
# and the stdlib.
$<TARGET_OBJECTS:swiftRuntime${SWIFT_PRIMARY_VARIANT_SUFFIX}>
${swift_runtime_test_extra_sources}
)

# FIXME: cross-compile for all variants.
Expand Down
1 change: 1 addition & 0 deletions unittests/runtime/LongTests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
# from the swiftCore dylib, so we need to link to both the runtime archive
# and the stdlib.
$<TARGET_OBJECTS:swiftRuntime${SWIFT_PRIMARY_VARIANT_SUFFIX}>
${swift_runtime_test_extra_sources}
)

# FIXME: cross-compile for all variants.
Expand Down
Loading