Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 500856 - sys-devel/llvm-3.4 - CMake Error at CMakeLists.txt:332 (message): Unexpected failure executing llvm-build: Usage: llvm-build [options]
Summary: sys-devel/llvm-3.4 - CMake Error at CMakeLists.txt:332 (message): Unexpected ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-10 09:36 UTC by Li Yanrui
Modified: 2014-06-11 21:14 UTC (History)
6 users (show)

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


Attachments
build.log (build.log,39.58 KB, text/plain)
2014-02-11 01:00 UTC, Li Yanrui
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Li Yanrui 2014-02-10 09:36:18 UTC
error:

-- Constructing LLVMBuild project information
CMake Error at CMakeLists.txt:332 (message):
  Unexpected failure executing llvm-build: Usage: llvm-build [options]

  

  llvm-build: error: invalid native target: 'X86' (not in project)


-- Configuring incomplete, errors occurred!
 * ERROR: sys-devel/llvm-3.4::gentoo failed (configure phase):
 *   cmake failed
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_configure
 *   environment, line 4527:  Called multilib-minimal_src_configure
 *   environment, line 3008:  Called multilib_foreach_abi 'multilib-minimal_abi_src_configure'
 *   environment, line 3214:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure'
 *   environment, line 2849:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure'
 *   environment, line 2847:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_configure'
 *   environment, line  507:  Called multilib-minimal_abi_src_configure
 *   environment, line 3002:  Called multilib_src_configure
 *   environment, line 3408:  Called cmake_configure
 *   environment, line 1392:  Called cmake-utils_src_configure
 *   environment, line 1321:  Called _execute_optionaly 'src_configure'
 *   environment, line  298:  Called enable_cmake-utils_src_configure
 *   environment, line 1596:  Called die


My environment:

Portage 2.2.8-r1 (default/linux/amd64/13.0/no-multilib, gcc-4.8.2, glibc-2.18-r1, 3.13.1-gentoo x86_64)
=================================================================
System uname: Linux-3.13.1-gentoo-x86_64-Intel-R-_Xeon-R-_CPU_E5420_@_2.50GHz-with-gentoo-2.2
KiB Mem:     4048356 total,   1367784 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Sun, 09 Feb 2014 21:30:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p45-r1
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6, 3.3.3
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.14.1
sys-devel/binutils:       2.24-r2
sys-devel/gcc:            4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.18-r1
Repositories: gentoo garfileo mv ultrabug lisp
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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"
CXXFLAGS="-march=core2 -O2 -pipe"
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"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirrors.163.com/gentoo/ http://mirrors.sohu.com/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
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"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/garfileo /var/lib/layman/mv /var/lib/layman/ultrabug /var/lib/layman/lisp"
SYNC="rsync://61.135.158.199/gentoo-portage"
USE="X \ acl alsa amd64 bash-completion berkdb bzip2 cairo cli cracklib crypt cups cxx dbus dri fortran gdbm gnome gtk iconv ipv6 jpeg jpeg2k mmx modules ncurses nls nptl opengl openmp pam pango pcre png readline session sse sse2 ssl svg systemd tcpd threads unicode 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" 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" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="zh zh_CN en en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby21 ruby20 ruby19" USERLAND="GNU" VIDEO_CARDS="nouveau" 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 Jeroen Roovers (RETIRED) gentoo-dev 2014-02-10 11:30:04 UTC
Please attach the entire build log to this bug report.
Comment 2 Li Yanrui 2014-02-11 01:00:44 UTC
Created attachment 370112 [details]
build.log
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-11 15:06:27 UTC
Is this a fresh install of LLVM or are you upgrading from an older version? Please add 'emerge --info llvm' (just the last part about LLVM of it).
Comment 4 Nikolaj Šujskij 2014-02-11 19:19:48 UTC
I'm trying to update from

