Summary: | www-client/chromium-91.0.4472.19 fails to build with gcc-11/clang-13: ../../sql/recover_module/cursor.h:65:5: error: static_assert failed due to requirement 'std::is_standard_layout<sql::recover::VirtualCursor>::value' "needed for the reinterpret_cast bel | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Patrick McLean <chutzpah> |
Component: | Current packages | Assignee: | Chromium Project <chromium> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ago, gem, gentoo, gl, ibuyandtrade0+bugs.gentoo.org, jasmin+gentoo, jouni.kosonen, mike, opal, sam, voron1 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://chromium-review.googlesource.com/c/chromium/src/+/2862724 | ||
See Also: | https://chromium-review.googlesource.com/c/chromium/src/+/4292313 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 408963, 732706 | ||
Attachments: |
build.log
chromium gcc11 patch chromium-VirtualCursor-standard-layout chromium libdav1d (needed for lto) |
Description
Patrick McLean
2021-04-29 01:10:19 UTC
Created attachment 703512 [details]
build.log
zstd-compressed build.log
# emerge --info www-client/chromium Portage 3.0.18 (python 3.9.4-final-0, default/linux/amd64/17.1, gcc-11.1.0, glibc-2.33, 5.12.0 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-5.12.0-x86_64-AMD_Ryzen_9_5950X_16-Core_Processor-with-glibc2.33 KiB Mem: 65820436 total, 14364216 free KiB Swap: 16777212 total, 16184572 free Timestamp of repository gentoo: Wed, 28 Apr 2021 23:45:01 +0000 Head commit of repository gentoo: 45169ce50aa86c2acef85491690ee3485bd37a85 sh bash 5.1_p4 ld GNU ld (Gentoo 2.36.1 p3) 2.36.1 app-shells/bash: 5.1_p4::gentoo dev-lang/perl: 5.32.1::gentoo dev-lang/python: 2.7.18_p8::gentoo, 3.8.9::gentoo, 3.9.4::gentoo, 3.10.0_alpha7::gentoo dev-lang/rust: 1.51.0-r2::gentoo dev-util/cmake: 3.20.1::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.7-r2::gentoo sys-apps/openrc: 0.42.1-r1::gentoo sys-apps/sandbox: 2.23::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.16.3-r1::gentoo sys-devel/binutils: 2.36.1-r1::gentoo sys-devel/gcc: 10.3.0::gentoo, 11.1.0::gentoo sys-devel/gcc-config: 2.4::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.12::gentoo (virtual/os-headers) sys-libs/glibc: 2.33::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://localhost:8730/gentoo-portage priority: -1000 sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 sync-rsync-extra-opts: sync-rsync-verify-metamanifest: yes ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=znver3 -pipe -g" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/chromium/pepper-flash /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -march=znver3 -pipe -g" DISTDIR="/var/cache/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" INSTALL_MASK="/usr/lib/systemd/system /lib/systemd/system /etc/logrotate.d /etc/systemd /var/lib/libvirt/images/" LANG="en_CA.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en_CA en_GB en_US en" MAKEOPTS="-j35 -l31" PKGDIR="/var/cache/packages" PORTAGE_COMPRESS="zstd" PORTAGE_COMPRESS_FLAGS="--rm -7 --threads=0 --quiet" 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" RUSTFLAGS="-C target-cpu=znver2 -v" USE="X aac acl acpi amd64 apng argyllcms avx bash-completion bluetooth brotli bzip2 cairo caps cli crypt cups curl dbus device-mapper dri dvd egl elogind exif ffmpeg fftw flac fuse gif git gles gmp gnome-keyring gpm gtk iconv ipv6 ithreads jbit jpeg jpeg2k lcms libffi libglvnd libinput libnotify libtirpc lm-sensors lzma lzo mad mmap mmx mmxext mng mp3 mtp multilib ncurses networking nptl ogg openal opencl opengl openmp openssl opus pam pcap pcre pdf png pnm policykit pulseaudio python readline seccomp sndfile speex spell spice split-usr sqlite sse sse2 sse3 sse4_1 ssl ssse3 startup-notification svg theora threads tiff truetype udev unicode upower usb usbredir vaapi vdpau vim vim-syntax vorbis vpx vulkan wayland webp x264 x265 xattr xcb xinerama xmp xorg xv zlib zsh-completion zstd" ABI_X86="32 64" ADA_TARGET="gnat_2018" 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput evdev" KERNEL="linux" L10N="en-CA en-GB en-US en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8 python3_9 pypy3" RUBY_TARGETS="ruby27 ruby30" SANE_BACKENDS="genesys" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XFCE_PLUGINS="clock" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS ================================================================= Package Settings ================================================================= www-client/chromium-90.0.4430.85::gentoo was built with the following: USE="cups custom-cflags hangouts (pic) proprietary-codecs pulseaudio suid system-ffmpeg system-icu tcmalloc vaapi wayland widevine (-component-build) (-headless) -js-type-check -kerberos -official -screencast (-selinux)" ABI_X86="(64)" L10N="en-GB -am -ar -bg -bn -ca -cs -da -de -el -es -es-419 -et -fa -fi -fil -fr -gu -he -hi -hr -hu -id -it -ja -kn -ko -lt -lv -ml -mr -ms -nb -nl -pl -pt-BR -pt-PT -ro -ru -sk -sl -sr -sv -sw -ta -te -th -tr -uk -vi -zh-CN -zh-TW" CFLAGS="-march=znver2 -pipe" CXXFLAGS="-march=znver2 -pipe" Are you using gcc-11 libstdc++ with clang-12? (In reply to Stephan Hartmann from comment #3) > Are you using gcc-11 libstdc++ with clang-12? Yes, I believe that is that would be the current default for ~arch users (at least those that have gcc-11 set as their default compiler). Problem is here: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/sql/recover_module/cursor.h#132 Simple reproducer: #include <type_traits> #include <memory> static_assert(std::is_standard_layout<std::unique_ptr<int>>::value, ""); However, std::unique_ptr<T> is not guaranteed to be standard layout and depends on the __is_standard_layout() intrinsic implementation of the compiler. Looking what upstream says. For now you can only select <gcc-11 to compile chromium with clang. 91.0.4472.164 also fails. I just built www-client/chromium-92.0.4515.107, no problems with gcc 11. www-client/chromium-91.0.4472.19 is no longer in the tree. Maybe time to close this as obsolete? (In reply to Gary E. Miller from comment #7) > I just built www-client/chromium-92.0.4515.107, no problems with gcc 11. > > www-client/chromium-91.0.4472.19 is no longer in the tree. > > Maybe time to close this as obsolete? Thanks! Reopening. Chromium compiles with gcc-11, but it doesn't compile using clang together with libstdc++ from >=gcc-11. Upstream bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1189788 Patch for clang 12 with libc++ from gcc 11: https://chromium-review.googlesource.com/c/chromium/src/+/2862724 Note that this patch seems not to work on Chromium 94, though I haven't test it yet. Chromium 91 and 92 should work with this patch. (In reply to gentoo@imrebuild.com from comment #10) > Patch for clang 12 with libc++ from gcc 11: > https://chromium-review.googlesource.com/c/chromium/src/+/2862724 My mistake. Should be libstdc++ instead of libc++. I saw some people said building Chromium and its dependencies with clang and libc++ don't have this problem. I didn't try this way so I can't confirm. I'm building Chromium with the following thee patches, which gives a working browsers with Clang 12 & libstdc++ from gcc 11 Created attachment 732877 [details, diff]
chromium gcc11 patch
Created attachment 732880 [details, diff]
chromium-VirtualCursor-standard-layout
Created attachment 732883 [details, diff]
chromium libdav1d (needed for lto)
We want to stabilize gcc-11 now. Is this still an issue? (In reply to Andreas K. Hüttel from comment #16) > We want to stabilize gcc-11 now. Is this still an issue? Yes. I had no time to work an this. (In reply to Andreas K. Hüttel from comment #16) > We want to stabilize gcc-11 now. Is this still an issue? Yes. I had no time to work an this. Ping. Not going to wait much longer. It it worth just running with the patch posted in August? I just hit this. Chromium-95, building with clang-12, gcc-11 is the default compiler. Applying the 3 patches from this bug (attachments 732877, 732880 and 732883) fixed it up. Additionally I'd like to bring this up:
> Gerd Röthig
> New information (in the hope that at least someone still reads here):
> This bug only seems to affect debug builds.
> If you compile chromium with 'is_official_build=true' and 'is_debug=false', the
> error does not occur.
This is weird, because I build chromium with USE="official -debug". So according to Gerd, the issue shouldn't occur at all.
^ Quote from: https://chromium-review.googlesource.com/c/chromium/src/+/2862724/3#message-8ae9abc7874c30518e2eb62032d43b0768140904 (In reply to Michael from comment #21) > I just hit this. Chromium-95, building with clang-12, gcc-11 is the default > compiler. I just hit this with chromium-96, clang-13 (and 12), gcc-11 and [-official, -debug]. I seem to have built chromium-95 successfully with those August patches, will try that next. *** Bug 832091 has been marked as a duplicate of this bug. *** The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c65f1fb18943313a621d8cce43d0a68ebf65d2f4 commit c65f1fb18943313a621d8cce43d0a68ebf65d2f4 Author: Stephan Hartmann <sultan@gentoo.org> AuthorDate: 2022-01-30 08:36:59 +0000 Commit: Stephan Hartmann <sultan@gentoo.org> CommitDate: 2022-01-30 08:37:35 +0000 www-client/chromium: dev channel bump to 99.0.4844.11 - improve headless builds - fix cross compiling - remove CHROMIUM_FORCE_LIBCXX and add USE=libcxx instead - allow building with GTK4 Bug: https://bugs.gentoo.org/786597 Bug: https://bugs.gentoo.org/828442 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Stephan Hartmann <sultan@gentoo.org> www-client/chromium/Manifest | 4 +- ....4840.0.ebuild => chromium-99.0.4844.11.ebuild} | 242 +++++++++++++-------- .../chromium/files/chromium-cross-compile.patch | 12 + www-client/chromium/metadata.xml | 2 + 4 files changed, 162 insertions(+), 98 deletions(-) This should block systemwide-clang tracker. Still getting > FAILED: obj/sql/sql/cursor.o > In file included from ../../sql/recover_module/cursor.cc:5: and > FAILED: obj/sql/sql/table.o > ... > In file included from ../../sql/recover_module/table.cc:11: for this assertion: > ../../sql/recover_module/cursor.h:66:5: error: static_assert failed due to requirement 'std::is_standard_layout<sql::recover::VirtualCursor>::value' "needed for the reinterpret_cast below" > static_assert(std::is_standard_layout<VirtualCursor>::value, > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 1 error generated. with chromium-100.0.4896.60[-official, -debug] if I try to compile it with gcc-11.2.1_p20220115, clang-13.0.1 and without the August 2021 patches by Mike. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69e77349aab3df49cfdc8aa9dffa5f7c4967a4f1 commit 69e77349aab3df49cfdc8aa9dffa5f7c4967a4f1 Author: Stephan Hartmann <sultan@gentoo.org> AuthorDate: 2022-05-13 14:18:07 +0000 Commit: Stephan Hartmann <sultan@gentoo.org> CommitDate: 2022-05-13 14:18:32 +0000 www-client/chromium: dev channel bump to 103.0.5056.0 Bug: https://bugs.gentoo.org/786597 Signed-off-by: Stephan Hartmann <sultan@gentoo.org> www-client/chromium/Manifest | 4 ++-- .../{chromium-103.0.5042.0.ebuild => chromium-103.0.5056.0.ebuild} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Fixed in chromium-103 Patch not merged upstream. But it was, apparently, fixed in some other way, because it builds fine. (In reply to Michael from comment #32) > But it was, apparently, fixed in some other way, because it builds fine. Yes, it's fixed in Gentoo, but sultan wants to keep the bug open until it's upstreamed, to avoid Gentoo's patchset growing forever. You can see Gentoo's patches at https://github.com/stha09/chromium-patches. (In reply to Stephan Hartmann from comment #31) > Patch not merged upstream. There's been a request for changes to your CL [1]. Seems upstream would be willing to merge it once those are done. (Not sure if there's a reason you haven't followed up, but posting in case you just missed it.) [1] chromium-review.googlesource.com/c/chromium/src/+/2862724 Is this done with https://chromium-review.googlesource.com/c/chromium/src/+/4292313? (In reply to Sam James from comment #35) > Is this done with It now builds for me without the VirtualCursor-standard-layout patch, at least in Debian with chromium 115. |