Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 135048 - sys-fs/cryptsetup-luks-1.0.3-r1 emerge failed without -fPIC
Summary: sys-fs/cryptsetup-luks-1.0.3-r1 emerge failed without -fPIC
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: Benjamin Smee (strerror) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-31 08:11 UTC by Matteo Spreafico
Modified: 2006-06-01 02:40 UTC (History)
5 users (show)

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


Attachments
emerge --info (emerge.info,8.61 KB, text/plain)
2006-05-31 08:20 UTC, Matteo Spreafico
Details
Possible fix (cryptsetup-luks-1.0.3-r2.ebuild,2.40 KB, text/plain)
2006-05-31 19:24 UTC, Conrad Akier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matteo Spreafico 2006-05-31 08:11:41 UTC
sys-fs/cryptsetup-luks-1.0.3-r1  USE="nls -dynamic -pic"

/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/setup.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
.libs/setup.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libcryptsetup.la] Error 1
make[2]: Leaving directory `/var/tmp/portage/cryptsetup-luks-1.0.3-r1/work/cryptsetup-luks-1.0.3/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/cryptsetup-luks-1.0.3-r1/work/cryptsetup-luks-1.0.3'
make: *** [all] Error 2

!!! ERROR: sys-fs/cryptsetup-luks-1.0.3-r1 failed.
Call stack:
  ebuild.sh, line 1531:   Called dyn_compile
  ebuild.sh, line 931:   Called src_compile
  cryptsetup-luks-1.0.3-r1.ebuild, line 72:   Called die

!!! (no error message)
!!! If you need support, post the topmost build error, and the call stack if relevant.

It works with USE="pic"
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-05-31 08:14:39 UTC
emerge --info missing...
Comment 2 Matteo Spreafico 2006-05-31 08:20:13 UTC
Created attachment 87985 [details]
emerge --info
Comment 3 Matteo Spreafico 2006-05-31 08:20:54 UTC
I'm sorry. emerge --info attached
Comment 4 Alexander Jenisch 2006-05-31 10:17:55 UTC
seconded:

root@enti $ emerge --info
Portage 2.1_rc3-r2 (default-linux/amd64/2005.1, gcc-4.1.1, glibc-2.4-r3, 2.6.17-rc4 x86_64)
=================================================================
System uname: 2.6.17-rc4 x86_64 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System version 1.12.0
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  0.4.2-r1
sys-apps/sandbox:    1.2.18.1
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-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.16
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe -ftracer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=athlon64 -O2 -pipe -ftracer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache cvs distlocks fixpackages metadata-transfer metadata-transfere sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LC_ALL="en_US.utf8"
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/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X Xaw3d aac acpi alsa apache2 async ati audiofile automount avi bash-completion berkdb bitmap-fonts browserplugin bzip2 cairo cdda cli crypt ctype cups curl cvs dga dir divx4linux dlloader doc dri dts dvd dvdread eds emboss encode ethereal fam ffmpeg flac foomaticdb fortran freetype ftp gd gdbm gif glitz gphoto2 gpm gstreamer gtk gtk2 hal icq imagemagick imap imlib ipv6 isdnlog ithreads java javascript jpeg jpeg2k kde kdeenablefinal ldap libwww lm_sensors logitech-mouse lzw lzw-tiff mad maildir matroska mikmod mime mmap mng mp3 mpeg musicbrainz mysql ncurses nls nptl nptlonly nsplugin offensive ogg oggvorbis openal opengl oss pam pascal pcre pdf pdflib perl php png posix pppd python qt quicktime radeon rdesktop readline reflection rtc ruby samba sasl sdl server session slp sndfile sockets spamassassin spell spl sql ssl stream subversion svg swat symlink syslog tcltk tcpd tetex theora threads tiff truetype truetype-fonts type1-fonts unicode usb videos visualization vorbis webdav wxwindows xft xine xml xorg xosd xpm xv xvid zeroconf zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_evdev kernel_linux userland_GNU video_cards_ati video_cards_radeon"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 5 Joe Millenbach 2006-05-31 14:56:27 UTC
Thirded....

emerge --info
Portage 2.1_rc3-r3 (default-linux/amd64/2006.0, gcc-4.1.1, glibc-2.4-r3, 2.6.16-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.16-gentoo-r8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
Gentoo Base System version 1.12.0
ccache version 2.4 [enabled]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r1
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
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-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.16
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/mozilla/defaults/pref /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://gentoo.arcticnetwork.ca/pub/gentoo/ http://gentoo.osuosl.org ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/ ftp://cs.ubishops.ca/pub/gentoo "
MAKEOPTS="-j3"
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/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="amd64 7zip X a52 aac acpi aio alsa aotuv audiofile avi bash-completion berkdb bittorrent bzip2 cddb cdr cli cracklib crypt css cups dbus directfb dmi dri dts dvd eds emboss encode exif fam firefox font-server foomaticdb fortran gif gnome gpm gstreamer gtk gtk2 hal high-ints imagemagick imlib ipv6 isdnlog java javascript jpeg jpeg2k kde lzw lzw-tiff mad matroska mime mmap mp3 mp4 mpeg mplayer mysql ncurses nls nptl nptlonly nsplugin ntfs nvidia ogg openal opengl pam pcre pdf perl png pppd python qt quicktime readline reflection reiser4 reiserfs rtc rtsp sdl session sftp sharedmem slang smime smp spell spl ssl stream symlink tcpd theora threads thumbnail tiff transcode truetype-fonts type1-fonts unicode usb userlocales v4l v4l2 vorbis x264 xfs xine xml xmms xorg xpm xscreensaver xv xvid xvmc zlib elibc_glibc kernel_linux userland_GNU video_cards_nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 6 Conrad Akier 2006-05-31 19:24:20 UTC
Created attachment 88060 [details]
Possible fix

I started looking into the issue on my own and found notes about fixing -fPIC issues on AMD64.  One of the fixes suggested patching the 'configure' file in the source package to enforce -fPIC on shared objects:

http://devmanual.gentoo.org/archs/amd64/index.html

Looking at 'configure', it seemed that the configure script should already know to add -fPIC on its own for shared objects.  I took the cryptsetup-luks 1.0.3 source tarball and was able to compile the source successfully without using any ./configure options, so I started thinking that it was the ebuild causing the source compile to fail.  Sure enough, ebuild lines 62 and 68, which have the code "$(use_with pic) \" were forcing the compile to fail when the 'pic' USE flag was unset.  When the 'pic' USE flag is unset, the ebuild forces configure to run with the "--without-pic" option specified, overriding the default configure option of trying to build both PIC/non-PIC objects where appropriate.  This explains why setting the 'pic' flag worked for those that tried it.

Deleting all instances of "$(use_with pic) \"  (lines 62 and 68) fixed this problem for me.  I added some code to the ebuild to not run econf with "--without-pic" if the pic USE flag is not set.  My version still runs econf with "--with-pic" if the pic USE flag is set.

Does this fix work for everyone?  If so, is it an acceptable method of fixing it?  This is my first time submitting an ebuild, so I'm not completely sure what works around here.
Comment 7 Claes Mogren 2006-06-01 00:01:52 UTC
I had the same problem as mentioned the first posts, but Conrads improved ebuild fixed it. Think the ebuild looks good. :-)
/Claes
Comment 8 Benjamin Smee (strerror) (RETIRED) gentoo-dev 2006-06-01 02:40:12 UTC
fixed in cvs. Thanks for the patch, which I used except to take the variable out of global scope.