This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PowerPC w/ shared libgcc: "R_PPC_REL24 relocation... out of range"
On Fri, Nov 16, 2001 at 11:19:46AM +1300, Bryce McKinlay wrote:
> H . J . Lu wrote:
>
> >On Fri, Nov 16, 2001 at 12:01:46AM +1300, Bryce McKinlay wrote:
> >
> >>I'm getting the following error when I try to run something linked
> >>against shared libgcc with current GCC:
> >>
> >>$ ./a.out
> >>./a.out: error while loading shared libraries:
> >>/home/bryce/gcc/lib/libgcc_s.so.1: R_PPC_REL24 relocation at 0x0ffd5ca4
> >>for symbol `_Jv_RegisterClasses' out of range
> >>
> >
> >Could you please do
> >
> ># readelf -a libgcc_s.so.1 | grep _Jv_RegisterClasses
> >
> >Something is wrong with your libgcc_s.so.1.
> >
>
> OK, it turns out that crtstuff was being built without -fPIC. The reason
> is that other targets define CRTSTUFF_T_CFLAGS_S to include "-fPIC", but
> in t-ppccomm we have:
>
> # There is no need to add -fPIC here because crtstuff is multilibbed
> # and so automatically gets -fPIC when needed.
> CRTSTUFF_T_CFLAGS_S = -msdata=none
>
> ... but I disabled multilib.
>
> FWIW, I understand the need to mulitlib libgcc on ppc-linux, but it
> sucks that libstdc++ and libgcj get multilibbed by default also. The
> builds take forever and waste disk space. I'd like to turn that off by
> default if possible.
>
How about this patch?
H.J.
---
2001-11-16 H.J. Lu <hjl@gnu.org>
* config.gcc (powerpc-*-linux*): Always set enable_multilib
to yes.
--- gcc/config.gcc.ppc Fri Nov 16 15:18:21 2001
+++ gcc/config.gcc Fri Nov 16 15:22:42 2001
@@ -2707,6 +2707,9 @@ powerpc-*-linux*)
out_file=rs6000/rs6000.c
tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
extra_headers=ppc-asm.h
+ # We always enable mutilib for kernel compile as well as
+ # compiling crtbeginS.o and crtendS.o with -fPIC
+ enable_multilib=yes
if test x$enable_threads = xyes; then
thread_file='posix'
fi