Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 850988 - www-client/firefox-91.10.0[-clang] doesn't build (error: non-constant condition for static assertion)
Summary: www-client/firefox-91.10.0[-clang] doesn't build (error: non-constant conditi...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-10 11:40 UTC by Sebastian Melzer
Modified: 2024-06-13 12:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (compressed) (build.log.bz2,257.84 KB, application/x-bzip2)
2022-06-10 11:43 UTC, Sebastian Melzer
Details
emerge --info (emerge_info.txt,6.71 KB, text/plain)
2022-06-10 11:45 UTC, Sebastian Melzer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Melzer 2022-06-10 11:40:59 UTC
Compilation fails with the following message, possibly a GCC bug. This is not the first version of Firefox with this problem, but the problem is still recent - according to emerge.log it was probably introduced in 91.8.0. Compilation with set clang USE-flag succeeds.

 1:30.72 /var/tmp/portage/www-client/firefox-91.10.0/work/firefox-91.10.0/dom/base/nsTreeSanitizer.cpp:635:20: error: non-constant condition for static assertion
 1:30.72   635 | static_assert(AllOf(std::begin(kURLAttributesSVG), std::end(kURLAttributesSVG),
 1:30.72       |               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1:30.72   636 |                     [](auto aURLAttributeSVG) {
 1:30.72       |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1:30.72   637 |                       return AnyOf(std::begin(kAttributesSVG),
 1:30.72       |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1:30.72   638 |                                    std::end(kAttributesSVG),
 1:30.72       |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~
 1:30.72   639 |                                    [&](auto aAttributeSVG) {
 1:30.72       |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~
 1:30.72   640 |                                      return aAttributeSVG == aURLAttributeSVG;
 1:30.72       |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1:30.72   641 |                                    });
 1:30.72       |                                    ~~~
 1:30.72   642 |                     }));
 1:30.72       |                     ~~
 1:30.72 /var/tmp/portage/www-client/firefox-91.10.0/work/firefox-91.10.0/dom/base/nsTreeSanitizer.cpp:635:20:   in 'constexpr' expansion of 'mozilla::AllOf<const nsStaticAtom* const*, <lambda(auto:30)> >(std::begin<const nsStaticAtom* const, 2>(kURLAttributesSVG), std::end<const nsStaticAtom* const, 2>(kURLAttributesSVG), (<lambda closure object><lambda(auto:30)>{}, <lambda(auto:30)>()))'
 1:30.72 /var/tmp/portage/www-client/firefox-91.10.0/work/firefox_build/dist/include/mozilla/Algorithm.h:24:15:   in 'constexpr' expansion of 'aPred.<lambda(auto:30)>(((const nsStaticAtom*)(* aFirst)))'
 1:30.72 /var/tmp/portage/www-client/firefox-91.10.0/work/firefox-91.10.0/dom/base/nsTreeSanitizer.cpp:637:35:   in 'constexpr' expansion of 'mozilla::AnyOf<const nsStaticAtom* const*, <lambda(auto:30)>::<lambda(auto:31)> >(std::begin<const nsStaticAtom* const, 182>(kAttributesSVG), std::end<const nsStaticAtom* const, 182>(kAttributesSVG), <lambda closure object><lambda(auto:30)>::<lambda(auto:31)>{aURLAttributeSVG})'
 1:30.72 /var/tmp/portage/www-client/firefox-91.10.0/work/firefox-91.10.0/dom/base/nsTreeSanitizer.cpp:640:59: error: '((& mozilla::detail::gGkAtoms.mozilla::detail::GkAtoms::mAtoms[1541]) == 0)' is not a constant expression
 1:30.72   640 |                                      return aAttributeSVG == aURLAttributeSVG;
 1:30.73       |

