[libcxx-commits] [PATCH] D150897: [runtimes] Use libunwind from libc++ and libc++abi by default
Fangrui Song via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 18 20:35:37 PDT 2023
MaskRay added a comment.
In D150897#4354210 <https://reviews.llvm.org/D150897#4354210>, @manojgupta wrote:
> GCC's libgcc_s/libgcc and llvm's libunwind are not ABI compatible, the code will compile/link but will crash at runtime for calls to functions like backtrace() because functions from libunwind and libgcc will get intermingled. So this is a risky change for the users. I'd strongly advise to make a note of this is release notes.
The `_Unwind_*` functions are ABI incompatible, but `_Unwind_Context` structs are not.
You probably mean glibc's arm port (https://bugs.chromium.org/p/chromium/issues/detail?id=1162190#c16). I have a write-up about when glibc invokes `dlopen` on `libgcc_s.so.1` (pthread_exit/pthread_cancel, and backtrace-family functions):
https://gist.github.com/MaskRay/3d05f5613a2f8e774aad26ee3da4e696
For pthread_exit/pthread_cancel, `dlopen`ing `libgcc_s.so.1` is undesired but benign. For `backtrace`, `backtrace_symbols`, and `backtrace_symbols_fd` declared in `<execinfo.h>`, I agree that they are problematic on arm and need attention on other ports (but I don't find another issue yet).
`backtrace`-family functions are not recommended, so the cross-walking problem should be limited. That said, I want to check whether this can be improved on glibc'c side.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150897/new/
https://reviews.llvm.org/D150897
More information about the libcxx-commits
mailing list