Linking errors from gplc with ld 2.28

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

Linking errors from gplc with ld 2.28

Jasper Taylor
I just upgraded my Debian box from Jessie to Stretch and I find I can no
longer use gplc to convert Prolog code into executables. I get a lot of
error messages starting as follows...

/usr/bin/ld: /tmp/gplcMP1nIg.o: relocation R_X86_64_32S against `.text'
can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/gprolog-1.4.4/lib/all_pl_bips.o: relocation
R_X86_64_32S against `.text' can not be used when making a shared
object; recompile with -fPIC
/usr/bin/ld: /usr/local/gprolog-1.4.4/lib/all_fd_bips.o: relocation
R_X86_64_32S against `.text' can not be used when making a shared
object; recompile with -fPIC
.

.

/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
compilation failed

The first line refers to the object file generated from the Prolog code,
subsequent lines to objects included in the gprolog installation. Debian
Stretch includes ld version 2.28, while systems on which gplc works
properly include ld version 2.25.

Adding -C '-fPIC' makes no difference, presumably because the c compiler
is not used when converting Prolog code to executable. Adding -A -'fPIC'
produces an error message from the assembler, presumably because
position-independence is determined in the assembly language code and
cannot be added by the assembler.

I get similar errors attempting to recompile gprolog on the new system.
Does anyone know what is going on?

     --Jasper



_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog
Reply | Threaded
Open this post in threaded view
|

Re: Linking errors from gplc with ld 2.28

Keri Harris-2
On 21/07/2017 12:25, Jasper Taylor wrote:

> I just upgraded my Debian box from Jessie to Stretch and I find I can no
> longer use gplc to convert Prolog code into executables. I get a lot of
> error messages starting as follows...
>
> /usr/bin/ld: /tmp/gplcMP1nIg.o: relocation R_X86_64_32S against `.text'
> can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: /usr/local/gprolog-1.4.4/lib/all_pl_bips.o: relocation
> R_X86_64_32S against `.text' can not be used when making a shared
> object; recompile with -fPIC
> /usr/bin/ld: /usr/local/gprolog-1.4.4/lib/all_fd_bips.o: relocation
> R_X86_64_32S against `.text' can not be used when making a shared
> object; recompile with -fPIC
> .
>
> .
>
> /usr/bin/ld: final link failed: Nonrepresentable section on output
> collect2: error: ld returned 1 exit status
> compilation failed
>
> The first line refers to the object file generated from the Prolog code,
> subsequent lines to objects included in the gprolog installation. Debian
> Stretch includes ld version 2.28, while systems on which gplc works
> properly include ld version 2.25.
>
> Adding -C '-fPIC' makes no difference, presumably because the c compiler
> is not used when converting Prolog code to executable. Adding -A -'fPIC'
> produces an error message from the assembler, presumably because
> position-independence is determined in the assembly language code and
> cannot be added by the assembler.
>
> I get similar errors attempting to recompile gprolog on the new system.
> Does anyone know what is going on?

It's quite possible that this particular problem has been fixed by
upstream commit cc8249 [1]. Are you able to apply that fix and rebuild
gprolog?


Thanks

Keri

[1] https://sourceforge.net/p/gprolog/code/ci/cc8249


_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog
Reply | Threaded
Open this post in threaded view
|

Re: Linking errors from gplc with ld 2.28

Daniel Diaz-3
In reply to this post by Jasper Taylor
Hi Jasper,

this is due to the last gcc. The bug has been fixed on the sourceforge repository.
But you can also easily fix it since there is one file to change:

file src/Ma2Asm/x86_64_any.c:213
replace

#if defined(M_x86_64_darwin) || defined(M_x86_64_bsd)

by

#if defined(M_x86_64_darwin) || defined(M_x86_64_bsd) || defined(M_x86_64_linux)

Then (in src):

make clean
make
make check

Hope this helps

Daniel

 

> Le 21 juil. 2017 à 12:25, Jasper Taylor <[hidden email]> a écrit :
>
> I just upgraded my Debian box from Jessie to Stretch and I find I can no longer use gplc to convert Prolog code into executables. I get a lot of error messages starting as follows...
>
> /usr/bin/ld: /tmp/gplcMP1nIg.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: /usr/local/gprolog-1.4.4/lib/all_pl_bips.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: /usr/local/gprolog-1.4.4/lib/all_fd_bips.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC
> .
>
> .
>
> /usr/bin/ld: final link failed: Nonrepresentable section on output
> collect2: error: ld returned 1 exit status
> compilation failed
>
> The first line refers to the object file generated from the Prolog code, subsequent lines to objects included in the gprolog installation. Debian Stretch includes ld version 2.28, while systems on which gplc works properly include ld version 2.25.
>
> Adding -C '-fPIC' makes no difference, presumably because the c compiler is not used when converting Prolog code to executable. Adding -A -'fPIC' produces an error message from the assembler, presumably because position-independence is determined in the assembly language code and cannot be added by the assembler.
>
> I get similar errors attempting to recompile gprolog on the new system. Does anyone know what is going on?
>
>    --Jasper
>
>
>
> _______________________________________________
> Bug-prolog mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/bug-prolog


_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog