Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 773556 - sys-devel/llvm-11.0.1 fails tests when compiled with clang
Summary: sys-devel/llvm-11.0.1 fails tests when compiled with clang
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
Depends on:
Reported: 2021-03-01 11:08 UTC by Paolo Pedroni
Modified: 2021-04-02 18:07 UTC (History)
2 users (show)

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

llvm-11.0.1:20210301-095647.log.gz (llvm-11.0.1:20210301-095647.log.gz,813.45 KB, application/gzip)
2021-03-01 11:08 UTC, Paolo Pedroni

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Pedroni 2021-03-01 11:08:19 UTC
Created attachment 688872 [details]

When I compiled llvm with gcc all tests ran fine. Now, with clang:
Failed Tests (8):
  LLVM :: ExecutionEngine/MCJIT/eh-lg-pic.ll
  LLVM :: ExecutionEngine/MCJIT/eh.ll
  LLVM :: ExecutionEngine/MCJIT/multi-module-eh-a.ll
  LLVM :: ExecutionEngine/MCJIT/remote/eh.ll
  LLVM :: ExecutionEngine/OrcMCJIT/eh-lg-pic.ll
  LLVM :: ExecutionEngine/OrcMCJIT/eh.ll
  LLVM :: ExecutionEngine/OrcMCJIT/multi-module-eh-a.ll
  LLVM :: ExecutionEngine/OrcMCJIT/remote/eh.ll

Testing Time: 216.04s
  Unsupported      : 13785
  Passed           : 24597
  Expectedly Failed:    61
  Failed           :     8
FAILED: CMakeFiles/check-all

Details are in the attached build log.

# emerge --info =sys-devel/llvm-11.0.1
Portage 3.0.13 (python 3.8.7-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-9.3.0, glibc-2.32-r7, 5.10.18-gentoo x86_64)
                         System Settings
System uname: Linux-5.10.18-gentoo-x86_64-Intel-R-_Core-TM-_i5-8400_CPU_@_2.80GHz-with-glibc2.2.5
KiB Mem:    16055264 total,    219880 free
KiB Swap:   16777212 total,  15192572 free
Timestamp of repository gentoo: Mon, 01 Mar 2021 09:30:01 +0000
Head commit of repository gentoo: 90169acaf310a7464980e089574f116b3b2ce242
sh dash
ld GNU gold (Gentoo 2.35.1 p2 2.35.1) 1.16
distcc 3.3.3 x86_64-pc-linux-gnu [disabled]
ccache version 4.1 [disabled]
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-r6::gentoo, 3.8.7-r1::gentoo, 3.9.1-r1::gentoo
dev-util/ccache:          4.1::gentoo
dev-util/cmake:           3.18.5::gentoo
sys-apps/baselayout:      2.7::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
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

    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24

    location: /usr/local/portage
    masters: gentoo
    priority: 0

CFLAGS="-O2 -pipe -frecord-gcc-switches -march=skylake -mabm -ftree-vectorize -flto=6"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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"
CXXFLAGS="-O2 -pipe -frecord-gcc-switches -march=skylake -mabm -ftree-vectorize -flto=6"
EMERGE_DEFAULT_OPTS="--keep-going y --with-bdeps y"
FCFLAGS="-O2 -pipe -frecord-gcc-switches -march=skylake -mabm -ftree-vectorize -flto=6"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup compress-build-logs config-protect-if-modified distlocks ebuild-locks ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign split-elog split-log strict strict-keepdir test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -frecord-gcc-switches -march=skylake -mabm -ftree-vectorize -flto=6"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -ftree-vectorize -flto=6"
LINGUAS="it it_IT"
MAKEOPTS="-j7 -l6"
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"
USE="X a52 aac aalib acl acpi activities adns alsa amd64 ao audiofile bash-completion bluetooth branding brotli bzip2 cairo caps cdda cddb cdparanoia cdr cli crypt css cups curl dbus declarative dga djvu dri dts dvd dvdr emboss encode exif expat fbcon ffmpeg fftw flac fontconfig foomaticdb fortran ftp gd gdbm geoip gif gimp gmp gnutls gphoto2 gpm graphviz gtk gui handbook iconv icu idn imagemagick imlib introspection ipv6 java javascript jbig jemalloc jpeg jpeg2k kde kipi kwallet lame lcms libass libglvnd libnotify libsamplerate libtirpc lm_sensors lua lzma lzo mad mmap mng mp3 mp4 mpeg mplayer multilib musicbrainz ncurses nls nptl nsplugin offensive ogg openal opengl openmp pam pango pcre pdf phonon plasma png policykit postscript ppds pulseaudio qml qt5 rdesktop readline recode samba sctp sdl seccomp sndfile sockets speex spell split-usr sqlite ssl startup-notification svg symlink syslog systemd sysvipc taglib telemetry test theora threads tidy tiff truetype udev udisks unicode upower usb vaapi vala verify-sig vim-syntax vnc vorbis wavpack wayland widgets win32codecs wmf wxwidgets x264 xattr xcb xine xml xpm xscreensaver xv xvid yahoo zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="hda-intel virmidi" 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" CAMERAS="ptp2" 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" CURL_SSL="gnutls" 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="libinput" KERNEL="linux" L10N="it en" 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" RUBY_TARGETS="ruby26" 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"

                        Package Settings

