In file included from /wrkdirs/usr/ports/mail/thunderbird/work/thunderbird-45.6.0/mozilla/ipc/contentproc/plugin-container.cpp:7: In file included from ../../dist/include/nsXPCOM.h:10: In file included from ../../dist/include/nscore.h:20: In file included from ../../dist/include/mozilla/mozalloc.h:16: In file included from /wrkdirs/usr/ports/mail/thunderbird/work/thunderbird-45.6.0/obj-x86_64-unknown-freebsd12.0/dist/stl_wrappers/new:44: In file included from /wrkdirs/usr/ports/mail/thunderbird/work/thunderbird-45.6.0/obj-x86_64-unknown-freebsd12.0/dist/system_wrappers/new:3: /usr/include/c++/v1/new:132:1: error: function declared '[[noreturn]]' after its first declaration _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec ^ /usr/include/c++/v1/__config:273:30: note: expanded from macro '_LIBCPP_NORETURN' # define _LIBCPP_NORETURN [[noreturn]] ^ ../../dist/include/mozilla/throw_gcc.h:35:1: note: declaration missing '[[noreturn]]' attribute is here __throw_bad_alloc(void) ^ build log: http://sprunge.us/jOLB "See Also" bugzilla field links upstream bug for more details.
Submitted a libc++ fix here: https://reviews.llvm.org/D28981 With this applied to my local libc++ headers, Firefox is now building. I'll await the upstream review, and fast-track the patch into clang400-import after it gets approved.
Created attachment 179285 [details] Use [[noreturn]] for __throw_xxx wrappers, if libc++ 4.0.0 or higher So since the upstream libc++ review was clearly rejected ("get off my lawn!" :), I now propose this alternate fix, which prefixes all the __throw_xxx functions with [[noreturn]], but *only* for clang, and for libc++ 4.0.0 and higher. I will send something similar upstream.
Comment on attachment 179285 [details] Use [[noreturn]] for __throw_xxx wrappers, if libc++ 4.0.0 or higher I'm biased against the fix since it looks like a gross workaround for Clang idiosyncrasy: C++11 attributes vs. C++11-style GNU attributes vs. regular GNU attributes vs. no attributes. Somehow the former is incompatible with everything else except for the 1st declaration. So, let's see what lands upstream then backport it here unless /projects/clang400-import is merged to /head before. Locally I've just replaced [[noreturn]] with [[gnu::noreturn]] in libc++ to avoid having to patch every Firefox checkout.
A commit references this bug: Author: jbeich Date: Mon Jan 30 21:03:47 UTC 2017 New revision: 432865 URL: https://svnweb.freebsd.org/changeset/ports/432865 Log: gecko: unbreak with clang/libc++ 4.0 In file included from mozilla/ipc/contentproc/plugin-container.cpp:7: In file included from ../../dist/include/nsXPCOM.h:10: In file included from ../../dist/include/nscore.h:20: In file included from ../../dist/include/mozilla/mozalloc.h:16: In file included from objdir/dist/stl_wrappers/new:44: In file included from objdir/dist/system_wrappers/new:3: /usr/include/c++/v1/new:132:1: error: function declared '[[noreturn]]' after its first declaration _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec ^ /usr/include/c++/v1/__config:273:30: note: expanded from macro '_LIBCPP_NORETURN' # define _LIBCPP_NORETURN [[noreturn]] ^ ../../dist/include/mozilla/throw_gcc.h:35:1: note: declaration missing '[[noreturn]]' attribute is here __throw_bad_alloc(void) ^ PR: 216186 Submitted by: dim Obtained from: upstream Changes: head/mail/thunderbird/files/patch-bug1329520 head/www/firefox/files/patch-bug1329520 head/www/firefox-esr/files/patch-bug1329520 head/www/libxul/files/patch-bug1329520 head/www/seamonkey/files/patch-bug1329520
A commit references this bug: Author: jbeich Date: Mon Jan 30 21:06:02 UTC 2017 New revision: 432867 URL: https://svnweb.freebsd.org/changeset/ports/432867 Log: MFH: r432865 gecko: unbreak with clang/libc++ 4.0 In file included from mozilla/ipc/contentproc/plugin-container.cpp:7: In file included from ../../dist/include/nsXPCOM.h:10: In file included from ../../dist/include/nscore.h:20: In file included from ../../dist/include/mozilla/mozalloc.h:16: In file included from objdir/dist/stl_wrappers/new:44: In file included from objdir/dist/system_wrappers/new:3: /usr/include/c++/v1/new:132:1: error: function declared '[[noreturn]]' after its first declaration _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec ^ /usr/include/c++/v1/__config:273:30: note: expanded from macro '_LIBCPP_NORETURN' # define _LIBCPP_NORETURN [[noreturn]] ^ ../../dist/include/mozilla/throw_gcc.h:35:1: note: declaration missing '[[noreturn]]' attribute is here __throw_bad_alloc(void) ^ PR: 216186 Submitted by: dim Obtained from: upstream Approved by: ports-secteam blanket Changes: _U branches/2017Q1/ branches/2017Q1/mail/thunderbird/files/patch-bug1329520 branches/2017Q1/www/firefox/files/patch-bug1329520 branches/2017Q1/www/firefox-esr/files/patch-bug1329520 branches/2017Q1/www/libxul/files/patch-bug1329520 branches/2017Q1/www/seamonkey/files/patch-bug1329520