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

Bug 122208

Summary: dev-libs/libusb-0.1.11 -fPIC
Product: Gentoo Linux Reporter: Karol Krizka <kkrizka>
Component: Current packagesAssignee: Alastair Tse (RETIRED) <liquidx>
Status: RESOLVED INVALID    
Severity: normal CC: amd64
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Karol Krizka 2006-02-08 22:06:31 UTC
When emerging dev-libs/libusb-0.1.11 I get the following error:
 x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -march=athlon64 -mtune=athlon64 -O2 -pipe -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -fomit-frame-pointer -fvisibility=hidden -fvisibility-inlines-hidden -Wall -MT linux.lo -MD -MP -MF .deps/linux.Tpo -c linux.c >/dev/null 2>&1
/bin/sh ./libtool --mode=link x86_64-pc-linux-gnu-gcc  -march=athlon64 -mtune=athlon64 -O2 -pipe -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -fomit-frame-pointer -fvisibility=hidden -fvisibility-inlines-hidden -Wall   -o libusb.la -rpath /usr/lib64 -version-info 8:3:4 -release 0.1 -export-dynamic   usb.lo error.lo descriptors.lo linux.lo
x86_64-pc-linux-gnu-gcc -shared  .libs/usb.o .libs/error.o .libs/descriptors.o .libs/linux.o   -march=athlon64 -mtune=athlon64 -Wl,-soname -Wl,libusb-0.1.so.4 -o .libs/libusb-0.1.so.4.4.3
/usr/lib/gcc/x86_64-pc-linux-gnu/4.0.2/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/usb.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
.libs/usb.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

Same problem with gcc3 and gcc4.

