Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 515882 - sys-libs/llvm-3.4.2 with sys-devel/gcc-4.7.4 - ClangCheck.cpp:(.text._xxxxxxxxx): undefined reference to `vtable for clang::tooling::FrontendActionFactory* ...'
Summary: sys-libs/llvm-3.4.2 with sys-devel/gcc-4.7.4 - ClangCheck.cpp:(.text._xxxxxxx...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
: 539332 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-06-30 19:22 UTC by Andrew Church
Modified: 2020-02-22 20:56 UTC (History)
4 users (show)

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


Attachments
build-logs.tar.xz (build-logs.tar.xz,190.18 KB, application/x-xz-compressed-tar)
2014-06-30 19:22 UTC, Andrew Church
Details
llvm-3.4.2.ebuild.patch (llvm-3.4.2.ebuild.patch,453 bytes, patch)
2014-07-03 10:18 UTC, Andrew Church
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Church 2014-06-30 19:22:56 UTC
Created attachment 380012 [details]
build-logs.tar.xz

Attempting to build sys-libs/llvm-3.4.2 using sys-devel/gcc-4.7.4 fails with the following error:

/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-abi_x86_64.amd64/tools/clang/tools/clang-check/Release/ClangCheck.o: In function `clang::tooling::FrontendActionFactory* clang::tooling::newFrontendActionFactory<clang_check::ClangCheckActionFactory>(clang_check::ClangCheckActionFactory*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::create()':
ClangCheck.cpp:(.text._ZZN5clang7tooling24newFrontendActionFactoryIN11clang_check23ClangCheckActionFactoryEEEPNS0_21FrontendActionFactoryEPT_PNS0_19SourceFileCallbacksEEN28FrontendActionFactoryAdapter6createEv[_ZZN5clang7tooling24newFrontendActionFactoryIN11clang_check23ClangCheckActionFactoryEEEPNS0_21FrontendActionFactoryEPT_PNS0_19SourceFileCallbacksEEN28FrontendActionFactoryAdapter6createEv]+0x36): undefined reference to `vtable for clang::tooling::FrontendActionFactory* clang::tooling::newFrontendActionFactory<clang_check::ClangCheckActionFactory>(clang_check::ClangCheckActionFactory*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor'
collect2: error: ld returned 1 exit status
make[1]: *** [/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-abi_x86_64.amd64/Release/bin/clang-check] Error 1
make[1]: Leaving directory '/tmp/portage/sys-devel/llvm-3.4.2/work/llvm-3.4.2.src-abi_x86_64.amd64/tools/clang/tools/clang-check'

http://comments.gmane.org/gmane.comp.compilers.clang.devel/37471 suggests that this is a regression in gcc-4.7.4, and I've confirmed that if I downgrade to sys-devel/gcc-4.7.3-r1, llvm builds without error.


emerge --info:

Portage 2.2.10 (default/linux/amd64, gcc-4.7.4, glibc-2.19, 3.14.6-gentoo x86_64)
=================================================================
System uname: Linux-3.14.6-gentoo-x86_64-Intel-R-_Core-TM-_i7-4770S_CPU_@_3.10GHz-with-gentoo-2.2
KiB Mem:     8122276 total,   3605816 free
KiB Swap:    4193276 total,   4180116 free
Timestamp of tree: Mon, 30 Jun 2014 15:15:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p47
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.7, 3.3.5, 3.4.1
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
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.13.4, 1.14.1
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.7.4
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.14 (virtual/os-headers)
sys-libs/glibc:           2.19
Repositories: gentoo crossdev sunrise steam-overlay glc local emul-linux-hacks
Installed sets: @steam, @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x D1X"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=x86-64 -mtune=core-avx-i -mmmx -msse -msse2 -pipe -fno-strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/dev /etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=x86-64 -mtune=core-avx-i -mmmx -msse -msse2 -pipe -fno-strict-aliasing"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--misspell-suggestions=n --autounmask=n --quiet-build=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles merge-sync news preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.jaist.ac.jp/pub/Linux/Gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS=""
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="-O --no-human-readable"
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="/var/lib/crossdev /var/lib/layman/sunrise /var/lib/layman/steam /var/lib/layman/glc /usr/local/portage /usr/local/emul-linux-hacks"
SYNC="rsync://rsync.jp.gentoo.org/gentoo-portage"
USE="aac alsa amd64 apng berkdb cjk cli crypt cxx dri dv dvd fortran gif iconv ipv6 joystick jpeg jpeg2k lame live mad mmx mp3 multilib ncurses nptl nptlonly ogg openmp oss perl png pv3 python quicktime readline scanner sdl session sse sse2 ssl theora tiff truetype unicode vdpau vorbis vpx win32codecs x264 xanim zlib" ABI_X86="32 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" KERNEL="linux" 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 python3_3" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="genesys" USERLAND="GNU" VIDEO_CARDS="nvidia vesa" 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, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON
Comment 1 Peter Volkov (RETIRED) gentoo-dev 2014-07-03 08:28:11 UTC
Same problem here and according to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61639 gcc is not going to fix this )
Comment 2 Andrew Church 2014-07-03 10:18:02 UTC
Created attachment 380094 [details, diff]
llvm-3.4.2.ebuild.patch

(In reply to Peter Volkov from comment #1)
> Same problem here and according to
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61639 gcc is not going to fix
> this )

Wow.  I am seriously at a loss for words here...

Attaching proof-of-concept of a possible workaround in the form of blocking gcc-4.7.4 in {llvm,clang}-3.[234]*.ebuild, though this subsequently causes sys-devel/gcc blocker errors with emerge -u so I may not be doing it right.

FYI, clang-3.2 is also affected, so presumably likewise with {llvm,clang}-3.3, though I didn't test that version.  clang-3.0 is not affected; llvm-3.1 failed to build for me, apparently because it doesn't use pkg-config to find libffi headers.
Comment 3 Johan Bergström 2014-09-23 02:46:01 UTC
Just hit this with llvm 3.5.0 and gcc 4.7.4 as well. Switching to gcc 4.8.x at least avoids it.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-09-23 05:46:21 UTC
So I guess we need to require gcc-4.8. Unconditionally or for this tool only?
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-09-23 06:01:41 UTC
(for this tool = with USE=clang)
Comment 6 Andrew Church 2014-09-23 06:59:20 UTC
A comment on the upstream bug suggests the problem is also present with gcc-4.9.1 (though it also suggests the root cause may lie elsewhere) so ">=gcc-4.8" may not be safe.  I'll test with gcc-4.[89].* and report what I find.

In any case, it looks like we also need to allow gcc-4.7.[0-3] because gcc-4.8.* are not keyworded for ppc{,64} while llvm is.  (Also, gcc-4.8.* are not yet stable but llvm-3.3-r3 is.)

Re: USE flags, the error does not occur building llvm-3.4.2 with USE=-clang so the gcc restriction can probably be conditional.
Comment 7 Andrew Church 2014-09-23 11:46:58 UTC
llvm-3.4.2 (USE=clang) builds fine with gcc-4.8.[0-3] and gcc-4.9.[01], so it's just gcc-4.7.4 that's bad.

FWIW, llvm-3.5.0 was fine with gcc-4.9.1 as well.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2015-02-08 13:30:26 UTC
*** Bug 539332 has been marked as a duplicate of this bug. ***
Comment 9 Jonas Stein gentoo-dev 2020-02-22 20:56:41 UTC
sys-libs/llvm-3.4.2 is no longer in the tree since a while. Please test with current packages and report a new ticket, if there is a similar bug.
Closing here.