[pcre-dev] [Bug 1274] Cross compiling MIPS64, error relocat…

Etusivu
Poista viesti
Lähettäjä: Petr Pisar
Päiväys:  
Vastaanottaja: pcre-dev
Aihe: [pcre-dev] [Bug 1274] Cross compiling MIPS64, error relocation truncated to fit: R_MIPS_GOT_PAGE while linking libpcre.a
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1274




--- Comment #3 from Petr Pisar <ppisar@???> 2012-07-30 14:18:37 ---
This has nothing to do with PCRE. CFLAGS and LDLAFGS you pass to your compiler
and linker through configure are solely under your control.

I remember there were some fixes in binutils linker regarding GOT construction
on MIPS recently (a year back). However if you refer to GCC 3.4.6, I believe
this notice does not help you. You should try more recent tool-chain.

I use PCRE on n32 MIPS64 platform (natively) every day and I have not hit this
bug. I only recall some issues when linking xulrunner because its build script
hard-coded some erroneous flags.

As documentation states, the flag does not work on PIC code what shared library
is. Read -fpic documentation:

           Generate position-independent code (PIC) suitable for use in a
           shared library, if supported for the target machine.  Such code
           accesses all constant addresses through a global offset table
           (GOT).  The dynamic loader resolves the GOT entries when the
           program starts (the dynamic loader is not part of GCC; it is part
           of the operating system).  If the GOT size for the linked
           executable exceeds a machine-specific maximum size, you get an
           error message from the linker indicating that -fpic does not work;
           in that case, recompile with -fPIC instead.  (These maximums are 8k
           on the SPARC and 32k on the m68k and RS/6000.  The 386 has no such
           limit.)


It's possible that MIPS64 with 64-bit pointers consumes the GOT much quickly
than my n32.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email