Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 52813

Summary: ebuilds with bad relocations due to missing PIC compilation
Product: Gentoo Linux Reporter: Joe Jezak (RETIRED) <josejx>
Component: New packagesAssignee: SpanKY <vapier>
Status: RESOLVED FIXED    
Severity: normal CC: base-system, net-dialup, solar
Priority: High    
Version: unspecified   
Hardware: PPC   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Requested output
Same as above for net-dialup/ppp
libcap-pic-fixup.diff
Another log

Description Joe Jezak (RETIRED) gentoo-dev 2004-06-02 13:43:37 UTC
Compiling net-dialup/ppp, sys-libs/libcap causes an error with ld:
Error: The symbol <NAME OF SYMBOL> has a R_PPC_REL24 relocation, that means <lib_name> was compiled without -fPIC.

Compiling with -fPIC in my CFLAGS fixes the problem, but the ebuilds should be fixed.

net-dialup/ppp/ppp-2.4.2-r2.ebuild
5c5
< inherit eutils gnuconfig
---
> inherit eutils gnuconfig flag-o-matic
60a61
>       append-flags "-fPIC"

sys-libs/libcap/libcap-1.10-r4.ebuild
43a44
>       use ppc && append-flags -fPIC

This probably needs a line for ppc64 as well?

I have a Powerbook G4 Ti 500Mhz.
CFLAGS="-O2 -pipe -mpowerpc-gfxopt -mcpu=7400 -maltivec -mabi=altivec"
I would be happy to provide any other information required.
Comment 1 solar (RETIRED) gentoo-dev 2004-06-02 18:01:31 UTC
libpcap is a library so it should append-flags -fPIC all the time if the build does not provision for it. I know spanky and myself a while ago talked about this problem in libcap a good some many months ago. We opted to take a debain patch. which solves the problem. So... How the heck is this showing up for you on a ppc.

So what you could do to help us out is. 
hop on your ppc and double check that fPIC is not one of it's CFLAGS.

emerge info >> ppc-libcap-emerge.txt
ACCEPT_KEYWORDS="ppc" emerge libcap >> ppc-libcap-emerge.txt
grep fPIC ppc-libcap-emerge.txt

If nothing here then we must fix. Please attach it none the less.

I don't think net-dialup@ is the right place for bug # this either.
Comment 2 SpanKY gentoo-dev 2004-06-03 06:27:05 UTC
i can get my ppc back from my gf in the next few days (the weekend for
sure) ... then i can track down this bug
Comment 3 Joe Jezak (RETIRED) gentoo-dev 2004-06-03 07:48:55 UTC
Created attachment 32589 [details]
Requested output

Here's the output from the compile of sys-libs/libcap.	I added stderr to the
output to show the error.  It looks like libcap_wrap isn't being compiled with
-fPIC but needs to be.
Comment 4 Joe Jezak (RETIRED) gentoo-dev 2004-06-03 07:54:30 UTC
Created attachment 32592 [details]
Same as above for net-dialup/ppp

Here's the output from net-dialup/ppp.	It looks like buildreq needs to be
built with -fPIC.
Comment 5 solar (RETIRED) gentoo-dev 2004-06-03 09:20:11 UTC
Created attachment 32594 [details, diff]
libcap-pic-fixup.diff

SpanKY want to bless or curse this diff?
libcap is a shared library so it should always be PIC and not just the cases
for alpha/hppa/amd64/ppc
internal reference http://www.gentoo.org/proj/en/hardened/pic-internals.xml
Comment 6 solar (RETIRED) gentoo-dev 2004-06-03 09:26:41 UTC
net-dialup will want to do the same sort of thing for the shared library parts of pppd but not on the global scale or people will byte your head off ;/
Comment 7 Joe Jezak (RETIRED) gentoo-dev 2004-06-04 07:18:49 UTC
Created attachment 32637 [details]
Another log

When linking abiword, I get relocation errors as well, it looks like the
problem is in ncurses: '/usr/lib/libcurses.a(lib_termcap.o)' was compiled
without -fPIC.
Comment 8 SpanKY gentoo-dev 2004-06-07 05:26:55 UTC
here's the fix for ppp:
last line of src_unpack()
sed -i -e '/^CFLAGS/s:$: -fPIC:' pppd/plugins/radius/radiusclient/lib/Makefile.in || die
Comment 9 SpanKY gentoo-dev 2004-06-07 09:52:30 UTC
added the -fPIC fix for ppp to cvs

the libcap error is related to swig ... disable the python module when emerge libcap and it'll work ...
Comment 10 SpanKY gentoo-dev 2004-06-23 19:49:13 UTC
libcap PIC was fine ... it was the python module that was screwing up everything ...

i updated the python patch to utilize the PIC object files

oh and i have bless your patch solar :) i removed the append-flags crap but fixed the python patch to keep fPIC out of CFLAGS

as for the abiword bug, i'm not even going to touch that ... file a bug with gnome if you care
Comment 11 SpanKY gentoo-dev 2004-06-23 19:50:23 UTC
although that curses bug looks like a broken toolchain ... it selected the .a in /usr/lib instead of the .so in /lib ...

i'd suggest updating your binutils/gcc to the latest stable on ppc
Comment 12 Joe Jezak (RETIRED) gentoo-dev 2004-06-23 22:33:43 UTC
Upgrading the toolchain to ~ppc latest fixed the remainder of my problems.  Thanks!