Skip to content

[Build] Update SWIFT_TARGET_LIBRARY_NAME for swiftRuntime in new build. #78977

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 1 commit into from
Jan 28, 2025
Merged
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
2 changes: 1 addition & 1 deletion Runtimes/Core/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ endif()
target_compile_definitions(swiftRuntime
PRIVATE
-DSWIFT_RUNTIME
-DSWIFT_TARGET_LIBRARY_NAME=swiftRuntime
-DSWIFT_TARGET_LIBRARY_NAME=swiftRuntimeCore
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is the only part that actually needs changing here so that the compatibility header picks things up correctly. This is an object library that only contains C/C++, so there shouldn't be any conflict with parts from the old build. Given that the Runtime module depends on the overlay, it will have to be a separate "supplemental" library anyway.

Copy link
Member

@compnerd compnerd Jan 28, 2025

Choose a reason for hiding this comment

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

This is incorrect, this should be swiftCore. The way that this macro is used is with the CPP macro programming in Visibility.h, and the only valid options are swiftCore, swift_Concurrency, swiftDistributed, swift_Differentiation`. The value is used to select if the symbol is in the current module's ABI or not. See https://github.com/swiftlang/swift/blob/main/stdlib/public/SwiftShims/swift/shims/Visibility.h#L190-L214

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not the only place it gets used, and it was being used with swiftRuntime in the past (which is not part of the list you're referring to). The macro we're tripping up over isn't actually one of the ones from Visibility.h either; it's CompatibilityOverride.h that's the problem in this case, and in particular COMPATIBILITY_OVERRIDE_INCLUDE_PATH_swiftRuntime[Core] that was the issue.

All I'm trying to fix here is the build breakage, and only by updating the spelling that I've changed, rather than doing something entirely new.

$<$<BOOL:${BUILD_SHARED_LIBS}>:-DswiftCore_EXPORTS>
$<$<BOOL:${SwiftCore_ENABLE_BACKTRACING}>:-DSWIFT_ENABLE_BACKTRACING>
$<$<BOOL:${SwiftCore_ENABLE_OVERRIDABLE_RETAIN_RELEASE}>:-DSWIFT_STDLIB_OVERRIDABLE_RETAIN_RELEASE>
Expand Down