Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 777147 - dev-qt/qtwebengine-5.15.2_p20210224 fails to build with clang
Summary: dev-qt/qtwebengine-5.15.2_p20210224 fails to build with clang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-19 07:40 UTC by Richard H.
Modified: 2022-01-14 15:12 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard H. 2021-03-19 07:40:17 UTC
I have build qtwebengine with clang for quite a while now, but in updating it I get a build error.

Reproducible: Always

Steps to Reproduce:
1. Set up your system for CLang
2. Try to build the newest qtwebengine
3. Error.
Actual Results:  
build output (cropped)

ulimit -n 4096 && clang++ -Wl,-O1 -Wl,--as-needed @/tmp/portage/dev-qt/qtwebengine-5.15.2_p20210224/work/qtwebengine-5.15.2_p20210224_build/src/core/release/QtWebEngineCore_o.rsp -Wl,--start-group @/tmp/portage/dev-qt/qtwebengine-5.15.2_p20210224/work/qtwebengine-5.15.2_p20210224_build/src/core/release/QtWebEngineCore_a.rsp -Wl,--end-group -Wl,-z,noexecstack -Wl,--build-id=sha1 -fPIC -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -m64 -Wl,-O2 -Wl,--gc-sections -rdynamic -Wl,-O1 -Wl,--enable-new-dtags -Wl,-whole-archive -lqtwebenginecoreapi -Wl,-no-whole-archive -Wl,--version-script,QtWebEngineCore.version -Wl,--enable-new-dtags -shared -Wl,-Bsymbolic-functions -Wl,-soname,libQt5WebEngineCore.so.5 -o libQt5WebEngineCore.so.5.15.2   /usr/lib64/libQt5Quick.so /usr/lib64/libQt5Gui.so /usr/lib64/libQt5QmlModels.so /usr/lib64/libQt5WebChannel.so /usr/lib64/libQt5Qml.so /usr/lib64/libQt5Network.so /usr/lib64/libQt5Positioning.so /usr/lib64/libQt5Core.so -lpthread -lGL -lpthread -ldl -lrt -licui18n -licuuc -licudata -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -lz -levent -lresolv -ljpeg -lm -lopus -lavcodec -lavformat -lavutil -lvpx -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrender -lXrandr -lXtst -lpng16 -lwebpmux -lwebpdemux -lwebp -lfreetype -lexpat -lfontconfig -lharfbuzz-subset -lharfbuzz -lre2 -lX11-xcb -lxcb -lxkbcommon -ldbus-1 -lpci -lasound -lsnappy -lxml2 -lxslt -lminizip -llcms2 -L/tmp/portage/dev-qt/qtwebengine-5.15.2_p20210224/work/qtwebengine-5.15.2_p20210224_build/src/core/api/release -lGL   



/usr/bin/x86_64-pc-linux-gnu-ld: /tmp/portage/dev-qt/qtwebengine-5.15.2_p20210224/work/qtwebengine-5.15.2_p20210224_build/src/core/release/obj/base/base/base_jumbo_27.o: in function `base::internal::ThreadGroup::ShouldYield(base::internal::TaskSourceSortKey) const':
base_jumbo_27.cc:(.text._ZNK4base8internal11ThreadGroup11ShouldYieldENS0_17TaskSourceSortKeyE+0x41): undefined reference to `__atomic_load'
/usr/bin/x86_64-pc-linux-gnu-ld: /tmp/portage/dev-qt/qtwebengine-5.15.2_p20210224/work/qtwebengine-5.15.2_p20210224_build/src/core/release/obj/base/base/base_jumbo_28.o: in function `base::internal::ThreadGroupImpl::UpdateMinAllowedPriorityLockRequired()':
base_jumbo_28.cc:(.text._ZN4base8internal15ThreadGroupImpl36UpdateMinAllowedPriorityLockRequiredEv+0x78): undefined reference to `__atomic_store'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [Makefile.core_module:80: ../../lib/libQt5WebEngineCore.so.5.15.2] Error 1
make[3]: Leaving directory '/tmp/portage/dev-qt/qtwebengine-5.15.2_p20210224/work/qtwebengine-5.15.2_p20210224_build/src/core'
make[2]: *** [Makefile:124: sub-core_module-pro-make_first] Error 2
make[2]: Leaving directory '/tmp/portage/dev-qt/qtwebengine-5.15.2_p20210224/work/qtwebengine-5.15.2_p20210224_build/src/core'
make[1]: *** [Makefile:78: sub-core-make_first] Error 2
make[1]: Leaving directory '/tmp/portage/dev-qt/qtwebengine-5.15.2_p20210224/work/qtwebengine-5.15.2_p20210224_build/src'
make: *** [Makefile:49: sub-src-make_first] Error 2


