Skip to content

[cmake] Fix LLDB for ASTGen #70204

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
Dec 5, 2023
Merged

Conversation

hamishknight
Copy link
Contributor

Add the swiftmodule paths for ASTGen via -add_ast_path to the public linker flags such that downstream linking picks them up, allowing LLDB to load them when debugging. Also switch SwiftCompilerModules to using public linker flags instead of adding the linker flags in _add_swift_runtime_link_flags.

@hamishknight hamishknight force-pushed the ast-for-lldb branch 2 times, most recently from 18f0f82 to de2b8a6 Compare December 4, 2023 19:07
@@ -231,6 +232,16 @@ function(add_swift_compiler_modules_library name)
add_library(${name} STATIC ${all_obj_files})
add_dependencies(${name} ${all_module_targets})
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX)

if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if there's a better check that can be used here to test for the linker being able to support -add_ast_path, this is the check that guarded the previous logic though.

Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

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

Nice

Add the swiftmodule paths for ASTGen via
`-add_ast_path` to the public linker flags such
that downstream linking picks them up, allowing
LLDB to load them when debugging. Also switch
SwiftCompilerModules to using public linker
flags instead of adding the linker flags in
`_add_swift_runtime_link_flags`.
@hamishknight
Copy link
Contributor Author

@swift-ci please smoke test

@hamishknight hamishknight merged commit c882552 into swiftlang:main Dec 5, 2023
@hamishknight hamishknight deleted the ast-for-lldb branch December 5, 2023 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants