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 (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-10 11:40 UTC by Sebastian Melzer
Modified: 2023-07-05 08:00 UTC (History)
2 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.