Expected Results:  
It should merge, since earlier versions did as well.

richIx240 ~ # emerge --info
Portage 3.0.13 (python 3.8.8-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-9.3.0, glibc-2.32-r7, 5.4.80-gentoo-r1-richIx240 x86_64)
=================================================================
System uname: Linux-5.4.80-gentoo-r1-richIx240-x86_64-Intel-R-_Core-TM-_i5-4210U_CPU_@_1.70GHz-with-glibc2.2.5
KiB Mem:     7844344 total,     72436 free
KiB Swap:    8388604 total,   3460976 free
Timestamp of repository gentoo: Tue, 16 Mar 2021 07:06:09 +0000
Head commit of repository gentoo: 692f76eb4f7c7132a347d89a7c71f20e43c58f45

Head commit of repository chain: 186a3ac253f3e431c5b4c145b0e345dbb1cc0b63

Timestamp of repository dotnet: Fri, 12 Mar 2021 12:05:49 +0000
Head commit of repository dotnet: b02a6125c2c415d20397c6d41df198f8f10f32d5

sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.1 p2) 2.35.1
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18_p7::gentoo, 3.8.8::gentoo, 3.9.2::gentoo
dev-util/cmake:           3.18.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.35.1-r1::gentoo
sys-devel/gcc:            9.3.0-r2::gentoo, 10.2.0-r5::gentoo
sys-devel/gcc-config:     2.3.3::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000

chain
    location: /var/db/repos/chain
    sync-type: git
    sync-uri: https://chain@git.rpgfiction.net/portage-overlay.git
    masters: gentoo

dotnet
    location: /var/db/repos/dotnet
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/dotnet.git
    masters: gentoo

crossdev
    location: /var/db/repos/crossdev
    masters: gentoo
    priority: 10

tlp
    location: /var/db/repos/tlp
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
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 -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=y"
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 candy config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_AT.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de"
MAKEOPTS="-j4"
PKGDIR="/var/cache/binpkgs"
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="/tmp"
USE="X a52 aac acl acpi activities alsa amd64 berkdb bluetooth bluray bzip2 cairo cdda cdr clang cli crypt cups dbus declarative dri dts dvd dvdr elogind emboss encode exif flac fortran gdbm gif gpm gui iconv icu ipv6 jpeg kde kipi kwallet lcms libglvnd libnotify libtirpc mad minimal mng mp3 mp4 mpeg multilib ncurses netboot networkmanager nls nocd nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt5 readline sdl seccomp smp split-usr sse3 ssl ssse3 startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb vaapi vdpau vorbis wayland widgets wifi wxwidgets x264 xattr xcb xinerama xml xv xvid xvmc zlib" ABI_X86="64" ADA_TARGET="gnat_2018" 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="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 sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" INPUT_DEVICES="evdev synaptics void wacom" KERNEL="linux" L10N="de" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" 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" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="fbdev intel i965 modesetting" 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:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

