This is the mail archive of the
mailing list for the GCC project.
Re: 4.0.2/4.1 PATCH: Enforce PIC code for mips libffi (PR libgcj/21943)
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Cc: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Jun 2005 13:13:26 +0100 (BST)
- Subject: Re: 4.0.2/4.1 PATCH: Enforce PIC code for mips libffi (PR libgcj/21943)
- References: <17064.36014.387787.517648@cumaru>
On Thu, 9 Jun 2005, Rainer Orth wrote:
> As reported in PR libgcj/21943, the O32 libffi doesn't build on IRIX 6
> (haven't tried IRIX 5 yet) due to the following error:
> ld: FATAL 45 : Non-PIC (src/mips/.libs/o32.o) used in shared/call_shared link.
> It turns out that gas (unlike the native as) defaults to non-PIC code, so
> the above error is expected.
> I'm not sure if one wants to do something about this, either change gas in
> this respect or at least pass -KPIC by default or at least with
It looks like a bug in GCC specs for your target. Libffi builds just
fine for MIPS/Linux despite the same conditions (objects conforming to the
MIPS SysV ABI have to be PIC, gas defaults to non-PIC).
> Anyway, for the case at hand the fix is trivial. With that change, the O32
> libffi.so builds and testresults are not completely broken:
> To avoid any potential problems for N32, I've applied the same change there
> as well, although it doesn't seem to be necessary for some reason.
> Ok for mainline and the 4.0 branch once testing is complete and the branch
I'd suggest changing specs to pass "-KPIC" to gas instead or otherwise
you'll have problems with other assembly language sources anyway. For
Linux GCC passes this option to gas unless "-mno-abicalls" is given -- I
guess it should work for you as well. But I'll leave the decision up to
the MIPS maintainers.