Skip to content
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

[lldb] Support for the new libc++ __compressed_pair layout in the nearest official release #9881

Open
DmT021 opened this issue Jan 24, 2025 · 2 comments

Comments

@DmT021
Copy link

DmT021 commented Jan 24, 2025

I see the new libc++ being used in the wild (for example, in chromium), which restructured some standard types (pr).
So, maybe we should cherry-pick this patch (and something else perhaps) into release/6.1 and stable/20240723?

сс @Michael137

@Michael137
Copy link

Michael137 commented Jan 25, 2025

I intentionally didn't cherry-pick it because the libc++ change was scheduled to land in the LLVM 20 release, to give it some time for testing. Anyone building a toolchain based on top-of-tree libc++ on macOS has to go out of their way to do so. And at that point might as well also build LLDB. There were some compiler changes we had to make too, so in my opinion this is a bit too risky to cherry-pick. But if you have a concrete example of how it's causing issues, I'm happy to discuss

(CC @adrian-prantl @ldionne )

@DmT021
Copy link
Author

DmT021 commented Jan 25, 2025

Anyone building a toolchain based on top-of-tree libc++ on macOS has to go out of their way to do so. And at that point might as well also build LLDB.

That's true, and I'd prefer a custom build of LLDB as well. Unfortunately, this gets very tricky (if possible at all) when a project mixes Swift and C++. The Xcode's version of LLDB is built with a version of Swift incompatible with open-source swift toolchain builds. An attempt to debug a swift app built with the Xcode's toolchain using an open-source build of LLDB results in an error even if the versions are matched almost perfectly. Here's an example: the app is built with Xcode 16.1 toolchain with swift version 6.0.2.1, and LLDB is from swift-6.0.2-RELEASE toolchain from swift.org.

warning: ios18_playground.debug.dylib was compiled with a different Swift compiler (version '6.0.2.1') than the Swift compiler integrated into LLDB (version '0'). Swift expression evaluation requires a matching compiler and debugger from the same toolchain.
(lldb) version
lldb version 17.0.0 (https://github.com/swiftlang/llvm-project.git revision cff7a0f432c7588ea9015cf96f9093cd3e08395c)
Apple Swift version 6.0.2 (swift-6.0.2-RELEASE)
(lldb) po url
Cannot create Swift scratch context (couldn't create a ClangImporter)

On the other hand, open-source toolchains can't be used to develop iOS targets, or at least I had no luck to make it work. (EDIT: after some further digging into the problem it seems OSS lacks only two things to make it usable with iOS: libclang_rt.profile_*.a for ios, iossim, and others; and darwin-toolchain-require-use-os-runtime=1. So maybe it's possible)

Also, even if we manage to build a version of LLDB that would be compatible with some specific version of the official swift-toolchain, it seems that Xcode does not provide a way to substitute LLDB.framework without switching the entire toolchain. This is certainly the least of the problems, but still a pain point.

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

No branches or pull requests

2 participants