Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 146895

Summary: libtool does not allow -fprofile-arcs as a linker flag
Product: Gentoo Linux Reporter: Fernando J. Pereda (RETIRED) <ferdy>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED UPSTREAM    
Severity: normal CC: ciaran.mccreesh, znmeb
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: gcov-libtool.tar.bz2

Description Fernando J. Pereda (RETIRED) gentoo-dev 2006-09-08 18:35:09 UTC
While building paludis with gcov support I get:

--- 8< ---
/bin/sh ../../libtool --tag=CXX --mode=link g++ -I../..  -Wall -Wextra -Wold-style-cast -Wredundant-decls -Wstrict-null-sentinel -Wmissing-noreturn -Woverloaded-virtual -pedantic -O1 -fno-inline-functions -fprofile-arcs -ftest-coverage -pg -g -ggdb3   -o dosha256  dosha256.o ../../paludis/digests/libpaludisdigests.la 
g++ -I../.. -Wall -Wextra -Wold-style-cast -Wredundant-decls -Wstrict-null-sentinel -Wmissing-noreturn -Woverloaded-virtual -pedantic -O1 -fno-inline-functions -fprofile-arcs -ftest-coverage -pg -g -ggdb3 -o .libs/dosha256 dosha256.o  ../../paludis/digests/.libs/libpaludisdigests.so
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/bin/ld: .libs/dosha256: hidden symbol `__gcov_init' in /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libgcov.a(_gcov.o) is referenced by DSO
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
--- 8< ---

The symbol is there and it is definitely not hidden:

--- 8< ---
[ $ ~ ] nm /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/libgcov.a | grep init
00000090 T __gcov_init
--- 8< ---

My emerge --info is as follows:

--- 8< ---
Portage 2.1-r2 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.15.1 i686)
=================================================================
System uname: 2.6.15.1 i686 AMD Athlon(TM) XP 2000+
Gentoo Base System version 1.12.4
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [disabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.3.5-r2, 2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  0.4.2-r1
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.4.3-r1, 1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protect cvs distlocks fixpackages metadata-transfer notitles sandbox sfperms sign strict userpriv usersandbox"
GENTOO_MIRRORS="ftp://ftp.easynet.nl/mirror/gentoo/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="en_GB.utf8"
LINGUAS="en es"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlays/cross-compilers /home/ferdy/gentoo/overlay /usr/local/overlays/zamorate-overlay /usr/portage/local/layman/repodoc-overlay /usr/portage/local/layman/sunrise"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa avi berkdb bitmap-fonts bzip2 cairo cdr cli clisp crypt cups dbus dga dlloader dri dvd dvdr emboss encode ethereal fam fbcon firefox gd gdbm gif gstreamer gtk gtk2 hal imap imlib2 ipv6 isdnlog jpeg libg++ lirc mad maildir mailwrapper mikmod mmx mp3 mpeg ncurses nls nptl nptlonly ogg opengl oss pam pcre pdflib perl png ppds pppd python qt4 quicktime radeon readline reflection samba sdl session spell spl ssl tcpd tiff truetype truetype-fonts type1-fonts udev unicode v4l vorbis win32codecs xml xorg xv zlib elibc_glibc input_devices_mouse input_devices_keyboard kernel_linux linguas_en linguas_es lirc_devices_avermedia userland_GNU video_cards_radeon video_cards_vesa video_cards_fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
--- 8< ---

- ferdy
Comment 1 Stephen Bennett (RETIRED) gentoo-dev 2006-09-08 19:02:34 UTC
Same error here on amd64.
Comment 2 SpanKY gentoo-dev 2006-09-08 19:42:25 UTC
and how do you reproduce this

paludis builds just fine for me with 4.1.1
Comment 3 Fernando J. Pereda (RETIRED) gentoo-dev 2006-09-09 03:57:01 UTC
Build it with CXXFLAGS="-O1 -fno-inline-functions -fprofile-arcs
-ftest-coverage -pg -g -ggdb3" to get gcov support and see it bail.
- ferdy
Comment 4 Fernando J. Pereda (RETIRED) gentoo-dev 2006-09-09 11:58:56 UTC
Adding LDFLAGS=-lgcov works.

I don't know if this is considered a bug but it is definitely a different behaviour from gcc-3.4.6.

- ferdy
Comment 5 SpanKY gentoo-dev 2006-12-30 06:34:38 UTC
i'm not sure this is a bug in gcc

the problem is that libtool generates paludis/digests/.libs/libpaludisdigests.so with 'g++ -shared -nostdlib ... -pg ... -o .libs/libpaludisdigests.so.12.0.0'

then it builds the digest binaries like:
g++ ... -pg ... dormd160.c -o dormd160 ../../paludis/digests/.libs/libpaludisdigests.so

since libpaludisdigests.so did not have the gcov code pulled in, you now get the failure about gcov symbols being referenced by the DSO
Comment 6 SpanKY gentoo-dev 2006-12-30 07:17:28 UTC
Created attachment 104984 [details]
gcov-libtool.tar.bz2

reduced test case ... fails for me with gcc-3.4.x as well
Comment 7 SpanKY gentoo-dev 2007-01-28 23:09:31 UTC
upstream has fixed this
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2007-08-02 04:05:43 UTC
*** Bug 187455 has been marked as a duplicate of this bug. ***
Comment 9 M. Edward Borasky 2007-08-02 04:41:28 UTC
(In reply to comment #7)
> upstream has fixed this
> 
upstream for which package? and if it was fixed in January, how come I ran into it yesterday?
Comment 10 SpanKY gentoo-dev 2007-08-02 09:04:06 UTC
as the summary says, it's a bug in libtool.  one could therefore draw the conclusion that the upstream libtool project has fixed this in their latest sources.