Build failed with error: /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: build/common.a(commonTypes.o): relocation R_X86_64_PC32 against `pow@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value Reproducible: Always Steps to Reproduce: 1. Switch profile to hardened ~amd64 2. Rebuid world 4. Look for failed mldonkey Actual Results: Adding "-fPIC" to CFLAGS does not solve problem. With USE="-ocamlopt" app compiles just fine. gcc -v Reading specs from /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/specs Configured with: /var/tmp/portage/sys-devel/gcc-3.4.6-r2/work/gcc-3.4.6/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/3.4.6 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4.6 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4.6/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/3.4.6/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/include/g++-v3 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --disable-libgcj --enable-languages=c,c++,treelang --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 3.4.6 (Gentoo Hardened 3.4.6-r2 p1.5, ssp-3.4.6-1.0, pie-8.7.10) Portage 2.1.5_rc6 (hardened/amd64, gcc-3.4.6, glibc-2.7-r2, 2.6.25-gentoo-r1 x86_64) ================================================================= System uname: 2.6.25-gentoo-r1 x86_64 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz Timestamp of tree: Thu, 24 Apr 2008 22:45:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p33 dev-lang/python: 2.5.2-r2 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 2.0.0 sys-apps/openrc: 0.2.2 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.62 sys-devel/automake: 1.9.6-r2, 1.10.1 sys-devel/binutils: 2.18-r1 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.25-r1 ACCEPT_KEYWORDS="amd64 ~amd64" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=nocona -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-march=nocona -O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="ccache distlocks parallel-fetch sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="ftp://mirror.yandex.ru/gentoo-distfiles/ ftp://gentoo.tiscali.nl/pub/mirror/gentoo/ http://gentoo.tiscali.nl/ http://21cma.bao.ac.cn/gentoo/distfiles/" LANG="ru_RU.UTF-8" LC_ALL="ru_RU.UTF-8" LDFLAGS="" LINGUAS="ru en" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/mine" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="a52 aac acl acpi alsa amd64 async berkdb bzip2 caps cgi charconv cli cracklib crypt ctype daemon diskio encode exif expat extensions fastcgi ffmpeg force-cgi-redirect gd gpm hardened ifsession javascript justify logrotate mailwrapper memcache midi mysql mysqli ncurses network nfs nls nptl nptlonly ogg openmp pam pcre perl php pic png posix python readline remote samba sensord server session shaper sitemisc slang snmp sockets sqlite sse2 ssl swat taglib tcpd threads truetype unicode urandom vchroot vorbis x264 xml xorg xvid 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" APACHE2_MODULES="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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" USERLAND="GNU" VIDEO_CARDS="vesa" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 150958 [details] Complete build log
@aballier: Please tell me what common e-mail address to CC for ml bugs. :)
(In reply to comment #2) > @aballier: Please tell me what common e-mail address to CC for ml bugs. :) ml@g.o should be fine @Nikolay: what ocaml version are you using ? stable one (3.09.3) is known to have problems with hardened. 3.10.2 should be much better (in the sense that it doesnt try to use pie/pic where it cant); this one should go stable soon, I'm working on the last few remaining bits before asking for it.
It's 3.10.2: #ocaml -version The Objective Caml toplevel, version 3.10.2
It seems mldonkey overrides the gcc call configured at ocaml build time for hardened. We have this in ocaml ebuild: pkg_setup() { # dev-lang/ocaml creates its own objects but calls gcc for linking, which will # results in relocations if gcc wants to create a PIE executable if gcc-specs-pie ; then append-ldflags -nopie ewarn "Ocaml generates its own native asm, you're using a PIE compiler" ewarn "We have appended -nopie to ocaml build options" ewarn "because linking an executable with pie while the objects are not pic will not work" fi } This is probably what you need for mldonkey.
That works! :))
This should definetely be in ebuild, I think.
So... What can I do for this fix to be added to the tree? Or nobody cares? Or maybe this fix is not safe enough?
vs. just linking with nopie. You might actually want to pass down -fno-pie to the build process to the final ET_EXEC does not get -fPIE on it's object files while compiling.
Don't close this bug until is fixed
(In reply to comment #7) > This should definetely be in ebuild, I think. > comitted