richIx240 ~ # eix -e clang
[I] sys-devel/clang
     Verfügbare Versionen:   
     (10)   10.0.1^t
     (11)   11.0.0^t 11.0.1^t ~11.1.0(11/11.1)^t
     (12)   **12.0.0_rc2^t **12.0.0_rc3^t **12.0.0.9999*l^t
     (13)   **13.0.0.9999*l^t
       {debug default-compiler-rt default-libcxx default-lld doc +static-analyzer test xml ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32" KERNEL="FreeBSD" LLVM_TARGETS="AArch64 AMDGPU ARC ARM AVR BPF CSKY Hexagon Lanai MSP430 Mips NVPTX PowerPC RISCV Sparc SystemZ VE WebAssembly X86 XCore" PYTHON_SINGLE_TARGET="python3_7 python3_8 python3_9"}
     Installierte Versionen: 11.0.1(11)^t(21:19:08 2021-03-16)(static-analyzer xml -debug -default-compiler-rt -default-libcxx -default-lld -doc -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" KERNEL="-FreeBSD" LLVM_TARGETS="AMDGPU BPF NVPTX X86 -AArch64 -ARC -ARM -AVR -Hexagon -Lanai -MSP430 -Mips -PowerPC -RISCV -Sparc -SystemZ -VE -WebAssembly -XCore" PYTHON_SINGLE_TARGET="python3_8 -python3_7 -python3_9")
     Startseite:             https://llvm.org/
     Beschreibung:           C language family frontend for LLVM

richIx240 ~ # clang --version
clang version 11.0.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/11/bin

richIx240 ~ # eix -e llvm
[I] sys-devel/llvm
     Verfügbare Versionen:   
     (10)   10.0.1^t
     (11)   11.0.0^t 11.0.1^t ~11.1.0^t
     (12)   **12.0.0_rc2^t **12.0.0_rc3^t **12.0.0.9999*l^t
     (13)   **13.0.0.9999*l^t
       {debug doc exegesis gold libedit +libffi ncurses test xar xml z3 ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32" KERNEL="Darwin" LLVM_TARGETS="AArch64 AMDGPU ARC ARM AVR BPF CSKY Hexagon Lanai MSP430 Mips NVPTX PowerPC RISCV Sparc SystemZ VE WebAssembly X86 XCore"}
     Installierte Versionen: 11.0.1(11)^t(18:16:21 2021-03-16)(gold libffi ncurses xml -debug -doc -exegesis -libedit -test -xar -z3 ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" KERNEL="-Darwin" LLVM_TARGETS="AMDGPU BPF NVPTX X86 -AArch64 -ARC -ARM -AVR -Hexagon -Lanai -MSP430 -Mips -PowerPC -RISCV -Sparc -SystemZ -VE -WebAssembly -XCore")
     Startseite:             https://llvm.org/
     Beschreibung:           Low Level Virtual Machine
Comment 1 Jonas Stein gentoo-dev 2021-03-22 00:54:23 UTC
duplicate of 688218?
Comment 2 Richard H. 2021-03-23 09:41:20 UTC
(In reply to Jonas Stein from comment #1)
> duplicate of 688218?

Unfortunately not. But I could retrace the bug successfully. It's missing -latomic to compile successfully. It is something like this bug: https://github.com/fish-shell/fish-shell/issues/5865 unfortunately I am at an impasse here.

This bug also happens with the freshly updated clang 11.1.0 including all dependencies.

Is there a problem compiling QtWebengine using clang, or is there just something that needs to be changed on my system? I have mostly compiled my system using clang, with just a few exceptions which simply do not compile, those are listed in the tracker as well. I would be glad to be of any assistance, the affected system is not work-critical and I can do some tests (like unstable software, patches etc.).
Comment 3 Richard H. 2021-03-23 14:36:52 UTC
While digging I found this:

https://llvm.googlesource.com/openmp/+/7bd70635240f69fcd4da4d98a4aca8aaa779dd11%5E%21/

Maybe this is somehow related?
Comment 4 Jan Boysen 2021-06-23 12:04:02 UTC
(In reply to Richard H. from comment #3)
> While digging I found this:
> 
> https://llvm.googlesource.com/openmp/+/
> 7bd70635240f69fcd4da4d98a4aca8aaa779dd11%5E%21/
> 
> Maybe this is somehow related?

Yep definately related... I just stumbled over the same issue and fixed it by modifying my portag environment, so I dont have to patch the ebuild or buildsystem.

As Im only using clang selectively I have a /etc/portage/env/clang and copied it to /etc/portage/env/clang-atomic adding the Following line to it to modify the linker flags:

LDFLAGS="${LDFLAGS} -latomic"

Next I modified my existing /etc/portage/package.env/clang to use a different clang environment:

dev-qt/qtwebengine clang-atomic


definately not the cleanest way to fix it but a working workaround for the time beeing...
Comment 5 Richard H. 2021-06-23 13:06:39 UTC
(In reply to Jan Boysen from comment #4)
> (In reply to Richard H. from comment #3)
> > While digging I found this:
> > 
> > https://llvm.googlesource.com/openmp/+/
> > 7bd70635240f69fcd4da4d98a4aca8aaa779dd11%5E%21/
> > 
> > Maybe this is somehow related?
> 
> Yep definately related... I just stumbled over the same issue and fixed it
> by modifying my portag environment, so I dont have to patch the ebuild or
> buildsystem.
> 
> As Im only using clang selectively I have a /etc/portage/env/clang and
> copied it to /etc/portage/env/clang-atomic adding the Following line to it
> to modify the linker flags:
> 
> LDFLAGS="${LDFLAGS} -latomic"
> 
> Next I modified my existing /etc/portage/package.env/clang to use a
> different clang environment:
> 
> dev-qt/qtwebengine clang-atomic
> 
> 
> definately not the cleanest way to fix it but a working workaround for the
> time beeing...

Thank you that's great news! Will definitely give it a try. Right now I am using a binpkg compiled on another system which fortunately shares the CPU flags.
Comment 6 Richard H. 2021-10-27 22:58:43 UTC
(In reply to Jan Boysen from comment #4)
> (In reply to Richard H. from comment #3)
> > While digging I found this:
> > 
> > https://llvm.googlesource.com/openmp/+/
> > 7bd70635240f69fcd4da4d98a4aca8aaa779dd11%5E%21/
> > 
> > Maybe this is somehow related?
> 
> Yep definately related... I just stumbled over the same issue and fixed it
> by modifying my portag environment, so I dont have to patch the ebuild or
> buildsystem.
> 
> As Im only using clang selectively I have a /etc/portage/env/clang and
> copied it to /etc/portage/env/clang-atomic adding the Following line to it
> to modify the linker flags:
> 
> LDFLAGS="${LDFLAGS} -latomic"
> 
> Next I modified my existing /etc/portage/package.env/clang to use a
> different clang environment:
> 
> dev-qt/qtwebengine clang-atomic
> 
> 
> definately not the cleanest way to fix it but a working workaround for the
> time beeing...

I finally got around trying this. And it works! Now if this somehow could be put into the ebuild...

Since I *AM* primarily using CLang, I took a quite similar route. I created a new env with just the LDFLAGS and it worked very fine. Thank you for this suggestion!
Comment 7 Andreas Sturmlechner gentoo-dev 2021-12-01 10:16:35 UTC
Please test with 5.15.2_p20211019.
Comment 8 Richard H. 2022-01-13 13:52:19 UTC
(In reply to Andreas Sturmlechner from comment #7)
> Please test with 5.15.2_p20211019.

Sorry, it took a while for me to be able to test it. I tested it with the latest stable version, which is 5.15.2_p20211216. Worked like a charm, no more -latomic needed!
Comment 9 Andreas Sturmlechner gentoo-dev 2022-01-14 15:12:55 UTC
Thanks for checking back.