ungoogled-chromium: linux build fails because of template issue in third_party/webrtc/rtc_base/bitstream_reader.h

Describe the bug Linux build fails with the following errors:

In file included from ../../third_party/webrtc/rtc_base/bitstream_reader.cc:11:
../../third_party/webrtc/rtc_base/bitstream_reader.h:70:13: error: explicit specialization in non-namespace scope 'class webrtc::BitstreamReader'
   70 |   template <>
      |             ^
../../third_party/webrtc/rtc_base/bitstream_reader.h:71:29: error: template-id 'Read<bool>' in declaration of primary template
   71 |   ABSL_MUST_USE_RESULT bool Read<bool>() {
      |                             ^~~~~~~~~~

To Reproduce Steps to reproduce the behavior:

  1. Download source files
  2. Run build using the RPM SPEC file successfully used to build Ungoogled-chromium 94.xxxx
  3. Build fails at [10335/49258]
  4. See error

Expected behavior Keep building

Screenshots Full command line and related error:

[10335/49258] CXX obj/third_party/webrtc/rtc_base/bitstream_reader/bitstream_reader.o
FAILED: obj/third_party/webrtc/rtc_base/bitstream_reader/bitstream_reader.o 
x86_64-mageia-linux-gnu-g++ -MMD -MF obj/third_party/webrtc/rtc_base/bitstream_reader/bitstream_reader.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DUSE_X11=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=1 -DRTC_ENABLE_VP9 -DWEBRTC_HAVE_SCTP -DENABLE_EXTERNAL_AUTH -DWEBRTC_USE_H264 -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_LIBRARY_IMPL -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -I../.. -Igen -I../../third_party/webrtc_overrides -I../../third_party/webrtc -Igen/third_party/webrtc -I../../third_party/abseil-cpp -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Wall -Wno-unused-local-typedefs -Wno-deprecated-declarations -Wno-comments -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-unused-parameter -fno-omit-frame-pointer -fvisibility=hidden -std=gnu++14 -Wno-narrowing -Wno-class-memaccess -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -O2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables -faligned-new -Wno-attributes -Wno-ignored-attributes -Wno-error=class-memaccess -Wno-error=unknown-pragmas -Wno-error=array-bounds -Wno-return-type -Wno-error=nonnull -Wno-error=free-nonheap-object -Wno-error=unused -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=invalid-offsetof -Wno-error=stringop-overflow -std=gnu++17 -fpermissive -w -Wno-error=format-truncation -c ../../third_party/webrtc/rtc_base/bitstream_reader.cc -o obj/third_party/webrtc/rtc_base/bitstream_reader/bitstream_reader.o
In file included from ../../third_party/webrtc/rtc_base/bitstream_reader.cc:11:
../../third_party/webrtc/rtc_base/bitstream_reader.h:70:13: error: explicit specialization in non-namespace scope 'class webrtc::BitstreamReader'
   70 |   template <>
      |             ^
../../third_party/webrtc/rtc_base/bitstream_reader.h:71:29: error: template-id 'Read<bool>' in declaration of primary template
   71 |   ABSL_MUST_USE_RESULT bool Read<bool>() {
      |                             ^~~~~~~~~~

Environment (please complete the following information):

  • OS/Platform and version: Mageia 8 x64
  • ungoogled-chromium version: 95.0.4638.54
  • gcc version: output of gcc -v
Utilisation des specs internes.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-mageia-linux-gnu/10/lto-wrapper
Cible : x86_64-mageia-linux-gnu
Configuré avec: ../configure --prefix=/usr --libexecdir=/usr/lib --with-slibdir=/lib64 --with-pkgversion='Mageia 10.3.0-2.mga8' --with-bugurl=https://bugs.mageia.org/ --mandir=/usr/share/man --infodir=/usr/share/info --enable-checking=release --enable-languages=c,c++,ada,fortran,objc,obj-c++,d --enable-linker-build-id --build=x86_64-mageia-linux-gnu --host=x86_64-mageia-linux-gnu --with-cpu=generic --with-system-zlib --enable-threads=posix --with-linker-hash-style=gnu --enable-shared --enable-long-long --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --enable-ssp --disable-libssp --disable-libffi --disable-werror --with-isl --with-python-dir=/lib/python3.8/site-packages --enable-lto --with-gcc-major-version-only
Modèle de thread: posix
Algorithmes de compression LTO supportés: zlib zstd
gcc version 10.3.0 (Mageia 10.3.0-2.mga8) 

Additional context Hi with the same spec file (beside patch adjustments to cope with code changes in version 95), I have successfully packaged 94.0.4606.81 and 94.0.4606.61 third_party/webrtc/rtc_base/bitstream_reader.cc seems a new addition with Chromium 95 My distribution has not packaged this 95 version yet. So, it might not be an ungoogled-chromium related issue. However, before reporting a bug upstream to Chromium, I’d like to make sure it is unlikely related to ungoogled-chromium. Plus, if you have some ideas how to solve this, it might save me some time 😉

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 39 (21 by maintainers)

Most upvoted comments

Hi all. Here are some news on my endeavor 😃

I’d like to thank you a lot, @wchen342 You have helped me a lot and I have learned a lot as well.!

However, going through sysroot and getting the source from git, left me with a source folder of about 50Go. I might have not done it in the best way possible, though? Anyway, this size of the source is not suitable to be used to build a package using my BS. I basically spend a lot of time to shuffle the source files around, before even starting to compile.

So, I spent some time to explore the option proposed by @DAINRA I have got also some inspiration from openSUSE community package to find the proper patches to be able to package Chromium using clang11 instead of clang13. I don’t think the spec of my distro was fully ready to build with clang and I had to tweak more things.

Long story short, I am now able to package Chromium 95 using the tarball source. I have then also packaged ungoogled-chromium on the top of it for Mageia. I have called this package WebyLib. Hope it is not an issue; I have contacted Eloston about this name, but I have never got any reply. Not sure my email has reached him.

Thanks all for your awesome support! 😃

I believe applying the chromium-95-BitstreamReader-namespace patch should solve your issue.

There are two different ways of getting gn. If you are using tarball it is generated by running bootstrap.py but if you use source checkout then you need to run the one under depot_tools.

@Ahrotahn There are multiple reasons one needs to use source checkout. For example, for Android and Windows tarball doesn’t work because they need files not existing in it. Also if you want to develop on top of chromium source tarball is not very convenient too.

To fix, run: build/linux/sysroot_scripts/install-sysroot.py --arch=amd64

😄

You were quicker than me. Sorry, I modified my comment too late…