prefer libunwind on x86-64 even with -fno-omit-frame-pointer

Libunwind is mostly safe on x86-64 and most of OS (e.g. libc) is
compiled without frame pointers anyways. Even when libc is built with
frame pointers, various libc asm routines (e.g. memcpy) are not. And
even for code built with frame pointers we actually sometimes get
SIGPROF inside function prologues, before frame pointer is
established. Which then causes imperfect backtraces.

Libunwind should handle this all (when it doesn't crash or deadlock).
This commit is contained in:
Aliaksey Kandratsenka 2021-02-14 21:37:20 -08:00
parent f4aa2a435e
commit 37087ec536

View File

@ -219,7 +219,7 @@ static GetStackImplementation *all_impls[] = {
// ppc and i386 implementations prefer arch-specific asm implementations.
// arm's asm implementation is broken
#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__PPC__)
#if defined(__i386__) || defined(__ppc__) || defined(__PPC__)
#if !defined(NO_FRAME_POINTER)
#define TCMALLOC_DONT_PREFER_LIBUNWIND
#endif