emerge info:
Portage 2.1_pre4-r1 (default-linux/amd64/2005.0, gcc-4.0.2, glibc-2.3.6-r2, 2.6.15-suspend2-r5 x86_64)
=================================================================
System uname: 2.6.15-suspend2-r5 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.12.0_pre15
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.3.4-r1, 2.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-r1
sys-devel/binutils:  2.16.1-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -mtune=athlon64 -O2 -pipe -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -fomit-frame-pointer -fvisibility=hidden -fvisibility-inlines-hidden"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openjms/config /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=athlon64 -mtune=athlon64 -O2 -pipe -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -fomit-frame-pointer -fvisibility=hidden -fvisibility-inlines-hidden"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://gentoo.ITDNet.net/gentoo ftp://gentoo.itdnet.net/gentoo/ ftp://ftp.linux.ee/pub/gentoo/distfiles/ http://trumpetti.atm.tut.fi/gentoo/"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 3ds X Xaw3d a52 aac aalib accessibility acl acpi ada aim allegro alsa alut amuled ao apache2 arts artswrappersuid asf athena audiofile avalon avi backward-compatible bash-completion batch bcmath berkdb berkkdb bidi bitmap-fonts bl bmp browserplugin buttons bzip2 bzlib cairo calendar canna caps cdb cdda cddb cdio cdparanoia cdparanois cdr cegui cg chasen cjk clanJavaScript clanVoice clearcase cli cpdflibcrypt crypt cscope css ctype cups curl curlwrappers custom-cflags dba dbase dbm dbus dbx devil dga dio directfb directfbdivx4linux djbfft djvu dllloader dlloader dnd doc double-precision dpms dri dts dv dvb dvd dvdr dvdread dxr3 dynagraph editor edl eds elf emacs emacs-w3 emboss emul-linux-x86 encode epiphany evo examples exif expat ext-doc ext-dvi ext-html ext-koffice ext-kpresenter ext-kspread ext-kword ext-lyx ext-man ext-pdf ext-ppt ext-ps ext-rtf ext-tex ext-xls f77 fam fame fat fbcon fbsplash ffmpeg fftw firefox flac flash flatfile font-server foomaticdb fortan fortran fping fpx freetds freetype freewnn ftp fuse gaim gb gd gdbm geoip gg ggi gif giff gii ginac glibc-compat20 glibc-omitfp glitz glut gmail gmailtimestamps gnokii gnomedb gnustep gnutls gphoto2 gpm graphviz guile hal haskell hfs howl httpd iconv icq ieee1394 imagemagick imap imlib inifile innodb iodbc ipv6 irc ithreads jabber java javamail javascript jbig jce jfs jikes jms jmx jpeg jpeg2k junit jython kde lcms ldap leim libcaca libclamav libedit libg++ libgda libsamplerate libvisual libwww live lj logitech-mouse lzo lzw lzw-tiff mad maildir mailwrapper matroska matrox mbox mcal mcve md5sum mdb memlimit mhash migemo mikmod mime ming mjpeg mng mozcalendar mozdevelop mozillampg3 mozsvg mp3 mpeg mpi mplayer mpm-worker msn mule musepack musicbrainz mysql mysqli mythtv nas ncurses neXt network nfs ng nls nntp nomalloccheck nowin nptl nptlonly nsplugin ntfs nvidia oav odbc offensive ofx ogg oggvorbis openal openexr opengl oss pam parse-clocks pascal pcmcia pcntl pcre pda pdflib pear perforce perl pertty php physfs plotutils png pnp portaudio posix postgres povray ppds python qmail qt quicktime rar rdesktop readlibe real reiserfs remote rhino risky rpm rss rtc ruby samba sametime sasl sblive scanner sdk sdl sendfile server session shaper silc silvercity simplexml slang sms smux sndfile snmp soap sockets sox speex spell spl sql sqlite srp ssl stats stream subp subtitles subversion svg symlink synlinkszip sysfs sysvipc tcltk tcpd tga theora threads tidy tiff tokenizer tools truetype truetype-fonts type1-fonts unicode usb userlocales v4l v4l2 vcd videos visualization vlm vorbis wddx wifi wmf wxgtk1 wxwindows x11vnc xanim xattr xbase xchatdccserver xchattext xface xfs xine xml xml2 xmlrpc xosd xpm xprint xsl xv xvid xvmc yahoo yaz yv12 zeo zeroconf zip zlib zvbi elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS
Comment 1 Alastair Tse (RETIRED) gentoo-dev 2006-02-09 13:44:13 UTC
amd guys, do i just put -fPIC in the LDFLAGS or is there something a little more subtle?
Comment 2 Simon Stelling (RETIRED) gentoo-dev 2006-02-09 14:34:12 UTC
it'd be better to fix the Makefile to build the libs with -fPIC, but I guess this package does only build libraries anyway, so append-flags -fPIC would be okay too (note that it'd be CFLAGS, not LDFLAGS)
Comment 3 Jory A. Pratt 2006-02-09 14:47:48 UTC
CFLAGS="-march=athlon64 -mtune=athlon64 -O2 -pipe -fforce-addr
-falign-functions=4 -fprefetch-loop-arrays -fomit-frame-pointer
-fvisibility=hidden -fvisibility-inlines-hidden"

Is incorrect to begin with, -fvisibility=hidden -fvisibility-inlines-hidden are only valid for CXXFLAGS not CFLAGS. You should fix your cflags before you continue   I have just updated to 0.1.11 without a problem.
Comment 4 Alastair Tse (RETIRED) gentoo-dev 2006-02-09 15:03:19 UTC
Thanks guys for the advice on -fPIC. I'd like the reporter to give some more info before I proceed as anarchy has a good point, I didn't spot that when I first looked at this report.
Comment 5 Simon Stelling (RETIRED) gentoo-dev 2006-02-10 00:34:07 UTC
Indeed, I just tried, and it works fine here too. It is probably the visibility flag as it will throw out a warning and therefore configure thinks -fPIC is not a supported flag.

Please, clean up your CFLAGS (there are other redundant flags in there too) before you file any other bug.
Comment 6 Brian Cappello 2006-02-22 18:57:53 UTC
This error is caused by adding the option -fvisibility-inlines-hidden to your CXXFLAGS. This option should really be filtered out by the ebuild, IMO.