sys-devel/llvm-3.3-r1 was built with the following:
USE="libffi python static-analyzer -clang -debug -doc -gold -multitarget -ocaml -test -udis86" ABI_X86="64 -32 -x32" PYTHON_TARGETS="python2_7 -pypy1_9 -pypy2_0 -python2_5 -python2_6" VIDEO_CARDS="radeon"
CFLAGS="-march=k8-sse3 -O2 -pipe -floop-interchange -floop-strip-mine -floop-block"
CXXFLAGS="-march=k8-sse3 -O2 -pipe -floop-interchange -floop-strip-mine -floop-block"
Comment 5 Li Yanrui 2014-02-12 00:53:45 UTC
(In reply to Michał Górny from comment #3)
> Is this a fresh install of LLVM or are you upgrading from an older version?
> Please add 'emerge --info llvm' (just the last part about LLVM of it).

It is a fresh install.
Comment 6 Ben de Groot (RETIRED) gentoo-dev 2014-02-26 09:08:06 UTC
updating from:

sys-devel/llvm-3.3-r3 was built with the following:
USE="libffi static-analyzer xml -clang -debug -doc -gold -multitarget -ocaml -python -test -udis86" ABI_X86="64 -32 -x32" PYTHON_TARGETS="python2_7 -pypy2_0 -python2_6" VIDEO_CARDS="radeon"
Comment 7 Li Yanrui 2014-02-26 09:52:27 UTC
I find that maybe this problem is caused by python 2.7. After adding '3_2' to 'PYTHON_COMPAT' in llvm-3.4.ebuild and using python 3.2 with 'python_targets_python3_2', the llvm-build tool works ok. Maybe python 3.3 can work too.
Comment 8 keeperofdakeys 2014-03-15 11:06:05 UTC
I have seen the same build error for the last couple of months, and switching to python-3.3 fixed the issue. I'll try to do some quick debugging, to see if I can find the error that makes python2 fail.
Comment 9 keeperofdakeys 2014-03-15 12:50:38 UTC
LLVM seems to store the known targets inside LLVMBuild.txt files spread throughout the source directories. Part of llvm-build is responsible for loading these files, and parsing the information. When using python2.7 (probably 2 in general), llvm-build never recurses into subdirectories. On python3.3 (probably 3 in general), it is able to recurse. Since python2 doesn't recurse into subdirectories, the information about valid targets is never loaded, so it complains that X86 is not a known target (for reference, the LLVMBuild.txt file for X86 is llvm-3.4/lib/Target/X86/LLVMBuild.txt).

The code responsible for recursing is present in llvm-3.4/utils/llvm-build/llvmbuild/main.py, line 66. The LLVMBuild.txt file contains the directories which must be recursed into, and this information is probably not being read correctly. This sounds like an LLVM bug, unless something specific about gentoo is getting in the way. It's also unclear if this effects all people running python2, or just some. For now, I won't be looking into this further, but it should be enough of a target for others to have a look.
Comment 10 keeperofdakeys 2014-03-15 13:27:41 UTC
I've identified the exact cause of this error, I had a python2 module called "configparser" installed. This is a backport of the python3 ConfigParser to python2. I had it installed separately from portage (which isn't good behaviour in the first place), specifically version 3.2.0r2. When I uninstalled this, I was no longer able to replicate the build failure of llvm-3.4. When I installed configparser from portage, which is version 3.3.0.2, the build failures were still gone.

In the file llvm-3.4/utils/llvm-build/llvmbuild/componentinfo.py, there is the following import:
try:
    import configparser
except:
    import ConfigParser as configparser

This was simply "import ConfigParser" in llvm-3.3. So with llvm-3.4, the old configparser was imported, and some bug made the parsing fail.

For the others who are experiencing this error, what version of configparser do you have installed, if at all? The fix for this would be at llvm's side, to check for the old configparser.
Comment 11 August Hörandl 2014-06-11 06:53:11 UTC
just my 2 cents:

1) problem exists also with sys-devel/llvm-3.4.1-r1
2) removing dev-python/configparser (3.2) solves the problem for me, can't upgrade because www-apps/nikola insists on 3.2 ;-(
Comment 12 keeperofdakeys 2014-06-11 07:19:07 UTC
(In reply to August Hörandl from comment #11)
> just my 2 cents:
> 
> 1) problem exists also with sys-devel/llvm-3.4.1-r1
> 2) removing dev-python/configparser (3.2) solves the problem for me, can't
> upgrade because www-apps/nikola insists on 3.2 ;-(

This bug is related to a script in the build system, so once llvm is installed, it will run fine no matter what version of configparser is installed. While not ideal, you could remove configparser, update llvm, then reinstall (the right version of) configparser.
Comment 13 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-06-11 07:50:12 UTC
+  11 Jun 2014; Michał Górny <mgorny@gentoo.org>
+  +files/llvm-3.4-cmake-configparser.patch, llvm-3.4-r2.ebuild,
+  llvm-3.4.1-r1.ebuild:
+  Always use built-in ConfigParser to work-around issues with configparser-3.2,
+  bug #500856.

Please try now.
Comment 14 August Hörandl 2014-06-11 21:14:33 UTC
works here - thanks for the quick fix