This patch fixes the linkage for __crashtracer_info__ making it have the proper mangling (extern "C") and linkage (private extern).
It also adds a new PrettyStackTrace type, allowing LLDB to adopt this instead of Host::SetCrashDescriptionWithFormat().
Without this patch, CrashTracer on macOS won't pick up pretty stack traces from any LLVM client. Also, this patch needs to be synced with an LLDB patch that adopts it.
As far as I can tell, making this a hidden symbol makes the .desc ___crashreporter_info__, 0x10 (ie REFERENCED_DYNAMICALLY) not have any effect:
% cat crashref.cc extern "C" const char *__crashreporter_info__ __attribute__((visibility("hidden"))) = 0; asm(".desc ___crashreporter_info__, 0x10"); int main() {} % clang crashref.cc % nm -m a.out 0000000100004000 (__DATA,__common) non-external (was a private external) ___crashreporter_info__ 0000000100000000 (__TEXT,__text) [referenced dynamically] external __mh_execute_header 0000000100003fb0 (__TEXT,__text) external _main (undefined) external dyld_stub_binder (from libSystem) % strip -r a.out % nm -m a.out 0000000100000000 (__TEXT,__text) [referenced dynamically] external __mh_execute_headerIt does have an effect without it:
% cat crashref.cc extern "C" const char *__crashreporter_info__ = 0; asm(".desc ___crashreporter_info__, 0x10"); int main() {} % clang crashref.cc % nm -m a.out 0000000100004000 (__DATA,__common) [referenced dynamically] external ___crashreporter_info__ 0000000100000000 (__TEXT,__text) [referenced dynamically] external __mh_execute_header 0000000100003fb0 (__TEXT,__text) external _main (undefined) external dyld_stub_binder (from libSystem) % strip -r a.out % nm -m a.out 0000000100004000 (__DATA,__common) [referenced dynamically] external ___crashreporter_info__ 0000000100000000 (__TEXT,__text) [referenced dynamically] external __mh_execute_headerIs that intentional? Should we just remove the .desc line?