You are not logged in.

#1 2020-05-16 22:43:25

jtheoof
Member
Registered: 2014-01-30
Posts: 23

[SOLVED] chromium does not compile with gcc 10

Edit I edited the title to reflect the fact that the issue is related to gcc upgrade not clang.

I apologize in advance if this is a noob's question but I've spent a few hours this issue.

I used to be able to compile chromium and chromium-ozone without any issue with clang 9. After a rather big update today (a few months late), I'm getting the following compiling issues (which I've pin pointed to clang 10 but I might be wrong):

ninja: Entering directory `out/Release'
[2/38119] CXX obj/base/base/trace_event_memory_overhead.o
FAILED: obj/base/base/trace_event_memory_overhead.o
clang++ -MMD -MF obj/base/base/trace_event_memory_overhead.o.d -DUSE_SYMBOLIZE -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DOFFICIAL_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D_GNU_SOURCE -DCR_CLANG_REVISION=\"n340759-eaabaf7e-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBASE_IMPLEMENTATION -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -I../.. -Igen -I../../third_party/boringssl/src/include -fprofile-sample-use=../../chrome/android/profiles/afdo.prof -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 -flto=thin -fsplit-lto-unit -fwhole-program-vtables -m64 -march=x86-64 -no-canonical-prefixes -Wall -Wextra -Wimplicit-fallthrough -Wthread-safety -Wextra-semi -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-bitwise-conditional-parentheses -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-misleading-indentation -Wno-range-loop-analysis -fno-omit-frame-pointer -g0 -fsanitize=cfi-vcall -fsanitize-blacklist=../../tools/cfi/blacklist.txt -fsanitize=cfi-icall -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wglobal-constructors -Wexit-time-destructors -Wshadow -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wexit-time-destructors -O2 -fno-ident -fdata-sections -ffunction-sections -std=c++14 -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -D_FORTIFY_SOURCE=2 -D__DATE__=  -D__TIME__=  -D__TIMESTAMP__= -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wno-builtin-macro-redefined -Wno-unknown-warning-option -c ../../base/trace_event/trace_event_memory_overhead.cc -o obj/base/base/trace_event_memory_overhead.o
In file included from ../../base/trace_event/trace_event_memory_overhead.cc:5:
../../base/trace_event/trace_event_memory_overhead.h:60:29: error: no type named 'string' in namespace 'std'
  void AddString(const std::string& str);
                       ~~~~~^
../../base/trace_event/trace_event_memory_overhead.cc:87:32: error: out-of-line definition of 'AddString' does not match any declaration in 'base::trace_event::TraceEventMemoryOverhead'
void TraceEventMemoryOverhead::AddString(const std::string& str) {
                               ^~~~~~~~~
2 errors generated.
[15/38119] CXX obj/base/base/file_util_posix.o
ninja: build stopped: subcommand failed.
==> ERROR: A failure occurred in build().
    Aborting...

clang 10 has stopped compiling with BUILD_SHARED_LIBS=ON (which seems related to my problem). So now, I'm probably missing a dev package, but which one? I tried to install libc++ and libstdc++5 from the AUR but it didn't work.

I can't go back to clang9 because I was stupid enough to clean my pacman cache and compiling to clang9 faces similar issues.

This is a list of packages I have installed.

local/clang 10.0.0-2
local/lib32-llvm-libs 10.0.0-1
local/lld 10.0.0-2
local/llvm-libs 10.0.0-1
local/gcc 10.1.0-1 (base-devel)
local/gcc-libs 10.1.0-1
local/lib32-gcc-libs 10.1.0-1 (multilib-devel)

Any help would be appreciated.

Last edited by jtheoof (2020-05-17 01:39:10)

Offline

#2 2020-05-16 22:55:39

loqs
Member
Registered: 2014-03-06
Posts: 18,055

Re: [SOLVED] chromium does not compile with gcc 10

chromium 81.0.4044.138-2 was built with clang 10.0.0-2 / llvm-libs 10.0.0-1 what version of chromium are you building it?  How does that build differ from the PKGBUILD arch uses?

Offline

#3 2020-05-16 23:03:10

jtheoof
Member
Registered: 2014-01-30
Posts: 23

Re: [SOLVED] chromium does not compile with gcc 10

It doesn't differ in any way.

yay -G chromium
cd chromium
makepkg

This will try to build chromium 81.0.4044.138-2 but fail with the error I mentioned.

Offline

#4 2020-05-16 23:07:14

loqs
Member
Registered: 2014-03-06
Posts: 18,055

Re: [SOLVED] chromium does not compile with gcc 10

If you use extra-x86_64-build from the devtools package instead of makepkg is the result the same?
If it is you can extract the .BUILDINFO from chromium-81.0.4044.138-2-x86_64.pkg.tar.zst to see which packages have changed.
Edit:
You can skip testing extra-x86_64-build https://tests.reproducible-builds.org/a … build1.log shows the same issue so that eliminates an unclean build environment.
The .BUILDINFO shows it was built with

installed = gcc-9.3.0-1-x86_64
installed = gcc-libs-9.3.0-1-x86_64

If you use the ALA and use extra-x86_64-build for the day before gcc 10 moved out of testing,  2020-05-13 does that build?
Edit2:
https://chromium.googlesource.com/chrom … 65799743e1

If more fixes are needed try:
https://gitweb.gentoo.org/repo/gentoo.g … mium/files
https://src.fedoraproject.org/rpms/chromium/tree/master

Last edited by loqs (2020-05-17 00:24:42)

Offline

#5 2020-05-17 01:17:47

jtheoof
Member
Registered: 2014-01-30
Posts: 23

Re: [SOLVED] chromium does not compile with gcc 10

You are right. Downgrading to gcc 9 did the trick. Thanks a lot.

I am confused though, if chromium needs clang compiler, why does it also gcc?

Offline

#6 2020-05-17 01:23:54

loqs
Member
Registered: 2014-03-06
Posts: 18,055

Re: [SOLVED] chromium does not compile with gcc 10

Clang compiler using c++ stdlib provided by gcc.  See the commit linked after my Edit2 to post #4 I think that should fix the build failure you encountered.  See the links following that if you encounter other build failure after applying that fix.

Offline

#7 2020-05-17 01:29:51

jtheoof
Member
Registered: 2014-01-30
Posts: 23

Re: [SOLVED] chromium does not compile with gcc 10

Also, should I report a bug to the chromium maintainers for Arch?

Offline

#8 2020-05-17 01:38:27

jtheoof
Member
Registered: 2014-01-30
Posts: 23

Re: [SOLVED] chromium does not compile with gcc 10

loqs wrote:

Clang compiler using c++ stdlib provided by gcc.  See the commit linked after my Edit2 to post #4 I think that should fix the build failure you encountered.  See the links following that if you encounter other build failure after applying that fix.

Really appreciated the help loqs. Thanks again.

Offline

Board footer

Powered by FluxBB