Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 471434 - sys-devel/clang-3.2 fails to find libprofile_rt.a for --coverage
Summary: sys-devel/clang-3.2 fails to find libprofile_rt.a for --coverage
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-27 14:25 UTC by Andrew Church
Modified: 2013-06-17 12:04 UTC (History)
2 users (show)

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


Attachments
Proof-of-concept patch to llvm-3.2.ebuild (llvm-3.2.ebuild.diff,373 bytes, patch)
2013-05-27 15:05 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 2013-05-27 14:25:45 UTC
When attempting to compile a program with the --coverage flag, clang-3.2 fails to link the final executable because it cannot find libprofile_rt.a, which it expects to find in /usr/lib but is actually located in /usr/lib/llvm (as part of the sys-devel/llvm package).

Appears to be the same issue as: https://bugs.launchpad.net/ubuntu/+source/clang/+bug/954709

emerge --info:
Portage 2.2.0_alpha177 (default/linux/x86, gcc-4.7.3, glibc-2.16.0, 3.8.2-gentoo i686)
=================================================================
System uname: Linux-3.8.2-gentoo-i686-AMD_Athlon-tm-_II_X2_240e_Processor-with-gentoo-2.2
KiB Mem:     8308488 total,   2312296 free
KiB Swap:    4193276 total,   4187888 free
Timestamp of tree: Sun, 26 May 2013 21:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.5, 3.2.5, 3.3.2
dev-util/cmake:           2.8.10.2-r2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.9.8.4::local
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.6, 1.13.2
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.4, 4.7.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.8 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo crossdev sunrise local
Installed sets: @system
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=x86-64 -mtune=amdfam10 -mmmx -msse -msse2 -pipe -g -fno-strict-aliasing"
CHOST="i686-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=amdfam10 -mmmx -msse -msse2 -pipe -g -fno-strict-aliasing"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--misspell-suggestions=n --autounmask=n --quiet-build=n"
FCFLAGS="-O2 -march=i686 -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"
FFLAGS="-O2 -march=i686 -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"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --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 /usr/local/portage"
SYNC="rsync://rsync.jp.gentoo.org/gentoo-portage"
USE="aac alsa apng berkdb cjk cli crypt cxx dri dv dvd fortran gif iconv ipv6 joystick jpeg jpeg2k lame live mad mmx mp3 mudflap 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 x264 x86 xanim zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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 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-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" 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 Andrew Church 2013-05-27 15:05:07 UTC
Created attachment 349354 [details, diff]
Proof-of-concept patch to llvm-3.2.ebuild

I'm not suggesting that this is the correct fix (I don't know the history behind the use of /usr/lib/llvm), but this patch allows clang to properly link executables with --coverage.
Comment 2 Bernard Cafarelli gentoo-dev 2013-06-13 21:21:27 UTC
Thanks for the report! The path to libprofile_rt.a is hardcoded in clang source, I updated it in clang ebuilds to point to the llvm lib directory

Fixed in live ebuild and cland-3.3_rc3 (final 3.3 should be released really soon
Comment 3 Andrew Church 2013-06-14 08:12:18 UTC
Thanks for the fix.  Unfortunately, --coverage itself is broken in clang-3.3 (see http://llvm.org/bugs/show_bug.cgi?id=15953) so I can't confirm this at the moment -- but it looks like you may (also / instead) need to apply the fix with respect to libclang_rt.a.
Comment 4 Bernard Cafarelli gentoo-dev 2013-06-17 11:13:16 UTC
Thanks I opened #473578 for libclang_rt.profile (as this is specific to >=3.3)
Comment 5 Andrew Church 2013-06-17 12:04:19 UTC
I can now confirm that the updated 3.3 ebuild fixes --coverage if I manually link in the appropriate libclang_rt (couldn't find it before).
Thanks again!