Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 106193 - >=sys-devel/binutils-2.15.92.0.2-r10 behaves incorrectly regarding -fPIC
Summary: >=sys-devel/binutils-2.15.92.0.2-r10 behaves incorrectly regarding -fPIC
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 73931 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-16 07:16 UTC by Drew Kirkpatrick
Modified: 2005-09-29 05:47 UTC (History)
3 users (show)

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


Attachments
3 build logs for libxml2, which different binutils versions (libxml2_build_logs.tar.bz2,16.48 KB, text/plain)
2005-09-29 05:43 UTC, Drew Kirkpatrick
Details
libxml2 build log for binutils version 2.15.90 (2.15.90_log,203.26 KB, text/plain)
2005-09-29 05:46 UTC, Drew Kirkpatrick
Details
build log for libxml2 with binutils 2.15.92.0.2-r10 (2.15.92.0.2-r10_log,203.26 KB, text/plain)
2005-09-29 05:47 UTC, Drew Kirkpatrick
Details
build log for libxml2 with binutils 2.16.1 (2.16.1_log,203.26 KB, text/plain)
2005-09-29 05:47 UTC, Drew Kirkpatrick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Drew Kirkpatrick 2005-09-16 07:16:45 UTC
Get this with 3.4.4:
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
.libs/SAX.o: relocation R_X86_64_PC32 against
`xmlSAX2InternalSubset__internal_alias' can not be used when making a shared
object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
final link failed: Bad value
collect2: ld returned 1 exit status 


All the threads discussing how to resolve the "recompile with -fPIC" errors
(which seems fairly commong) do not solve this problem. As a work around, I have
moved back to 3.3.3, and am recompiling my entire system. Alternate versions of
libxml2 also have this problem, although other people report NOT being able to
reproduce this. 

Reproducible: Always
Steps to Reproduce:
1.emerge libxml2
2.
3.

Actual Results:  
usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
.libs/SAX.o: relocation R_X86_64_PC32 against
`xmlSAX2InternalSubset__internal_alias' can not be used when making a shared
object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
final link failed: Bad value
collect2: ld returned 1 exit status 

Expected Results:  
A cleanly compiled and merged package. 

