Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 590328 - www-client/chromium-53.0.2785.34[gn] fails to build with clang
Summary: www-client/chromium-53.0.2785.34[gn] fails to build with clang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-02 19:11 UTC by Dominik Strehlke
Modified: 2016-09-11 17:47 UTC (History)
0 users

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


Attachments
build.log (build.log,200.92 KB, text/x-log)
2016-08-02 19:11 UTC, Dominik Strehlke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Strehlke 2016-08-02 19:11:18 UTC
Created attachment 442312 [details]
build.log

When building chromium with gn and clang the process dies in the ebuild's configure step after successfully bootstrapping gn with several error messages as follow (a bit further down).

It seems that gn is looking for the bundled clang binaries that are not included in the archive. As we want to use the local system's binaries anyway we will have to tell gn where to look for the clang executables, which is done via the clang_base_path variable. As gn is looking for $clang_base_path/bin/clang, I set clang_base_path to /usr and the compiler is found. Still the build fails, because if using the local system's clang executables, one has to disable usage of the clang chrome plugins (they just seem to be there to enforce coding standards so it won't hurt to disable them for non-devs, see https://chromium.googlesource.com/chromium/src/+/master/docs/clang.md#Using-a-custom-clang-binary.
This is achieved via setting clang_use_chrome_plugins=false.

So in the ebuild I added to myconf_gn:
"clang_base_path=\"/usr\" clang_use_chrome_plugins=false"

With this change chromium is building fine. As in the current state the ebuild does not enable building chromium with gn and clang while leaving the impression that it wants to be clang compatible (is_clang=true is correctly evaluated and included) and has gn unmasked in the current version, it should be modified to make building possible in this combination.

I don't know if my change is very wise, I would have included some abstraction of the hard "/usr" string, but I didn't know how to do it, maybe someone has a better idea here.

For the sake of completeness I am including the error message produced by the current ebuild, my emerge --info and the build.log file.

FAILED: obj/base/base_paths/base_paths_posix.o 
../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/base/base_paths/base_paths_posix.o.d -DV8_DEPRECATION_WARNINGS -DENABLE_MDNS=1 -DENABLE_NOTIFICATIONS -DENABLE_PEPPER_CDMS -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_UDEV -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_CLIPBOARD_AURAX11=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DENABLE_WEBRTC=1 -DDISABLE_NACL -DENABLE_EXTENSIONS=1 -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DUSE_PROPRIETARY_CODECS -DENABLE_HANGOUT_SERVICES_EXTENSION=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DCR_CLANG_REVISION=274142-1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBASE_IMPLEMENTATION -I../.. -Igen -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -fcolor-diagnostics -fdebug-prefix-map=/var/tmp/portage/www-client/chromium-53.0.2785.34/work/chromium-53.0.2785.34=. -pthread -m64 -march=x86-64 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -O2 -fno-ident -fdata-sections -ffunction-sections -g0 -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -Xclang -plugin-arg-find-bad-constructs -Xclang check-implicit-copy-ctors -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Wexit-time-destructors -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -fno-rtti -fno-exceptions -c ../../base/base_paths_posix.cc -o obj/base/base_paths/base_paths_posix.o
/bin/sh: ../../third_party/llvm-build/Release+Asserts/bin/clang++: No such file or directory

emerge --info =www-client/chromium-53.0.2785.34
Portage 2.3.0 (python 2.7.12-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-5.4.0, glibc-2.23-r2, 4.7.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.7.0-gentoo-x86_64-Intel-R-_Core-TM-_i7-3632QM_CPU_@_2.20GHz-with-gentoo-2.2
KiB Mem:     8006536 total,    756620 free
KiB Swap:   16777212 total,  16777116 free
Timestamp of repository gentoo: Mon, 01 Aug 2016 23:30:01 +0000
sh bash 4.3_p46
ld GNU gold (Gentoo 2.26.1 p1.0 2.26.1) 1.11
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p46::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo
dev-util/cmake:           3.6.1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2-r1::gentoo
sys-apps/openrc:          0.21.3::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo
sys-devel/gcc:            5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=native -O2 -flto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.3/conf"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXX="clang++"
CXXFLAGS="-march=native -O2 -flto"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://gentoo.imj.fr/pub/gentoo/ http://gentoo.modulix.net/gentoo/ http://mirror.qubenet.net/mirror/gentoo/ http://91.121.188.201/gentoo-distfiles/ ftp://ftp.free.fr/mirrors/ftp.gentoo.org/"
LANG="en_US"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -flto -Wl,-O3 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac aalib acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr clang cli consolekit cracklib crypt cups custom-cflags cxx dbus declarative dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran gcj gdbm gif glamor gn gold gtk iconv icu ipv6 jpeg kde kipi lcms ldap libcaca libnotify mad mbim mmx mmxext mng modemmanager modules mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt3support qt4 qt5 readline sdl seccomp semantic-desktop session spell sse sse2 ssl startup-notification svg symlink tcpd tiff touchpad truetype udev udisks unicode upower usb vorbis wayland widgets wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="synaptics evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2016-08-03 19:38:50 UTC
Thanks for the report!

I landed https://gitweb.gentoo.org/repo/gentoo.git/commit/www-client/chromium?id=9ba81cafcad5753ea8cdc3ee7615187a30128f92 but unfortunately I'm still hitting some errors e.g. with 54.0.2810.2 :

warning: unknown warning option '-Wno-undefined-var-template'; did you mean '-Wno-undefined-internal'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-nonportable-include-path'; did you mean '-Wno-gnu-include-next'? [-Wunknown-warning-option]
Comment 2 Mike Gilbert gentoo-dev 2016-08-03 20:32:10 UTC
(In reply to Paweł Hajdan, Jr. from comment #1)

That escaping is pretty ugly.

Do you mind if I convert some of the string variables in the chromium ebuild into bash arrays? They look so much cleaner and are easier to work with.
Comment 3 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2016-08-03 20:41:35 UTC
(In reply to Mike Gilbert from comment #2)
> That escaping is pretty ugly.
> 
> Do you mind if I convert some of the string variables in the chromium ebuild
> into bash arrays? They look so much cleaner and are easier to work with.

Go ahead. :)
Comment 4 Dominik Strehlke 2016-08-03 20:49:16 UTC
(In reply to Paweł Hajdan, Jr. from comment #1)
> Thanks for the report!
> 
> I landed
> https://gitweb.gentoo.org/repo/gentoo.git/commit/www-client/
> chromium?id=9ba81cafcad5753ea8cdc3ee7615187a30128f92 but unfortunately I'm
> still hitting some errors e.g. with 54.0.2810.2 :
> 
> warning: unknown warning option '-Wno-undefined-var-template'; did you mean
> '-Wno-undefined-internal'? [-Wunknown-warning-option]
> warning: unknown warning option '-Wno-nonportable-include-path'; did you
> mean '-Wno-gnu-include-next'? [-Wunknown-warning-option]

Ummm you say you're hitting errors, but what you pasted are warnings right? :-) Those warnings seem to come up every time when compiling with clang, I already had those when building with gyp and got perfectly working chromium packages.

IF this is a bug, it's probably upstream and does not have anything to do with this particular bug, as those warnings were already thrown without gn.
Comment 5 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2016-08-21 19:09:33 UTC
Ah, you're right. This is the real error - with chromium-54.0.2832.2 and clang-3.8.1-r100 .

../../services/ui/public/cpp/gles2_context.cc:52:37: error: default initialization of an object of const type 'const gpu::SharedMemoryLimits' without a user-provided default constructor
  constexpr gpu::SharedMemoryLimits default_limits;
                                    ^
                                                  {}
2 warnings and 1 error generated.
Comment 6 Dominik Strehlke 2016-08-21 19:37:32 UTC
Yes, I was getting that as well. It was easy to fix by adding a default constructor in the mentioned header file. Still, in a gyp based build this error does not occur.

Also, the generated binary from my gn build proved to be extremely unstable, being unresponsive after a few minutes. Of course, I cannot say if that is the result of my "fix" of that header that produced the error, but still the error is very weird.

Have you tried the gn build with a currect preview version of clang? Anyway, llvm 3.9 should be released tomorrow and I will try the gn build again as soon as it's there.
Comment 7 iGentoo 2016-08-30 03:23:13 UTC
(In reply to Paweł Hajdan, Jr. from comment #5)
> Ah, you're right. This is the real error - with chromium-54.0.2832.2 and
> clang-3.8.1-r100 .
> 
> ../../services/ui/public/cpp/gles2_context.cc:52:37: error: default
> initialization of an object of const type 'const gpu::SharedMemoryLimits'
> without a user-provided default constructor
>   constexpr gpu::SharedMemoryLimits default_limits;
>                                     ^
>                                                   {}
> 2 warnings and 1 error generated.

services/ui/public/cpp/gles2_context.cc
services/ui/surfaces/surfaces_context_provider.cc

could be built with clang-3.9 without *constexpr* error.
Comment 8 Dominik Strehlke 2016-09-11 17:47:04 UTC
My original reported bug was fixed. Pawel's first commit fixed it all.

The warnings that still came up had nothing to do with this and disappeared with LLVM 3.9.

The issue that remains is the unstable binary but that is being addressed in bug 591938 already.

I'm closing this as my issue is fixed.