From 5c28f10c144026aba25044410510ba8418978698 Mon Sep 17 00:00:00 2001 From: athenian200 Date: Wed, 2 Oct 2019 14:44:26 -0500 Subject: MoonchildProductions#1251 - Part 13: Redefining abort in C++ requires extern "C" https://bugzilla.mozilla.org/show_bug.cgi?id=1375467 I would ifdef this, but it's been in Firefox since version of 56, and Petr Sumbara's explanation as to why it's wrong in the first place is so detailed that it's pretty obvious the code wasn't technically doing things properly to begin with. Basically, they tried to redefine a system function after including the header file that declares it, and it caused problems on Solaris because libc functions are imported into the C++ std namespace in a different way that also complies with standards. So the existing implementation is technically bad code on all platforms, the Solaris implementation just uncovered the lack of standards compliance in the Mozilla code. --- memory/mozalloc/mozalloc_abort.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'memory') diff --git a/memory/mozalloc/mozalloc_abort.cpp b/memory/mozalloc/mozalloc_abort.cpp index a998d8164..85e566db0 100644 --- a/memory/mozalloc/mozalloc_abort.cpp +++ b/memory/mozalloc/mozalloc_abort.cpp @@ -68,7 +68,7 @@ void fillAbortMessage(char (&msg)[N], uintptr_t retAddress) { // // That segmentation fault will be interpreted as another bug by ASan and as a // result, ASan will just exit(1) instead of aborting. -void abort(void) +extern "C" void abort(void) { #ifdef MOZ_WIDGET_ANDROID char msg[64] = {}; -- cgit v1.2.3