util-linux gives an additional -fPIC error on amd64 with -pie in LDFLAGS. make[1]: Entering directory `/var/tmp/portage/util-linux-2.12-r4/work/util-linux-2.12/getopt' gcc -c -O2 -fomit-frame-pointer -I../lib -Wall -Wmissing-prototypes -Wstrict-prototypes -DNCH=1 -D_FILE_OFFSET_BITS=64 -DSBINDIR=\"/sbin\" -DUSRSBINDIR=\"/usr/sbin\" -DLOGDIR=\"/var/log\" -DVARPATH=\"/var\" -DLOCALEDIR=\"/usr/share/locale\" -O2 -fomit-frame-pointer -pipe -fstack-protector getopt.c -o getopt.o gcc -pie getopt.o -o getopt /usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.3/../../../../x86_64-pc-linux-gnu/bin/ld: getopt.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC getopt.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[1]: *** [getopt] Error 1 make[1]: Leaving directory `/var/tmp/portage/util-linux-2.12-r4/work/util-linux-2.12/getopt' temp fix is likely to filter-ldflags -pie, but the eventual goal is to get pie working.
Created attachment 28569 [details, diff] Patch against sys-apps/util-linux-2.12-r{4,5} to make them work with CFLGAS="-pie -fPIC" on amd64 The problem is, that -fPIC gets filtered by the ebuild(s) on all archs except x86, sparc, hppa and ppc. I added "amd64" to the list of archs on which no filtering of CFLAGS should happen and it works for me. I attach patches against sys-apps/util-linux-2.12-r{4,5} as those are the latest stable and the latest unstable version on amd64 (though the last one is package.mask'ed).
updated in ~arch only for now. util-linux-2.12-r5.ebuild Please test and help get it to a stable state.