Reproducible: Always
Comment 1 Sebastian Melzer 2022-06-10 11:43:33 UTC
Created attachment 783851 [details]
build.log (compressed)
Comment 2 Sebastian Melzer 2022-06-10 11:45:46 UTC
Created attachment 783854 [details]
emerge --info
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-10 12:01:29 UTC
As discussed on IRC (just commenting here so nobody else looks into it just yet in case it is this), it looks like it's caused by -fno-delete-null-pointer-checks.
Comment 4 Sebastian Melzer 2022-06-10 18:23:42 UTC
This is indeed an issue with -fno-delete-null-pointer-checks, the build succeeds without this flag.
Comment 5 Joonas Niilola gentoo-dev 2023-07-05 08:00:57 UTC
I see the upstream bug is fixed.
Comment 6 Emanuel Czirai 2024-06-13 12:39:49 UTC
(In reply to Sam James from comment #3)
> As discussed on IRC (just commenting here so nobody else looks into it just
> yet in case it is this), it looks like it's caused by
> -fno-delete-null-pointer-checks.

Good to know, appreciate knowing this as I'm definitely using that.

834:26.61 In file included from Unified_cpp_dom_base10.cpp:92:
834:26.61 /var/tmp/portage/www-client/firefox-127.0/work/firefox-127.0/dom/base/nsTreeSanitizer.cpp:637:20: error: non-constant condition for static assertion
834:26.62   637 | static_assert(AllOf(std::begin(kURLAttributesSVG), std::end(kURLAttributesSVG),
834:26.62       |               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
834:26.62   638 |                     [](auto aURLAttributeSVG) {
834:26.62       |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
834:26.62   639 |                       return AnyOf(std::begin(kAttributesSVG),
834:26.63       |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
834:26.63   640 |                                    std::end(kAttributesSVG),
834:26.63       |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~
834:26.63   641 |                                    [&](auto aAttributeSVG) {
834:26.63       |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~
834:26.63   642 |                                      return aAttributeSVG == aURLAttributeSVG;
834:26.64       |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
834:26.64   643 |                                    });
834:26.64       |                                    ~~~
834:26.64   644 |                     }));
834:26.64       |                     ~~
834:26.64 /var/tmp/portage/www-client/firefox-127.0/work/firefox-127.0/dom/base/nsTreeSanitizer.cpp:637:20:   in 'constexpr' expansion of 'mozilla::AllOf<const nsStaticAtom* const*, <lambda(auto:42)> >(std::begin<const nsStaticAtom* const, 2>(kURLAttributesSVG), std::end<const nsStaticAtom* const, 2>(kURLAttributesSVG), (<lambda closure object><lambda(auto:42)>(), <lambda(auto:42)>()))'
834:26.65 /var/tmp/portage/www-client/firefox-127.0/work/firefox_build/dist/include/mozilla/Algorithm.h:24:15:   in 'constexpr' expansion of 'aPred.<lambda(auto:42)>(((const nsStaticAtom*)(* aFirst)))'
834:26.65 /var/tmp/portage/www-client/firefox-127.0/work/firefox-127.0/dom/base/nsTreeSanitizer.cpp:639:35:   in 'constexpr' expansion of 'mozilla::AnyOf<const nsStaticAtom* const*, <lambda(auto:42)>::<lambda(auto:43)> >(std::begin<const nsStaticAtom* const, 182>(kAttributesSVG), std::end<const nsStaticAtom* const, 182>(kAttributesSVG), <lambda closure object><lambda(auto:42)>::<lambda(auto:43)>{aURLAttributeSVG})'
834:26.65 /var/tmp/portage/www-client/firefox-127.0/work/firefox-127.0/dom/base/nsTreeSanitizer.cpp:642:59: error: '((& mozilla::detail::gGkAtoms.mozilla::detail::GkAtoms::mAtoms[1581]) == 0)' is not a constant expression
834:26.66   642 |                                      return aAttributeSVG == aURLAttributeSVG;
834:26.66       |                                             ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
834:26.66 In file included from /var/tmp/portage/www-client/firefox-127.0/work/firefox_build/dist/include/mozilla/dom/ModuleLoader.h:11,
834:26.66                  from /var/tmp/portage/www-client/firefox-127.0/work/firefox_build/dist/include/mozilla/dom/ScriptLoader.h:29,
834:26.66                  from /var/tmp/portage/www-client/firefox-127.0/work/firefox_build/dist/include/mozilla/dom/WorkerPrivate.h:12,
834:26.67                  from /var/tmp/portage/www-client/firefox-127.0/work/firefox_build/dist/include/mozilla/dom/ProcessIsolation.h:15,
834:26.67                  from /var/tmp/portage/www-client/firefox-127.0/work/firefox_build/dist/include/mozilla/dom/CanonicalBrowsingContext.h:13,
834:26.67                  from /var/tmp/portage/www-client/firefox-127.0/work/firefox-127.0/dom/base/nsWindowRoot.cpp:29,
834:26.67                  from Unified_cpp_dom_base10.cpp:119: