Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 756688

Summary: firefox 83 with USE=-clang fails to compile Span.h error: '((& arr[0]) != 0)' is not a constant expression
Product: Gentoo Linux Reporter: flippynelle <flippynelle>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal CC: flippynelle
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description flippynelle 2020-11-25 10:50:57 UTC
firefox with USE=-clang fails to compile with:
/var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist/include/mozilla/Span.h:794:17: error: '((& arr[0]) != 0)' is not a constant expression

workaround: USE=clang  works


Reproducible: Always

Steps to Reproduce:
1. emerge firefox 83.0 with USE="-clang dbus hardened pulseaudio system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-webp -debug -eme-free -geckodriver -gmp-autoupdate -hwaccel -jack -lto -openh264 -pgo -screencast (-selinux) -system-libvpx -wayland -wifi"

Actual Results:  
0:45.60 /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -std=gnu++17 -o Unified_cpp_mfbt_tests_gtest0.o -c  -I/var/tmp/portage/www-client/firefox-83.
0/work/firefox_build/dist/stl_wrappers -I/var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist/system_wrappers -include /var/tmp/portage
/www-client/firefox-83.0/work/firefox-83.0/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=
1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/var/tmp/portage/www-client/firefox-83.0/work/firefox-83.0/mf
bt/tests/gtest -I/var/tmp/portage/www-client/firefox-83.0/work/firefox_build/mfbt/tests/gtest -I/var/tmp/portage/www-client/firefox-83.0/work/firef
ox_build/dist/include -I/usr/include/nspr -I/usr/include/nss -I/usr/include/nspr -I/var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist
/include/nss -I/usr/include/pixman-1 -fPIC -DMOZILLA_CLIENT -include /var/tmp/portage/www-client/firefox-83.0/work/firefox_build/mozilla-config.h -
Wall -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-in
valid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough -Wunused-function -Wunused-variable -Wno-error=maybe-uninitialized -Wno-erro
r=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error
=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-security -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -mar
ch=skylake -mtune=skylake-avx512 -mprefer-vector-width=128 -pipe -frecord-gcc-switches -fvar-tracking-assignments -fno-omit-frame-pointer -ftrack-m
acro-expansion=2 -fstack-protector-all -Wno-trigraphs -fno-schedule-insns2 -fno-delete-null-pointer-checks -D_FORTIFY_SOURCE=2 -rdynamic -fno-excep
tions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -O2 -fomit-frame-pointer
 -funwind-tables  -MD -MP -MF .deps/Unified_cpp_mfbt_tests_gtest0.o.pp  -fdiagnostics-color  Unified_cpp_mfbt_tests_gtest0.cpp
8 0:45.60 In file included from /var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist/include/mozilla/Assertions.h:18,
8 0:45.60                  from /var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist/include/mozilla/Maybe.h:18,
8 0:45.60                  from /var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist/include/mozilla/Buffer.h:11,
8 0:45.60                  from /var/tmp/portage/www-client/firefox-83.0/work/firefox-83.0/mfbt/tests/gtest/TestBuffer.cpp:7,
8 0:45.60                  from Unified_cpp_mfbt_tests_gtest0.cpp:2:
...
8 0:45.62 In file included from /var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist/include/mozilla/Buffer.h:12,
8 0:45.62                  from /var/tmp/portage/www-client/firefox-83.0/work/firefox-83.0/mfbt/tests/gtest/TestBuffer.cpp:7,
8 0:45.62                  from Unified_cpp_mfbt_tests_gtest0.cpp:2:
8 0:45.62 /var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist/include/mozilla/Span.h: In member function 'virtual void SpanTest_type_inference_Test::TestBody()':
8 0:45.62 /var/tmp/portage/www-client/firefox-83.0/work/firefox-83.0/mfbt/tests/gtest/TestSpan.cpp:2125:30:   in 'constexpr' expansion of 'mozilla::Span<const int, 5>(arr)'
8 0:45.62 /var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist/include/mozilla/Span.h:425:58:   in 'constexpr' expansion of '((mozilla::Span<const int, 5>*)this)->mozilla::Span<const int, 5>::storage_.mozilla::Span<const int, 5>::storage_type<mozilla::span_details::extent_type<5> >::storage_type<mozilla::span_details::extent_type<5> >((& aArr[0]), (mozilla::span_details::extent_type<5>(), mozilla::span_details::extent_type<5>()))'
8 0:45.62 /var/tmp/portage/www-client/firefox-83.0/work/firefox_build/dist/include/mozilla/Span.h:794:17: error: '((& arr[0]) != 0)' is not a constant expression
8 0:45.62   794 |           data_(elements ? elements
8 0:45.62       |                 ^~~~~~~~
8 0:45.63 In file included from Unified_cpp_mfbt_tests_gtest0.cpp:29:
8 0:45.63 /var/tmp/portage/www-client/firefox-83.0/work/firefox-83.0/mfbt/tests/gtest/TestSpan.cpp:2127:21: error: non-constant condition for static assertion
8 0:45.63  2127 |   static_assert(arr == s.Elements());
8 0:45.63       |                 ~~~~^~~~~~~~~~~~~~~


Expected Results:  
no compile failures

 * Package:    www-client/firefox-83.0
 * Repository: gentoo
 * Maintainer: mozilla@gentoo.org
 * USE:        abi_x86_64 amd64 dbus elibc_glibc hardened kernel_linux pulseaudio system-av1 system-harfbuzz system-icu system-jpeg system-libevent
 system-webp userland_GNU
 * FEATURES:   ccache fakeroot installsources network-sandbox preserve-libs sandbox splitdebug suidctl userpriv usersandbox
...
 * Using LLVM slot 11 to build
 * Using python3.8 to build
...


# eselect gcc list
 [1] x86_64-pc-linux-gnu-10.2.0 *

# eselect rust list
Available Rust versions:
  [1]   rust-bin-1.48.0
  [2]   rust-1.48.0 *
Comment 1 Ionen Wolkens gentoo-dev 2020-11-25 12:07:21 UTC
bug #751787 mentions this is caused by having -fno-delete-null-pointer-checks which I see being used here, may want to try with more regular C(XX)FLAGS
Comment 2 flippynelle 2020-11-25 13:21:26 UTC
(In reply to Ionen Wolkens from comment #1)
> bug #751787 mentions this is caused by having
> -fno-delete-null-pointer-checks which I see being used here, may want to try
> with more regular C(XX)FLAGS

Thank you very much for that info!

I couldn't find any bug reports before because I had added double quotes around the search string and so it won't find that bug(or this one) like that: https://bugs.gentoo.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=IN_PROGRESS&bug_status=RESOLVED&bug_status=VERIFIED&component=Current packages&longdesc="is not a constant expression"&longdesc_type=allwordssubstr&order=Importance&product=Gentoo Linux&query_format=advanced&resolution=---&resolution=FIXED&resolution=INVALID&resolution=WONTFIX&resolution=LATER&resolution=REMIND&resolution=DUPLICATE&resolution=WORKSFORME&resolution=CANTFIX&resolution=NEEDINFO&resolution=TEST-REQUEST&resolution=UPSTREAM&resolution=OBSOLETE

nor in summary: https://bugs.gentoo.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=CONFIRMED&bug_status=IN_PROGRESS&bug_status=RESOLVED&bug_status=VERIFIED&component=Current packages&list_id=4999456&order=Importance&product=Gentoo Linux&query_format=advanced&resolution=---&resolution=FIXED&resolution=INVALID&resolution=WONTFIX&resolution=LATER&resolution=REMIND&resolution=DUPLICATE&resolution=WORKSFORME&resolution=CANTFIX&resolution=NEEDINFO&resolution=TEST-REQUEST&resolution=UPSTREAM&resolution=OBSOLETE&short_desc="is not a constant expression"&short_desc_type=allwordssubstr
Comment 3 flippynelle 2020-11-25 13:21:46 UTC

*** This bug has been marked as a duplicate of bug 751787 ***