shadowcat(root)> emerge --info
Portage 2.0.51.22-r2 (default-linux/amd64/2005.0, gcc-3.4.4, glibc-2.3.5-r1,
2.6.12-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.12-gentoo-r4 x86_64 AMD Athlon(tm) 64 FX-53 Processor
Gentoo Base System version 1.6.13
dev-lang/python: 2.3.5-r2
sys-apps/sandbox: 1.2.12
sys-devel/autoconf: 2.13, 2.59-r6
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils: 2.15.92.0.2-r10
sys-devel/libtool: 1.5.18-r1
virtual/os-headers: 2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer -frename-registers"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown
/usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer -frename-registers"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ http://mirror.datapipe.net/gentoo"
LANG="C"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib alsa amd64 arts avi berkdb bitmap-fonts cdparanoia cdr crypt cups
curl dga dvd dvdr eds emboss encode esd fam firefox flac foomaticdb fortran gd
gdbm gif gnome gpm gstreamer gtk gtk2 imagemagick imlib ipv6 jack java jpeg jpg
junit kde ldap lzw lzw-tiff mad mikmod motif mp3 mpeg ncurses nls nvidia ogg
oggvorbis opengl pam pdflib perl pic png postgres ppds python qt quicktime
readline sdl slang spell ssl tcpd theora tiff truetype truetype-fonts
type1-fonts usb userlocales vorbis xine xinerama xml xml2 xmms xpm xv xvid xvmn
zlib userland_GNU kernel_linux elibc_glibc"
Unset: ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY

shadowcat(root)>
Comment 1 Patrick Lauer gentoo-dev 2005-09-16 07:19:48 UTC
which version of libxml2 are we talking about here? 
Comment 2 Simon Stelling (RETIRED) gentoo-dev 2005-09-16 07:24:50 UTC
don't use gcc 3.3 on amd64 - it produces faulty code. if you use it anyway, we
won't help you and just tell you to recompile your whole system with 3.4, so you
could save some hours.. filing bugs is the only solution to this kind of problem

btw, you can remove -fomit-frame-pointer from your CFLAGS, it won't do anything
on amd64
Comment 3 Drew Kirkpatrick 2005-09-16 07:36:33 UTC
By the way, the versions of libxml2 that I have this problem with is stable
version dev-libs/libxml2-2.6.19 as well as ~amd64 version 2.6.22
Comment 4 Simon Stelling (RETIRED) gentoo-dev 2005-09-16 08:44:07 UTC
okay, this works fine here with both versions. Why are you setting USE=pic but
not using a hardened profile? You really shouldn't have that flag in your USE.
also, what gcc-profile are you using? (use gcc-config -l to show it)
Comment 5 Daniel Gryniewicz (RETIRED) gentoo-dev 2005-09-16 08:54:18 UTC
Note that the pic USE flag has virtually no effect on amd64.  I saw two packages
where it turns of asm, all the rest only used that flag for x86 or !amd64.
Comment 6 Drew Kirkpatrick 2005-09-16 10:26:41 UTC
I've removed the pic USE keyword, and here's my compiler information:

shadowcat(drew)> gcc-config -l
 [1] x86_64-pc-linux-gnu-3.3.3
 [2] x86_64-pc-linux-gnu-3.4.4 *
 [3] x86_64-pc-linux-gnu-3.4.4-hardened
 [4] x86_64-pc-linux-gnu-3.4.4-hardenednopie
 [5] x86_64-pc-linux-gnu-3.4.4-hardenednopiessp
 [6] x86_64-pc-linux-gnu-3.4.4-hardenednossp
shadowcat(drew)>
Comment 7 Drew Kirkpatrick 2005-09-19 07:42:17 UTC
Looks very similar to this supposedly kdebase bug (79711), which states that
this is really a binutils bug. Proposed solution is to ditch the latest "stable"
binutils, and go back to 2.15.90.0.1. Will be testing and reporting back on this
today. 
Comment 8 Drew Kirkpatrick 2005-09-19 09:28:03 UTC
Got it! Ok, downgrading binutils on amd64 to sys-devel/binutils-2.15.90.0.1.1-r5
gets libxml2 to compile cleanly. I've entered this into my package.mask to get
my system to compile correctly:
>=sys-devel/binutils-2.15.92.0.2-r10


So is something severely wrong with binutils-2.15.92.0.2-r10? This sounds like a
fairly common problem, although most of the postings I've seen about it revolve
around compiling kde...
Comment 9 Gary Dezern 2005-09-21 20:23:01 UTC
Same issue compiling "net-libs/courier-authlib-0.57-r1" this evening (also amd64.)  

Just added  =sys-devel/binutils-2.15.92.0.2-r10 to package.mask, emerge update
on binutils (to downgrade), and courier-authlib still doesn't merge:

Linking libauthpam.la
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
/usr/lib64/libshadow.a(commonio.o): relocation R_X86_64_32 can not be used when
making a shared object; recompile with -fPIC
/usr/lib64/libshadow.a(commonio.o): could not read symbols: Bad value
collect2: ld returned 1 exit status

emerge --info:

Portage 2.0.51.22-r2 (default-linux/amd64/2005.0, gcc-3.4.4, glibc-2.3.5-r1,
2.6.13-gentoo-r2 x86_64)
=================================================================
System uname: 2.6.13-gentoo-r2 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6
sys-devel/binutils:  2.15.90.0.1.1-r5
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -fomit-frame-pointer -fweb -frename-registers -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -O2 -fomit-frame-pointer -fweb -frename-registers -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict userpriv"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
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 X Xaw3d acpi alsa apache2 athena bash-completion berkdb bitmap-fonts
ccache cdparanoia cli cracklib crypt ctype doc emacs encode exif fam gd gdbm gif
gpm gtk gtk2 imagemagick imap innodb ithreads java jpeg maildir motif mp3 mpeg
mpeg4 mpm-worker mysql mysqli ncurses nls no-htdocs nptl nvidia ogg oggvorbis
opengl oss pam passfile pcre pdo-external pear perl php png readline rtc samba
server session simplexml spell ssl threads tiff truetype truetype-fonts type1
type1-fonts usb xml xml2 xsl xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS

gcc --version
gcc (GCC) 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
Comment 10 Gary Dezern 2005-09-22 15:56:03 UTC
More info:  re-emerged shadow with the older binutils, and then courier-authlib
emerged just fine with no errors.
Comment 11 SpanKY gentoo-dev 2005-09-26 06:16:21 UTC
unable to reproduce at all

you'll need to post a full build log with binutils-2.16.1

run `emerge libxml2 >& log` and post the log as an attachment

Comment 12 Drew Kirkpatrick 2005-09-26 06:20:06 UTC
I've already rebuilt my entire system with the older binutils (was in middle of
emerge -e system && emerge -e world...) so I can't reproduce this now, anyone
else still have the latest "stable" binutils who can reproduce this? If not,
maybe when my system is done compiling I can re-emerge the new binutils and
reproduce it quicky....Might take a while tho
Comment 13 SpanKY gentoo-dev 2005-09-26 17:10:08 UTC
well get back to us please
Comment 14 Gregorio Guidi (RETIRED) gentoo-dev 2005-09-29 01:52:16 UTC
*** Bug 73931 has been marked as a duplicate of this bug. ***
Comment 15 Drew Kirkpatrick 2005-09-29 05:43:45 UTC
Created attachment 69480 [details]
3 build logs for libxml2, which different binutils versions

Ok, what I have is a 2005.0 system completely rebuilt with binutils 2.15.90.
I've logged the building of libxml2 with that (a simple rebuild), then I
emerged the current amd64 stable package of binutils 2.15.92.0.2-r10, and
repeated the emerging/logging of libxml2. 

Strangley, now it compliles cleanly, which never happened WHILE is I was in the
process of my 2004.3->2005.0 migration, and the followup emerge -e system &&
emerge -e system && emerge -e world && emerge -e world. Therefore I don't know
if this will help you track down this most elusive of problems that seems to be
inflicting many people (just search for -fpic issues, seems to be in KDE a
bunch as well). I also logged the building of libxml2 with the ~amd64 binutils
2.16.1, which also cleanly compiled. 

All logs are named with the version of binutils they were compiled against. I
did not recompile any other packages besides binutils and libxml2, so maybe
there's something else screwing up libxml2, that depends on the version of
binutils when its built. I hope this helps, thanks!
Comment 16 Drew Kirkpatrick 2005-09-29 05:46:27 UTC
Created attachment 69481 [details]
libxml2 build log for binutils version 2.15.90
Comment 17 Drew Kirkpatrick 2005-09-29 05:47:02 UTC
Created attachment 69482 [details]
build log for libxml2 with binutils 2.15.92.0.2-r10
Comment 18 Drew Kirkpatrick 2005-09-29 05:47:28 UTC
Created attachment 69483 [details]
build log for libxml2 with binutils 2.16.1