sys-devel/llvm-11.0.1::gentoo was built with the following:
USE="gold libffi ncurses xml -debug -doc -exegesis -libedit -test -xar -z3" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="AMDGPU BPF NVPTX (X86) -AArch64 (-ARC) -ARM -AVR -Hexagon -Lanai -MSP430 -Mips -PowerPC -RISCV -Sparc -SystemZ (-VE) -WebAssembly -XCore"
CFLAGS="-O2 -pipe -frecord-gcc-switches -march=skylake -ftree-vectorize -flto=thin"
CXXFLAGS="-O2 -pipe -frecord-gcc-switches -march=skylake -ftree-vectorize -flto=thin"
FEATURES="cgroup compress-build-logs distlocks sign unmerge-orphans unknown-features-warn strict usersandbox preserve-libs protect-owned ebuild-locks userfetch network-sandbox assume-digests news sfperms config-protect-if-modified binpkg-docompress parallel-fetch userpriv sandbox split-log unmerge-logs strict-keepdir ipc-sandbox split-elog usersync qa-unresolved-soname-deps pid-sandbox xattr merge-sync binpkg-dostrip binpkg-logs multilib-strict"
LDFLAGS="-Wl,-O2 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common -ftree-vectorize -fuse-ld=lld -flto=thin"

# emerge -1pqv =sys-devel/llvm-11.0.1
[ebuild   R   ] sys-devel/llvm-11.0.1  USE="gold libffi ncurses test* xml -debug -doc -exegesis -libedit -xar -z3" ABI_X86="(64) -32 (-x32)" LLVM_TARGETS="AMDGPU BPF NVPTX (X86) -AArch64 (-ARC) -ARM -AVR -Hexagon -Lanai -MSP430 -Mips -PowerPC -RISCV -Sparc -SystemZ (-VE) -WebAssembly -XCore"
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-03-01 23:05:12 UTC
What's your current libc++ version?  Could you try installing the new one (with 'untested' LLVM) and then trying to rebuild LLVM with tests?
Comment 2 Paolo Pedroni 2021-03-02 09:51:40 UTC
(In reply to Michał Górny from comment #1)
> What's your current libc++ version?  Could you try installing the new one
> (with 'untested' LLVM) and then trying to rebuild LLVM with tests?

$ equery l libcxx
 * Searching for libcxx ...
[IP-] [  ] sys-libs/libcxx-11.0.1:0

$ equery l libcxx -p
 * Searching for libcxx ...
[-P-] [  ] sys-libs/libcxx-9.0.1:0
[-P-] [  ] sys-libs/libcxx-10.0.1:0
[-P-] [  ] sys-libs/libcxx-11.0.0:0
[IP-] [  ] sys-libs/libcxx-11.0.1:0
[-P-] [ ~] sys-libs/libcxx-11.1.0:0
[-P-] [ -] sys-libs/libcxx-12.0.0_rc1:0
[-P-] [ -] sys-libs/libcxx-12.0.0_rc2:0
[-P-] [ -] sys-libs/libcxx-
[-P-] [ -] sys-libs/libcxx-

Do you mean 11.1.0 or 12.0.0_rc?
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-03-02 12:44:06 UTC
Nah, I meant 11.0.1.  So it's not a version incompatibility.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-03-02 13:01:09 UTC
I'm afraid I can't help you here, unless you are able to figure it out yourself.  A good first step would be to try to reproduce with  You may want to choose a single revision and set EGIT_COMMIT for all packages to avoid inconsistency-due-to-fetch-delay.
Comment 5 Paolo Pedroni 2021-03-02 14:28:47 UTC
With (Commit 955365524aeea122243cb8ef201cd2687e7694b4) and corresponding libcxx and libcxxabi, I get:

Failed Tests (14):
  LLVM-Unit :: IR/./IRTests/CGSCCCallbacksTest.InstrumentedInvalidatingPasses
  LLVM-Unit :: IR/./IRTests/CGSCCCallbacksTest.InstrumentedPasses
  LLVM-Unit :: IR/./IRTests/CGSCCCallbacksTest.InstrumentedSkippedPasses
  LLVM-Unit :: IR/./IRTests/FunctionCallbacksTest.InstrumentedPasses
  LLVM-Unit :: IR/./IRTests/FunctionCallbacksTest.InstrumentedSkippedPasses
  LLVM-Unit :: IR/./IRTests/LoopCallbacksTest.InstrumentedInvalidatingLoopNestPasses
  LLVM-Unit :: IR/./IRTests/LoopCallbacksTest.InstrumentedInvalidatingPasses
  LLVM-Unit :: IR/./IRTests/LoopCallbacksTest.InstrumentedPasses
  LLVM-Unit :: IR/./IRTests/LoopCallbacksTest.InstrumentedSkippedPasses
  LLVM-Unit :: IR/./IRTests/ModuleCallbacksTest.InstrumentedSkippedPasses
  LLVM :: ExecutionEngine/MCJIT/eh-lg-pic.ll
  LLVM :: ExecutionEngine/MCJIT/eh.ll
  LLVM :: ExecutionEngine/MCJIT/multi-module-eh-a.ll
  LLVM :: ExecutionEngine/MCJIT/remote/eh.ll

So half of the problem has been 'solved', but new failures have emerged.

Unless you have new suggestions, I think I'll stop here, I don't have the skills to go any further on my own.

Thanks anyway.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-03-02 14:40:32 UTC
As I said, I'm currently unable to dedicate any time into this.  We don't really have the capacity to provide first-class support for clang builds with all their intricacies and the problem is really hard because clang's Linux backend is basically a big heap of hacks for different setups.

I'm not going to ask you to dig any further.  If you even managed to find the root cause, I can't give you any guarantees that someone will fix it upstream.

This could also be related to your CFLAGS.