-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add LLVM flags to limit DWARF version to 2 on BSD #77765
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
4a779a1
to
fb3ae79
Compare
@amshafer |
Certain platforms need to limit the DWARF version emitted (oxs, *bsd). This change adds a dwarf_version entry to the options that allows a platform to specify the dwarf version to use. By default this option is none and the default DWARF version is selected. Also adds an option for printing Option<u32> json keys
Thanks, sorry for all the iterations. I squashed it all into one commit, and added the error message. Please let me know if there's anything else. |
Thanks! |
📌 Commit 4511f8b has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#77765 (Add LLVM flags to limit DWARF version to 2 on BSD) - rust-lang#77788 (BTreeMap: fix gdb provider on BTreeMap with ZST keys or values) - rust-lang#77795 (Codegen backend interface refactor) - rust-lang#77808 (Moved the main `impl` for FnCtxt to its own file.) - rust-lang#77817 (Switch rustdoc from `clean::Stability` to `rustc_attr::Stability`) - rust-lang#77829 (bootstrap: only use compiler-builtins-c if they exist) - rust-lang#77870 (Use intra-doc links for links to module-level docs) - rust-lang#77897 (Move `Strip` into a separate rustdoc pass) Failed merges: - rust-lang#77879 (Provide better documentation and help messages for x.py setup) - rust-lang#77902 (Include aarch64-pc-windows-msvc in the dist manifests) r? `@ghost`
This has been a thorn in my side for a while, I can finally generate flamegraphs of rust programs on bsd again. This fixes dtrace profiling on freebsd, I think it might help with lldb as well but I can't test that because my current rust-lldb setup is messed up.
I'm limiting the dwarf version to 2 on all bsd's (netbsd/openbsd/freebsd) since it looks like this applies to all of them, but I have only tested on freebsd.
Let me know if there's anything I can improve!
Currently on FreeBSD dtrace profiling does not work and shows jumbled/incorrect
symbols in the backtraces. FreeBSD does not support the latest versions of DWARF
in dtrace (and lldb?) yet, and needs to be limited to DWARF2 in the same way as macos.
This adds an is_like_bsd flag since it was missing. NetBSD/OpenBSD/FreeBSD all
match this.
This effectively copies #11864 but targets FreeBSD instead of macos.