Linking errors from gplc with ld 2.28

Jasper Taylor <[email protected]> Fri, 21 Jul 2017 11:25:59 +0100
Newsgroups gmane.comp.gnu.prolog.bugs
Message-ID <[email protected]>
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