Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 509564 - sys-libs/zlib-1.2.8-r1: emake complains about relocation, should enable -fPIC in ebuild
Summary: sys-libs/zlib-1.2.8-r1: emake complains about relocation, should enable -fPIC...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-04 19:19 UTC by Romain Baugue
Modified: 2014-05-04 20:18 UTC (History)
0 users

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


Attachments
Build log (file_509564.txt,15.65 KB, text/plain)
2014-05-04 19:44 UTC, Romain Baugue
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Baugue 2014-05-04 19:19:07 UTC
While emerging kde-base/kdebase-meta in a 2-hours fresh gentoo installation, I got the following error while compiling sys-libs/zlib-1.2.8-r1 :

relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

According to the "HOWTO fix -fPIC errors" page in the gentoo handbook (amd64 version), the probable source of the error is the ebuild of the sys-libs/zlib package, that should use the -fPIC option to compile (and obviously doesn't).

Reproducible: Always

Steps to Reproduce:
1. emerge sys-libs/zlib-1.2.8-r1

Actual Results:  
[removed previous part of the compile output]

/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DPACKAGE_NAME=\"minizip\" -DPACKAGE_TARNAME=\"minizip\" -DPACKAGE_VERSION=\"1.2.8\" -D
PACKAGE_STRING=\"minizip\ 1.2.8\" -DPACKAGE_BUGREPORT=\"bugzilla.redhat.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"minizip\" -DVERSION=\"1.2.8
\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -D
HAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.  -I./../..   -march=native -O2 -pipe -
c -o zip.lo zip.c
libtool: compile:  gcc -DPACKAGE_NAME=\"minizip\" -DPACKAGE_TARNAME=\"minizip\" -DPACKAGE_VERSION=\"1.2.8\" "-DPACKAGE_STRING=\"minizip 
1.2.8\"" -DPACKAGE_BUGREPORT=\"bugzilla.redhat.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"minizip\" -DVERSION=\"1.2.8\" -DSTDC_HEADERS=1 -DHAV
E_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_
STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I./../.. -march=native -O2 -pipe -c unzip.c  -fPIC -DPIC -o .l
ibs/unzip.o
libtool: compile:  gcc -DPACKAGE_NAME=\"minizip\" -DPACKAGE_TARNAME=\"minizip\" -DPACKAGE_VERSION=\"1.2.8\" "-DPACKAGE_STRING=\"minizip 
1.2.8\"" -DPACKAGE_BUGREPORT=\"bugzilla.redhat.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"minizip\" -DVERSION=\"1.2.8\" -DSTDC_HEADERS=1 -DHAV
E_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_
STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I./../.. -march=native -O2 -pipe -c zip.c  -fPIC -DPIC -o .lib
s/zip.o
/bin/sh ./libtool  --tag=CC   --mode=link gcc  -march=native -O2 -pipe -L./../.. -version-info 1:0:0 -lz -Wl,-O1 -Wl,--as-needed -o libm
inizip.la -rpath /usr/lib64 ioapi.lo mztools.lo unzip.lo zip.lo   
libtool: link: gcc -shared  -fPIC -DPIC  .libs/ioapi.o .libs/mztools.o .libs/unzip.o .libs/zip.o   -L./../.. -lz -Wl,--as-needed  -march
=native -O2 -Wl,-O1   -Wl,-soname -Wl,libminizip.so.1 -o .libs/libminizip.so.1.0.0
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: ./../../libz.a(crc32.o): relocation R_X86_64_32 against `
.rodata' can not be used when making a shared object; recompile with -fPIC
./../../libz.a: could not read symbols: Bad value


Portage 2.2.8-r1 (default/linux/amd64/13.0/desktop/kde, gcc-4.7.3, glibc-2.17, 3.11.0-20-generic x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.11.0-20-generic-x86_64-Intel-R-_Pentium-R-_Dual_CPU_E2200_@_2.20GHz-with-gentoo-2.2
KiB Mem:     4047952 total,    126028 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Sun, 04 May 2014 18:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r3, 3.3.3
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="amd64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="amd64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://mirror.ovh.net/gentoo-distfiles/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync.fr.gentoo.org"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm gtk iconv ipv6 jpeg kde kipi lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qt3support qt4 readline sdl semantic-desktop session spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" 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" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-libs/zlib-1.2.8-r1 was built with the following:
USE="-minizip -static-libs" ABI_X86="64 -32 -x32"
CHOST="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CXXFLAGS="-O2 -pipe"
Comment 1 Rafał Mużyło 2014-05-04 19:39:18 UTC
Attach full build log.
Note, that your understanding of the mentioned guide is not quite correct.
Comment 2 Romain Baugue 2014-05-04 19:44:19 UTC
Created attachment 376368 [details]
Build log
Comment 3 Romain Baugue 2014-05-04 20:00:12 UTC
My understanding of the guide is that the source of the error can be :

- broken gcc, which is unlikely
- broken check, but this is not a check error
- missing flag in the software
- using a static archive with dynamic linking

I tried the following line

CFLAGS="-O2 -pipe -fPIC" emerge sys-libs/zlib

which solved the error, leading to another probably unrelated (unable to read SONAME from libz.so) about which I'm currently investigating.
Comment 4 Romain Baugue 2014-05-04 20:18:56 UTC
Looks like I was being wrong : the two issues are related, and the responsible for the bug is me.

During the installation process, I did a nano mis-manipulation and removed the CHOST line. I re-writed it manually the somehow didn't put the right value in it (amd64 instead of x86_64), leading to the two bugs mentionned in this page.

Correcting the value fixed the two bugs in one go (tested by removing then re-installing the package with and without the value).

I'm marking the bug resolved…
Sorry for the inconvenience.