Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 506106 - app-portage/eix fails to build with llvm/clang
Summary: app-portage/eix fails to build with llvm/clang
Status: RESOLVED UPSTREAM
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: AMD64 OS X
: Normal normal (vote)
Assignee: Martin Väth
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-28 18:37 UTC by Stuart Shelton
Modified: 2014-10-19 19:01 UTC (History)
2 users (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 Stuart Shelton 2014-03-28 18:37:46 UTC
(This bug report may belong in Prefix - but it appears to be a code issue rather than a platform issue, so I'll report here and hope for the best!)

eix-0.29.3 (with and without USE="clang") and eix-0.30.1 all fail with:

clang++ -DHAVE_CONFIG_H -I. -I..   -I/opt/gentoo/usr/include -DSYSCONFDIR=\"/opt/gentoo/etc\" -DLOCALEDIR=\"/opt/gentoo/usr/share/locale\"  -std=gnu++11 -std=gnu++11 -arch x86_64 -march=core-avx-i -mmacosx-version-min=10.9 -O0 -g -pipe -c -o database/header_portage.o database/header_portage.cc
eixTk/utils.cc:93:36: error: invalid operands to binary expression ('basic_istream<char, std::__1::char_traits<char> >' and 'nullptr_t')
        while(likely(getline(ifstr, line) != NULLPTR)) {
                     ~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~
./eixTk/likely.h:14:37: note: expanded from macro 'likely'
#define likely(x)       __builtin_expect((x), 1)
                                          ^
1 error generated.
Makefile:1536: recipe for target 'eixTk/utils.o' failed
make[2]: *** [eixTk/utils.o] Error 1

... when built with clang.


This occurred on a prefix installation under Mac OS 10.9, using Gentoo llvm/clang:

$ clang --version
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-apple-darwin13.1.0
Thread model: posix


The following warnings are also common to all versions:

clang++ -DHAVE_CONFIG_H -I. -I..   -I/opt/gentoo/usr/include -DSYSCONFDIR=\"/opt/gentoo/etc\" -DLOCALEDIR=\"/opt/gentoo/usr/share/locale\"  -std=gnu++11 -std=gnu++11 -arch x86_64 -march=core-avx-i -mmacosx-version-min=10.9 -O0 -g -pipe -c -o eixTk/varsreader.o eixTk/varsreader.cc
eixTk/stringutils.cc:426:19: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                fprintf(stderr, _("Internal error: Storing required after finalizing"));
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./eixTk/i18n.h:16:14: note: expanded from macro '_'
#define _(a) gettext(a)
             ^~~~~~~~~~
eixTk/stringutils.cc:434:19: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                fprintf(stderr, _("Internal error: Hashing required after finalizing"));
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./eixTk/i18n.h:16:14: note: expanded from macro '_'
#define _(a) gettext(a)
             ^~~~~~~~~~
eixTk/stringutils.cc:438:19: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                fprintf(stderr, _("Internal error: Hashing required in non-hash mode"));
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./eixTk/i18n.h:16:14: note: expanded from macro '_'
#define _(a) gettext(a)
             ^~~~~~~~~~
Comment 1 Stuart Shelton 2014-03-28 18:39:44 UTC
$ emerge --info =eix-0.30.1
Portage 2.2.8-prefix (prefix/darwin/macos/10.9/x64, gcc-4.2.1, unavailable, 13.1.0 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Darwin-13.1.0-x86_64-i386-64bit
Timestamp of tree: Thu, 27 Mar 2014 21:36:34 +0000
app-shells/bash:      4.2_p45-r1
dev-lang/python:      2.7.5-r4
dev-util/cmake:       2.8.12.2
dev-util/pkgconfig:   0.28
sys-devel/autoconf:   2.69
sys-devel/automake:   1.14
sys-devel/gcc-config: 1.8-r00.1
sys-devel/libtool:    2.4.2
sys-devel/make:       4.0-r1
Repositories: gentoo_prefix timebomb_overlay srcshelton
ACCEPT_KEYWORDS="amd64 amd64-linux x64-macos ~x64-macos"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-apple-darwin13"
CFLAGS="-arch x86_64 -march=core-avx-i -mmacosx-version-min=10.9 -fcolor-diagnostics -O3 -pipe"
CHOST="x86_64-apple-darwin13"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-arch x86_64 -march=core-avx-i -mmacosx-version-min=10.9 -fcolor-diagnostics -O3 -pipe"
DISTDIR="/opt/gentoo/usr/portage/distfiles"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs buildpkg candy clean-logs collision-protect compress-build-logs compressdebug config-protect-if-modified distlocks downgrade-backup ebuild-locks fail-clean fixlafiles force-prefix merge-sync news nostrip parallel-fetch parallel-install preserve-libs protect-owned sfperms split-elog split-log splitdebug strict stricter unknown-features-warn unmerge-backup unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-dead_strip_dylibs"
MAKEOPTS="-j7"
PKGDIR="/opt/gentoo/usr/portage/packages/clang"
PORTAGE_CONFIGROOT="/opt/gentoo/"
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="/opt/gentoo/var/tmp"
PORTDIR="/opt/gentoo/usr/portage"
PORTDIR_OVERLAY="/opt/gentoo/usr/portage/local/timebomb /opt/gentoo/usr/portage/local/overlay"
USE="aqua berkdb bzip2 coreaudio cracklib crypt cxx expat gdbm icu idn ipv6 libedit lzma lzo mmx mmxext modules ncurses nls objc objc++ pcre perl prefix python python2 readline sqlite sse sse2 ssl threads unicode x64-macos xml zlib" 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="Darwin" 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" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="radeon" 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"
USE_PYTHON="2.7"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC

=================================================================
                        Package Settings
=================================================================

app-portage/eix-0.30.1 was built with the following:
USE="dep nls (prefix) sqlite -debug -doc -optimization -security -strong-optimization -strong-security -swap-remote -tools" LINGUAS="-de -ru"
CFLAGS="-march=core2 -msse4.2 -mssse3 -mfpmath=sse -O2 -pipe"
CXXFLAGS="-march=core2 -msse4.2 -mssse3 -mfpmath=sse -O2 -pipe"
Comment 2 Martin Väth 2014-03-29 13:37:00 UTC
It is strange that I get neither the error nor the warnings with clang-3.4-r100, although for testing, I explicitly specified -Wformat-security in CXXFLAGS.

Error and warnings should be fixed in current git master of eix (>=eix-0.30.2) on BerliOS and GitHub (live ebuild is in the mv overlay)
Comment 3 Stuart Shelton 2014-05-08 19:44:52 UTC
Unfortunately, I'm getting the same thing from the newly in-tree six-0.30.2:

clang++ -DHAVE_CONFIG_H -I. -I..   -I/opt/gentoo/usr/include -DSYSCONFDIR=\"/opt/gentoo/etc\" -DLOCALEDIR=\"/opt/gentoo/usr/share/locale\"  -std=gnu++1y -std=gnu++1y -arch x86_64 -march=core-avx-i -mmacosx-version-min=10.9 -O0 -g -pipe -c -o cache/common/assign_reader.o cache/common/assign_reader.cc
cache/common/assign_reader.cc:53:33: error: invalid operands to binary expression ('basic_istream<char, std::__1::char_traits<char> >' and 'nullptr_t')
        while(likely(getline(is, lbuf) != NULLPTR)) {
                     ~~~~~~~~~~~~~~~~~ ^  ~~~~~~~
./eixTk/likely.h:14:37: note: expanded from macro 'likely'
#define likely(x)       __builtin_expect((x), 1)
                                          ^
1 error generated.
Makefile:1536: recipe for target 'cache/common/assign_reader.o' failed
make[2]: *** [cache/common/assign_reader.o] Error 1


(In reply to Martin Väth from comment #2)
> It is strange that I get neither the error nor the warnings with
> clang-3.4-r100, although for testing, I explicitly specified
> -Wformat-security in CXXFLAGS.
> 
> Error and warnings should be fixed in current git master of eix
> (>=eix-0.30.2) on BerliOS and GitHub (live ebuild is in the mv overlay)
Comment 4 Martin Väth 2014-05-09 13:22:30 UTC
Thanks for the second report: This is a different occassion than the first reported, and so I did not find it. (As mentioned: my clang version does not spit an error for this...).
A grep shows that this is the last occassion with getline() in the code.

In a few hours, I will have time to fix the issue and will commit it to the git repositories on BerliOS and GitHub. If you find time for testing the live ebuild, it would be nice if you could report back whether it works for you.
Comment 5 Stuart Shelton 2014-05-09 16:39:50 UTC
Ah - I hadn't spotted that!  I'll try to build the live ebuild over the weekend, and let you know how it goes.  On the same system, eix built with gcc is fine and is what I'm currently using.


(In reply to Martin Väth from comment #4)
> Thanks for the second report: This is a different occassion than the first
> reported, and so I did not find it. (As mentioned: my clang version does not
> spit an error for this...).
> A grep shows that this is the last occassion with getline() in the code.
> 
> In a few hours, I will have time to fix the issue and will commit it to the
> git repositories on BerliOS and GitHub. If you find time for testing the
> live ebuild, it would be nice if you could report back whether it works for
> you.
Comment 6 Stuart Shelton 2014-05-21 22:53:17 UTC
Sorry for the delay - built six-99999999 from the 'mv' overlay (at change a6aff014ae0f5817c9a697ca2b2dfbd102ccec67), and it installed correctly with clang-3.4.1 (and gcc too).
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-10-19 19:01:44 UTC
Closing since this is fixed in 0.30.3