libgmp.a text relocation error on powerpc-*

Torbjörn Granlund tg at gmplib.org
Tue Sep 14 17:00:47 UTC 2021


George Koehler <kernigh at gmail.com> writes:

  This report is for GMP 6.2.1.  The powerpc32 asm in the static library
  libgmp.a contains a text relocation; this causes a linker error when I
  use LLD to link a program with libgmp.a.  I have no problem with the
  shared library.

  The fix is simple: delete the quotes on `PIC_ALWAYS' in m4-asm.def:

  --- mpn/asm-defs.m4.orig
  +++ mpn/asm-defs.m4
  @@ -1051,7 +1051,7 @@ dnl  Normally PIC is defined (or not) by libtool, but 
   dnl  systems which are always PIC.  PIC_ALWAYS established in config.m4
   dnl  identifies these for us.
   
  -ifelse(`PIC_ALWAYS',`yes',`define(`PIC')')
  +ifelse(PIC_ALWAYS,`yes',`define(`PIC')')
   
Oh, that's a dumb bug.

I am baffled how this error could have happened, as it should not have
solved the problem it was meant to solve.

Thanks for isolating and reporting this!

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-bugs mailing list