Skip to content

Relative protocol witness tables test configuration #63350

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
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
1 change: 1 addition & 0 deletions stdlib/cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ function(_compile_swift_files

if (SWIFT_STDLIB_USE_RELATIVE_PROTOCOL_WITNESS_TABLES)
list(APPEND swift_flags "-Xfrontend" "-enable-relative-protocol-witness-tables")
list(APPEND swift_flags "-Xfrontend" "-swift-async-frame-pointer=never")
endif()

if(SWIFT_STDLIB_DISABLE_INSTANTIATION_CACHES)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/StringObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ extension _StringObject {

@inline(never)
internal func _dump() {
#if INTERNAL_CHECKS_ENABLED
#if INTERNAL_CHECKS_ENABLED && !SWIFT_STDLIB_STATIC_PRINT
let raw = self.rawBits
let word0 = ("0000000000000000" + String(raw.0, radix: 16)).suffix(16)
let word1 = ("0000000000000000" + String(raw.1, radix: 16)).suffix(16)
Expand Down
4 changes: 2 additions & 2 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ if run_vendor == 'apple':

# TODO: consider making the addition of these flags dependent on the CMake
# setting for hermetic seal at link
if not config.swift_freestanding_is_darwin:
if not config.swift_freestanding_is_darwin and not config.swift_stdlib_use_relative_protocol_witness_tables:
swift_execution_tests_extra_flags += ' -experimental-hermetic-seal-at-link -lto=llvm-full'

if not config.swift_freestanding_is_darwin:
Expand All @@ -1013,7 +1013,7 @@ if run_vendor == 'apple':
swift_execution_tests_extra_flags += ' -Xfrontend -reflection-metadata-for-debugger-only'

if config.swift_stdlib_use_relative_protocol_witness_tables:
swift_execution_tests_extra_flags += ' -Xfrontend -enable-relative-protocol-witness-tables'
swift_execution_tests_extra_flags += ' -Xfrontend -enable-relative-protocol-witness-tables -Xfrontend -swift-async-frame-pointer=never'

# Build a resource dir for freestanding tests.
new_resource_dir = os.path.join(config.test_exec_root, "resource_dir")
Expand Down
33 changes: 33 additions & 0 deletions utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2615,6 +2615,39 @@ mixin-preset=stdlib_S_standalone_minimal_macho_arm64,build
test
validation-test

[preset: stdlib_S_standalone_minimal_macho_arm64_relative_protocol_witness_table,build,test]
mixin-preset=
stdlib_base_standalone
mixin_stdlib_minimal

build-subdir=stdlib_S_standalone
debug
assertions

verbose-build

swift-primary-variant-sdk=FREESTANDING
swift-primary-variant-arch=arm64
swift-freestanding-flavor=apple
swift-freestanding-sdk=macosx
stdlib-deployment-targets=freestanding-arm64

# For now, until clang/swiftc works correctly with "none-macho" as the OS part of target triple.
swift-freestanding-triple-name=macosx11.0
swift-freestanding-module-name=macos
swift-freestanding-archs=arm64

# For lit tests, we are producing dynamic executables with statically linked stdlib into the executable.
swift-runtime-static-image-inspection=0

swift-stdlib-experimental-hermetic-seal-at-link=0
swift-stdlib-lto=
swift-enable-runtime-function-counters=0
swift-stdlib-use-relative-protocol-witness-tables=1

test
validation-test

[preset: stdlib_S_standalone_darwin_x86_64,build]
mixin-preset=
stdlib_S_standalone,build
Expand Down
1 change: 1 addition & 0 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ KNOWN_SETTINGS=(
swift-stdlib-single-threaded-concurrency "0" "build Swift concurrency in single-threaded mode"
swift-stdlib-concurrency-tracing "" "whether to enable tracing signposts for concurrency; default is 1 on Darwin platforms, 0 otherwise"
swift-stdlib-use-relative-protocol-witness-tables "0" "whether to use relative protocol witness table"
swift-enable-runtime-function-counters "1" "whether to enable runtime function counters"
swift-stdlib-os-versioning "1" "whether to build stdlib with availability based on OS versions (Darwin only)"
swift-stdlib-has-commandline "1" "whether to build stdlib with the CommandLine enum and support for argv/argc"
swift-stdlib-stable-abi "" "should stdlib be built with stable ABI, if not set defaults to true on Darwin, false otherwise"
Expand Down