-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Using the complete LLVM toolchain system wide in Gentoo is not standard. Knowledge on how to troubleshoot various Portage phase errors is important. The key phases are configuring, compiling, testing, and installing. Any one of these phases can fail when straying off the standard Gentoo configuration.
This page will cover how to troubleshoot and also document packages with problems. Some errors are not going to be universal since Gentoo is capable of being tailored to different uses. What may affect one machine might not affect another.
If a package failed to emerge, take note of the phase it failed at. Did it fail at the configure phase, compile phase, or test phase? Each of these phases can fail for various reasons and troubleshooting each one takes a little finesse to find out why. When using Clang and the LLVM toolchain system wide, you will need to be able to diagnose if the failure is toolchain related or from some other cause, like a missing dependency or USE flag setting.
When the compiler fails to compile a test program it's likely the command is at fault. Check the output and see what causes it. Usually the offending command is shown.
Clang as the system wide compiler is likely not being respected in this case. This is a fairly serious issue and should be reported on the bug tracker. There probably isn't much of this these days but in the case there is, it's necessary to report.
Solution:
- If the ebuild is at fault, use a local ebuild
- If the source is at fault, use a local patch
- Regardless, report the offending package not respecting the chosen system compiler
Check the ebuild for any specific flag overriding. Most normal people don't use flags beyond -march
and -O
. This isn't a normal system and uses flags like -fvirtual-function-elimination
which can cause a test program to fail if -flto
was filtered out by the ebuild. Gentoo developers are not going to expect users to use Clang only -flto
flags and aren't likely to write flag filtering to take care of those.
Ricer solution:
- Use the workaround
_FLAG_O_MATIC_ECLASS=1
- Use a local ebuild if the workaround doesn't work
- Use a local patch if the source itself is altering system flag settings
The workaround _FLAG_O_MATIC_ECLASS=1
works most of the time, but sometimes altering an offending ebuild is necessary. Worst case scenario is the filtering occurring in the actual source. For example, x11-base/xorg-server
has the -flto
flag and GCC link-time optimization related flags such as -fuse-linker-plugin
filtered in the test sources. Since it doesn't filter Clang related link-time optimization flags, a compile phase error happens when the compiling the test code to be run during the test phase because -fvirutal-function-elimination
requires -flto
, and hasn't been filtered.
Proper solution:
- Remove the offending flags and trust the developers to remove harmful flags as the ebuilds dictate
This is the proper way to handle things. It's possible to make an appeal to the maintainer to remove the flag filtering if it's possible to prove the built package behaves properly.
The following is a personal list of packages with various issues. The list is broken down into phases. The goal is for these issues to be documented, reported, and fixed regardless of whether they are Clang only or not.
-
kde-apps/kio-extras
configure phase fails withUSE="-X"
; not reported -
kde-frameworks/kinit
configure phase fails withUSE="-X"
; not reported -
kde-frameworks/kio
configure phase fails withUSE="-X"
; not reported -
kde-plasma/libksysguard
configure phase fails withUSE="-X"
; not reported -
kde-plasma/plasma-pa
configure phase fails withmedia-sound/pulseaudio[-glib]
; not reported
-
sys-devel/bc
compile phase fails withUSE="libedit"
; bug 830101
-
sys-devel/elftoolchain
compile phase requiressys-apps/groff
; not reported
-
app-arch/gzip
test phase fails withsys-apps/util-linux[-ncurses]
; not reported -
app-arch/lzlib
test phase fails withsys-devel/binutils-config[-native-symlinks]
; not reported -
app-arch/p7zip
test phase fails with USE="-rar"; bug 907221 -
app-crypt/p11-kit
test phase fails with USE="-libffi"; bug 691640 -
app-crypt/gcr
test phase fails withapp-cypt/gnupg[-bzip2]
; not reported -
app-crypt/gnupg
test phase fails withnet-misc/openssh[-ssl]
; bug 833148 -
app-portage/gemato
test phase fails withapp-crypt/gnupg[-ssl]
; not reported -
dev-libs/gmp
test phase fails withUSE="cxx"
; not reported -
dev-libs/libpcre2
test phase fails withUSE="jit"
; not reported -
dev-libs/openssl
test phase fails withUSE="-weak-ssl-ciphers"
; not reported -
dev-python/six
test phase fails withdev-lang/python[-gdbm]
; not reported -
dev-vcs/git
test phase fails withUSE="-iconv"
; not reported -
net-misc/wget
test phase fails withUSE="-ipv6"
; not reported
-
app-text/htmltidy
test phase requiresdev-ruby/thor
; bug 824534 -
dev-python/pillow
test phase requiressys-libs/zlib
; not reported -
dev-python/pycurl
test phase requiresdev-python/bottle
; not reported -
dev-python/pygobject
test phase requiresdev-python/pycairo
; not reported -
dev-ruby/mini_portile
test phase requiresdev-ruby/thor
; not reported -
sys-fs/fuse
test phase requiresapp-misc/hello
; not reported -
sys-fs/fuse
test phase requiresdev-python/looseversion
; not reported -
sys-devel/elftoolchain
test phase requiressys-apps/groff
; not reported -
sys-libs/libblockdev
test phase requiresapp-admin/sudo
; not reported -
x11-libs/pango
test phase requiresmedia-fonts/cantarell
; bug 816378
-
dev-libs/elfutils
not reported
-
dev-libs/double-conversion
not reported -
dev-libs/libfmt
not reported
-
app-crypt/gcr
not reported -
app-crypt/libsecret
not reported -
app-portage/gemato
not reported -
app-shells/fish
not reported -
app-text/docbook-xsl-stylesheets
not reported -
dev-libs/libnl
bug 840167 -
dev-libs/newt
not reported -
dev-util/cmake
not reported -
dev-util/gtk-doc
not reported -
dev-util/umockdev
not reported -
x11-libs/pango
bug 836317