Skip to content
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
4 changes: 4 additions & 0 deletions stdlib/cmake/modules/StdlibOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ option(SWIFT_STDLIB_PASSTHROUGH_METADATA_ALLOCATOR
"Build stdlib without a custom implementation of MetadataAllocator, relying on malloc+free instead."
FALSE)

option(SWIFT_STDLIB_DISABLE_INSTANTIATION_CACHES
"Build stdlib with -disable-preallocated-instantiation-caches"
FALSE)

option(SWIFT_STDLIB_HAS_COMMANDLINE
"Build stdlib with the CommandLine enum and support for argv/argc."
TRUE)
Expand Down
4 changes: 4 additions & 0 deletions stdlib/cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,10 @@ function(_compile_swift_files
list(APPEND swift_flags "-experimental-hermetic-seal-at-link")
endif()

if(SWIFT_STDLIB_DISABLE_INSTANTIATION_CACHES)
list(APPEND swift_flags "-Xfrontend -disable-preallocated-instantiation-caches")
endif()

list(APPEND swift_flags ${SWIFT_STDLIB_EXTRA_SWIFT_COMPILE_FLAGS})

list(APPEND swift_flags ${SWIFT_EXPERIMENTAL_EXTRA_FLAGS})
Expand Down
3 changes: 3 additions & 0 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,9 @@ if run_vendor == 'apple':
if not config.swift_freestanding_is_darwin:
swift_execution_tests_extra_flags += ' -experimental-hermetic-seal-at-link -lto=llvm-full'

if not config.swift_freestanding_is_darwin:
swift_execution_tests_extra_flags += ' -Xfrontend -disable-preallocated-instantiation-caches'

# Build a resource dir for freestanding tests.
new_resource_dir = os.path.join(config.test_exec_root, "resource_dir")
if not os.path.exists(new_resource_dir): os.mkdir(new_resource_dir)
Expand Down
1 change: 1 addition & 0 deletions utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2527,6 +2527,7 @@ swift-stdlib-enable-prespecialization=0
swift-stdlib-passthrough-metadata-allocator=1
swift-stdlib-short-mangling-lookups=0
swift-stdlib-experimental-hermetic-seal-at-link=1
swift-stdlib-disable-instantiation-caches=1
swift-stdlib-has-type-printing=0

[preset: stdlib_S_standalone_minimal_macho_x86_64,build]
Expand Down
2 changes: 2 additions & 0 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ KNOWN_SETTINGS=(
swift-stdlib-passthrough-metadata-allocator "0" "whether stdlib should be built without a custom implementation of MetadataAllocator, relying on malloc+free instead"
swift-stdlib-short-mangling-lookups "1" "whether to build stdlib with fast-path context descriptor lookups based on well-known short manglings"
swift-stdlib-experimental-hermetic-seal-at-link "0" "whether stdlib should be built with -experimental-hermetic-seal-at-link"
swift-stdlib-disable-instantiation-caches "0" "whether to build stdlib with -disable-preallocated-instantiation-caches"
swift-stdlib-has-type-printing "1" "whether stdlib should support printing user-friendly type name as strings at runtime"
swift-disable-dead-stripping "0" "turns off Darwin-specific dead stripping for Swift host tools"
common-swift-flags "" "Flags used for Swift targets other than the stdlib, like the corelibs"
Expand Down Expand Up @@ -2010,6 +2011,7 @@ for host in "${ALL_HOSTS[@]}"; do
-DSWIFT_STDLIB_SHORT_MANGLING_LOOKUPS:BOOL=$(true_false "${SWIFT_STDLIB_SHORT_MANGLING_LOOKUPS}")
-DSWIFT_STDLIB_HAS_TYPE_PRINTING:BOOL=$(true_false "${SWIFT_STDLIB_HAS_TYPE_PRINTING}")
-DSWIFT_STDLIB_EXPERIMENTAL_HERMETIC_SEAL_AT_LINK:BOOL=$(true_false "${SWIFT_STDLIB_EXPERIMENTAL_HERMETIC_SEAL_AT_LINK}")
-DSWIFT_STDLIB_DISABLE_INSTANTIATION_CACHES:BOOL=$(true_false "${SWIFT_STDLIB_DISABLE_INSTANTIATION_CACHES}")
-DSWIFT_NATIVE_LLVM_TOOLS_PATH:STRING="${native_llvm_tools_path}"
-DSWIFT_NATIVE_CLANG_TOOLS_PATH:STRING="${native_clang_tools_path}"
-DSWIFT_NATIVE_SWIFT_TOOLS_PATH:STRING="${native_swift_tools_path}"
Expand Down