recompile with -fPIC [Solved]

Anything that pertains to Portage

Moderator: Moderators

recompile with -fPIC [Solved]

Postby Red Knuckles » Fri Jul 27, 2007 22:50

This is one of 2 problems preventing me from completing world update and from being able to complete revdep-rebuild. Not being able to complete revdep-rebuild is REALLY bothering me.

Here's error from 'emerge =x11-plugins/enigmail-0.95.1' which is one of a number of packages that fail to emerge due to this error:

mimeenc2.cpp
mimehdrs2.cpp
mimedummy.cpp
mimeenig.cpp
nsEnigModule.cpp
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: nsEnigModule.o: relocation R_X86_64_PC32 against `NS_NewGenericModule2(nsModuleInfo const*, nsIModule**)' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
gmake[2]: *** [libenigmime.so] Error 1
gmake[1]: *** [libs] Error 2
make: *** [all] Error 2
*
* ERROR: x11-plugins/enigmail-0.95.1 failed.
* Call stack:
* ebuild.sh, line 1648: Called dyn_compile
* ebuild.sh, line 988: Called qa_call 'src_compile'
* ebuild.sh, line 44: Called src_compile
* enigmail-0.95.1.ebuild, line 161: Called die
*
* make enigmail failed
* If you need support, post the topmost build error, and the call stack if relevant.

Any ideas about how to fix???
Last edited by Red Knuckles on Thu Aug 02, 2007 20:11, edited 4 times in total.
SL 3.4a AMD64, Gentoo2007.0 AMD64 - ASUS M2NPV-VM - AMD64 X2 4800+ 2.5 Ghz - 4X1GB DDR2 800 - GeForce 6150 256MB - 2X320GB
Red Knuckles
Growing Hen
 
Posts: 104
Joined: Wed Jan 10, 2007 3:16
Location: Colorado, USA

emerge --info

Postby Red Knuckles » Sun Jul 29, 2007 0:06

# emerge --info
Portage 2.1.3.1 (default-linux/amd64/2007.0, gcc-4.2.0, glibc-2.6-r0, 2.6.22-sabayon x86_64)
=================================================================
System uname: 2.6.22-sabayon x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4800+
Gentoo Base System release 1.12.10
Timestamp of tree: Thu, 02 Aug 2007 15:32:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python: 2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache: 2.4-r7
sys-apps/sandbox: 1.2.18.1
sys-devel/autoconf: 2.13, 2.61-r1
sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils: 2.17-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool: 1.5.24
virtual/os-headers: 2.6.22-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -march=x86-64 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/share/config/kdm /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-Os -march=x86-64 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/dis ... ons/gentoo"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s"
LINGUAS="en"
MAKEOPTS="-s -j7"
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 --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sabayon /usr/portage/local/layman/sunrise"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="7zip X a52 aac aalib accessibility acl acpi ada aiglx alsa amd64 arts artswrappersuid asterisk audiofile avahi beagle berkdb bitmap-fonts bluetooth browserplugin bzip2 cairo canvas cdda cdr cjk cli commercial cracklib crypt css cups dbox2 dbus dga divx4linux djvu dlloader dri dts dv dvb dvd dvdr dvdread dvi evo exif exscalibar fat ffmpeg firefox flac foomatic-db fortran freetype fuse gcj gdbm gimpprint glitz glut gnokii gnome gnutls gphoto2 gpm gsm gtk2 hal hfs iconv ieee1394 ipod ipv6 irda isdnlog jack java jfs jingle joystick jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility kdgraphics kerberos kig-scripting kipi ladspa lame lcd ldap libcaca libg++ libnotify lirc live livecd lm_sensors logitech-mouse mad mbrola midi mikmod mmx mono moznocompose moznoirc moznomail mozsvg mp3 mp3rtp mpeg mudflap musepack musicbrainz nautilus ncurses nls nntp nptl nptlonly nsplugin ntfs nvidia ogg oggvorbis ole on-the-fly-crypt openexr openmp pam pam_chroot pam_timestamp pcmcia pcre pda pdf perforce perl povray ppds pppd pulseaudio pwdb python qt rdesktop readline reflection reiser4 reiserfs remote rtsp ruby samba scanner session shout skins sms sndfile soundtouch speedo speex spl sse sse2 ssl startup-notification stats stream svg symlink tcpd theora tiff timidity truetype truetype-fonts type1-fonts udev unichrome unicode usb v4l v4l2 vcd visualization vlm vorbis wifi wxwindows x264 xfs xine xinerama xml xml2 xorg xprint xscreensaver xv xvid xvmc zeroconf zlib" 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" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse acecad aiptek calcomp citron digitaledge dmc dynapro elo2300 elographics fpit hyperpen jamstudio joystick magellan microtouch mutouch palmax penmount spaceorb summa synaptics tek4957 wacom ur98 vmmouse void wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" LIRC_DEVICES="audio audio_alsa" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev fglrx glint i128 i810 mach64 mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo epson nvidia"
Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Last edited by Red Knuckles on Thu Aug 02, 2007 19:31, edited 2 times in total.
SL 3.4a AMD64, Gentoo2007.0 AMD64 - ASUS M2NPV-VM - AMD64 X2 4800+ 2.5 Ghz - 4X1GB DDR2 800 - GeForce 6150 256MB - 2X320GB
Red Knuckles
Growing Hen
 
Posts: 104
Joined: Wed Jan 10, 2007 3:16
Location: Colorado, USA

/var/tmp/portage/kde-base/libkdegames-3.5.7/temp/build.log

Postby Red Knuckles » Tue Jul 31, 2007 1:36

Last 2 pages of /var/tmp/portage/x11-plugins/enigmail-0.95.1/temp/build.log:

nsIEnigMimeWriter.idl
nsIEnigMimeHeaderSink.idl
nsIEnigMimeListener.idl
nsIEnigMimeReadCallback.idl
nsEnigMsgCompose.cpp
nsEnigMsgCompFields.cpp
nsEnigMimeService.cpp
nsEnigMimeListener.cpp
nsEnigMimeWriter.cpp
nsEnigMimeDecrypt.cpp
nsEnigMimeVerify.cpp
nsEnigContentHandler.cpp
mimeenc2.cpp
mimehdrs2.cpp
mimedummy.cpp
mimeenig.cpp
nsEnigModule.cpp
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: nsEnigModule.o: relocation R_X86_64_PC32 again$
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
gmake[2]: *** [libenigmime.so] Error 1
gmake[1]: *** [libs] Error 2
make: *** [all] Error 2
^[[31;01m*^[[0m
^[[31;01m*^[[0m ERROR: x11-plugins/enigmail-0.95.1 failed.
^[[31;01m*^[[0m Call stack:
^[[31;01m*^[[0m ebuild.sh, line 1648: Called dyn_compile
^[[31;01m*^[[0m ebuild.sh, line 988: Called qa_call 'src_compile'
^[[31;01m*^[[0m ebuild.sh, line 44: Called src_compile
^[[31;01m*^[[0m enigmail-0.95.1.ebuild, line 161: Called die
^[[31;01m*^[[0m
^[[31;01m*^[[0m make enigmail failed
^[[31;01m*^[[0m If you need support, post the topmost build error, and the call stack if relevant.
^[[31;01m*^[[0m A complete build log is located at '/var/tmp/portage/x11-plugins/enigmail-0.95.1/temp/build.log'.
^[[31;01m*^[[0m
Last edited by Red Knuckles on Thu Aug 02, 2007 20:19, edited 3 times in total.
SL 3.4a AMD64, Gentoo2007.0 AMD64 - ASUS M2NPV-VM - AMD64 X2 4800+ 2.5 Ghz - 4X1GB DDR2 800 - GeForce 6150 256MB - 2X320GB
Red Knuckles
Growing Hen
 
Posts: 104
Joined: Wed Jan 10, 2007 3:16
Location: Colorado, USA

Postby voxiac » Tue Jul 31, 2007 13:57

Here is what I found about the issue:
http://www.gentoo.org/proj/en/base/amd6 ... t=1&chap=3

It does explain where the problem might be, but contains no clear directions of fixinig it. Methinks that it would involve patching Makefile or configure script. And I'm not the right person to help you with that :(.
voxiac
Advanced Hen
 
Posts: 218
Joined: Sat Feb 10, 2007 17:05
Location: Denmark

Postby Red Knuckles » Thu Aug 02, 2007 20:23

voxiac wrote:Here is what I found about the issue:
http://www.gentoo.org/proj/en/base/amd6 ... t=1&chap=3

It does explain where the problem might be, but contains no clear directions of fixing it. Methinks that it would involve patching Makefile or configure script. And I'm not the right person to help you with that :(.


Thanks, voxiac, for finding that link. I've read it and reread it several times and I don't get what to do fix the problem. Adding '-fPIC' to CFLAGS results in a message saying that doing so can break packages. What I need to do is fix packages or ebuilds. Does anyone one these forums know what to do with this error??? Or can anyone decipher what this Gentoo link is telling me will fix this??? I've tried using USE="-fPIC" on several different packages and haven't gotten one to emerge so far.

http://www.gentoo.org/proj/en/base/amd6 ... t=1&chap=3
SL 3.4a AMD64, Gentoo2007.0 AMD64 - ASUS M2NPV-VM - AMD64 X2 4800+ 2.5 Ghz - 4X1GB DDR2 800 - GeForce 6150 256MB - 2X320GB
Red Knuckles
Growing Hen
 
Posts: 104
Joined: Wed Jan 10, 2007 3:16
Location: Colorado, USA

Postby Red Knuckles » Thu Aug 02, 2007 23:26

OK, I think it's telling me this file:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld

needs to be built with '-fPIC'. How can I do that??? Do I need to modify the actual ebuild??? Not sure I'me qualified to do that but that seems to me what need to be done.
SL 3.4a AMD64, Gentoo2007.0 AMD64 - ASUS M2NPV-VM - AMD64 X2 4800+ 2.5 Ghz - 4X1GB DDR2 800 - GeForce 6150 256MB - 2X320GB
Red Knuckles
Growing Hen
 
Posts: 104
Joined: Wed Jan 10, 2007 3:16
Location: Colorado, USA

Postby Red Knuckles » Thu Aug 02, 2007 23:50

From 'man gcc':

-fpic
Generate position-independent code (PIC) suitable for use in a shared library, if supported for the
target machine. Such code accesses all constant addresses through a global offset table (GOT). The
dynamic loader resolves the GOT entries when the program starts (the dynamic loader is not part of
GCC; it is part of the operating system). If the GOT size for the linked executable exceeds a
machine-specific maximum size, you get an error message from the linker indicating that -fpic does not
lines 8980-9012/9375 95% work; in that case, recompile with -fPIC instead. (These maximums are 8k on the SPARC and 32k on the
m68k and RS/6000. The 386 has no such limit.)

Position-independent code requires special support, and therefore works only on certain machines. For
the 386, GCC supports PIC for System V but not for the Sun 386i. Code generated for the IBM RS/6000
is always position-independent.

When this flag is set, the macros "__pic__" and "__PIC__" are defined to 1.

-fPIC
If supported for the target machine, emit position-independent code, suitable for dynamic linking and
avoiding any limit on the size of the global offset table. This option makes a difference on the
m68k, PowerPC and SPARC.

Position-independent code requires special support, and therefore works only on certain machines.

When this flag is set, the macros "__pic__" and "__PIC__" are defined to 2.

Now where to set one or the other of these flags. CFLAGS?
SL 3.4a AMD64, Gentoo2007.0 AMD64 - ASUS M2NPV-VM - AMD64 X2 4800+ 2.5 Ghz - 4X1GB DDR2 800 - GeForce 6150 256MB - 2X320GB
Red Knuckles
Growing Hen
 
Posts: 104
Joined: Wed Jan 10, 2007 3:16
Location: Colorado, USA

Postby voxiac » Fri Aug 03, 2007 14:10

I begin to think that it's something wrong with your GCC. You have followed the instructions to upgrade it, right?
http://www.gentoo.org/doc/en/gcc-upgrading.xml
or
http://www.sabayonlinux.org/wiki/index. ... pgrade_GCC
voxiac
Advanced Hen
 
Posts: 218
Joined: Sat Feb 10, 2007 17:05
Location: Denmark

Postby Red Knuckles » Sat Aug 04, 2007 18:07

voxiac wrote:I begin to think that it's something wrong with your GCC. You have followed the instructions to upgrade it, right?
http://www.gentoo.org/doc/en/gcc-upgrading.xml
or
http://www.sabayonlinux.org/wiki/index. ... pgrade_GCC


Yes I have. I had no valuable data on that partition so I chucked it in favor of a fresh install of x86-64 3.4a. I'm currently doing world update on that. I'll start checking on failed packages now and see if that error comes up again [almost certainly will] and post back. I always need to ingest a few cups of coffee before dealing with failed packages! First update I made was to gcc-4.2.0. And then running 'gcc-config -f x86_64-pc-linux-gnu-4.2.0', 'env-update && source /etc/profile', and 'fix_libtool_files.sh 4.1.2'.
SL 3.4a AMD64, Gentoo2007.0 AMD64 - ASUS M2NPV-VM - AMD64 X2 4800+ 2.5 Ghz - 4X1GB DDR2 800 - GeForce 6150 256MB - 2X320GB
Red Knuckles
Growing Hen
 
Posts: 104
Joined: Wed Jan 10, 2007 3:16
Location: Colorado, USA

Postby Red Knuckles » Sat Aug 04, 2007 20:04

Red Knuckles wrote: Yes I have. I had no valuable data on that partition so I chucked it in favor of a fresh install of x86-64 3.4a. I'm currently doing world update on that. I'll start checking on failed packages now and see if that error comes up again [almost certainly will] and post back. I always need to ingest a few cups of coffee before dealing with failed packages! First update I made was to gcc-4.2.0. And then running 'gcc-config -f x86_64-pc-linux-gnu-4.2.0', 'env-update && source /etc/profile', and 'fix_libtool_files.sh 4.1.2'.


Results of 'emerge =x11-libs/qt-4.3.0-r2':

codecs/qiconvcodec.cpp: In static member function ‘static void* QIconvCodec::createIconv_t(const char*, const char*)’:
codecs/qiconvcodec.cpp:226: warning: deprecated conversion from string constant to ‘char*’
io/qprocess_unix.cpp: In member function ‘qint64 QProcessPrivate::bytesAvailableFromStdout() const’:
io/qprocess_unix.cpp:803: warning: dereferencing type-punned pointer will break strict-aliasing rules
io/qprocess_unix.cpp: In member function ‘qint64 QProcessPrivate::bytesAvailableFromStderr() const’:
io/qprocess_unix.cpp:815: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: .obj/release-shared/qiodevice.o: relocation R_X86_64_PC32 against `QList<QByteArray>::removeAt(int)' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[1]: *** [../../lib/libQtCore.so.4.3.0] Error 1
make: *** [sub-corelib-all-ordered] Error 2
*
* ERROR: x11-libs/qt-4.3.0-r2 failed.
* Call stack:
* ebuild.sh, line 1648: Called dyn_compile
* ebuild.sh, line 988: Called qa_call 'src_compile'
* ebuild.sh, line 44: Called src_compile
* qt-4.3.0-r2.ebuild, line 226: Called die
*
* (no error message)
* If you need support, post the topmost build error, and the call stack if relevant.

So the problem still exists. Newbies don't remove this file:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.0/../../../../x86_64-pc-linux-gnu/bin/ld

or you won't be able to compile much, if anything. DO NOT ask me how I know this... :oops: :roll: :shock:
SL 3.4a AMD64, Gentoo2007.0 AMD64 - ASUS M2NPV-VM - AMD64 X2 4800+ 2.5 Ghz - 4X1GB DDR2 800 - GeForce 6150 256MB - 2X320GB
Red Knuckles
Growing Hen
 
Posts: 104
Joined: Wed Jan 10, 2007 3:16
Location: Colorado, USA

Next

Return to Portage|Emerge Package Managers

Who is online

Users browsing this forum: No registered users and 2 guests