linker failed with fpc rpm on CentOS 7

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

linker failed with fpc rpm on CentOS 7

Mattias Gaertner
Hi,

I installed fpc-3.0.4-1.x86_64.rpm from sourceforge on CentOS 7 and
compiling even the simplest of programs gives:

/bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/cprt0.o:
unrecognized relocation (0x2a) in section `.text'
/bin/ld: final link failed: Bad value

Is this known?

Mattias
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: linker failed with fpc rpm on CentOS 7

Pierre Muller


Le 12/12/2017 à 20:49, Mattias Gaertner a écrit :

> Hi,
>
> I installed fpc-3.0.4-1.x86_64.rpm from sourceforge on CentOS 7 and
> compiling even the simplest of programs gives:
>
> /bin/ld: /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/cprt0.o:
> unrecognized relocation (0x2a) in section `.text'
> /bin/ld: final link failed: Bad value
>
> Is this known?
  Yes and no ...

  Relocation  R_X86_64_REX_GOTP  (0x2a) is a new relocation type that was recently introduced in GNU binutils 2.26
for x86_64 (aka amd64) CPUs.

  This problem has been reported in
https://bugs.freepascal.org/view.php?id=32251


  Normally the .tar file should have been generated on a system that uses
an earlier GNU binutils version, avoiding the problem if
a Free Pascal program is linked using a less recent GNU linker version.

  Apparently, we did not check that this was also the case for the RPM file.

Could you please test the tar installer (or copy the rtl/*prt*.o
from the tar installation
 to  /usr/lib64/fpc/3.0.4/units/x86_64-linux/rtl/ directory)
and report if this fixes the issue?

  Alternatively, upgrading to a GNU linker version 2.26 or above
should also fix the linker error.

Pierre Muller
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: linker failed with fpc rpm on CentOS 7

Mattias Gaertner
On Tue, 12 Dec 2017 23:16:03 +0100
Pierre Muller <[hidden email]> wrote:

>[...]
>   Normally the .tar file should have been generated on a system that uses
> an earlier GNU binutils version, avoiding the problem if
> a Free Pascal program is linked using a less recent GNU linker version.
>
>   Apparently, we did not check that this was also the case for the RPM file.
>
> Could you please test the tar installer

The tar install works.

Mattias
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: linker failed with fpc rpm on CentOS 7

Pierre Muller


Le 13/12/2017 à 00:24, Mattias Gaertner a écrit :

> On Tue, 12 Dec 2017 23:16:03 +0100
> Pierre Muller <[hidden email]> wrote:
>
>> [...]
>>   Normally the .tar file should have been generated on a system that uses
>> an earlier GNU binutils version, avoiding the problem if
>> a Free Pascal program is linked using a less recent GNU linker version.
>>
>>   Apparently, we did not check that this was also the case for the RPM file.
>>
>> Could you please test the tar installer
>
> The tar install works.

  On the failing RPM install,
could you test this file:
ftp://ftp.freepascal.org/pub/fpc/dist/3.0.4/x86_64-linux/x86_64-linux-prt0-pre2.26-binutils.tar.gz

Simply extract it at the base 3.0.4 installation directory,
it contains the 4 files that are directly compiled using GNU assembler,
but the version from the general tar installer, which was generated on
a system with an old GNU binutils version.

Pierre


muller@gcc67:~/pas/fpc-3.0.4$ tar -tvzf x86_64-linux-prt0-pre2.26-binutils.tar.gz
-rw-r--r-- muller/muller 2224 2017-10-03 13:56 lib/fpc/3.0.4/units/x86_64-linux/rtl/cprt0.o
-rw-r--r-- muller/muller 1880 2017-10-03 13:56 lib/fpc/3.0.4/units/x86_64-linux/rtl/dllprt0.o
-rw-r--r-- muller/muller 2504 2017-10-03 13:56 lib/fpc/3.0.4/units/x86_64-linux/rtl/gprt0.o
-rw-r--r-- muller/muller 1896 2017-10-03 13:56 lib/fpc/3.0.4/units/x86_64-linux/rtl/prt0.o
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: linker failed with fpc rpm on CentOS 7

Mattias Gaertner
On Wed, 13 Dec 2017 14:05:34 +0100
Pierre Muller <[hidden email]> wrote:

>[...]

>   On the failing RPM install,
> could you test this file:
> ftp://ftp.freepascal.org/pub/fpc/dist/3.0.4/x86_64-linux/x86_64-linux-prt0-pre2.26-binutils.tar.gz
>
> Simply extract it at the base 3.0.4 installation directory,
> it contains the 4 files that are directly compiled using GNU assembler,
> but the version from the general tar installer, which was generated on
> a system with an old GNU binutils version.

It links with warnings:
crtbeginS.o not found, this will probably cause a linking failure
crtendS.o not found, this will probably cause a linking failure

And Lazarus runs.

Mattias
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: linker failed with fpc rpm on CentOS 7

Bart-48
On Wed, Dec 13, 2017 at 3:00 PM, Mattias Gaertner
<[hidden email]> wrote:

> It links with warnings:
> crtbeginS.o not found, this will probably cause a linking failure
> crtendS.o not found, this will probably cause a linking failure


IIRC: if you have gcc installed, then these files are somewhere on
your system (I forgot how to ask gcc to tell you), then you can adjust
the library path in fpc,cfg accordingly.

Bart
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal