[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

installed gprolog 1.4.4 on debian 9 (stretch) with gcc 6.3 in a kind of

From: Dan Hitt
Subject: installed gprolog 1.4.4 on debian 9 (stretch) with gcc 6.3 in a kind of hackey way, please lmk of a better way if possible
Date: Mon, 19 Mar 2018 20:56:39 -0700

I have a debian 9 system on which i tried to build gprolog 1.4.4.

It was unsuccessful, as a very vanilla build ran into problems where
some of the *.o files had relocation type R_X86_64_32S and thus could
not be linked into shared objects.

The net had some information about this, including some helpful advice
from Salvador A, in response to a question Sean.  The gist of their
discussion was to get in flags -fPIC and -no-pie to gcc.

I did this, but it was not quite enough.

So i'm describing here how i hacked it through, but would greatly
appreciate any information on how to do a build without hand-modifying
any Makefiles.

My configure command was
./configure --prefix=$HOME/path/to/dir  --with-c-flags="-fPIC -no-pie"

After configuring, make would fail with the bad relocation type, but
only the files compiled from wam sources triggered the error.

So in the bowels of the build system, it looks like although gcc was
getting the -fPIC -no-pie flags, gplc was not.

So i edited 4 Makefiles, in the directories BipsPl, Pl2Wam, Fd2C,
BipsFD.  In each of those directories, if the variable GPLCFLAGS was
specified (generally to --fast-math), i changed it by adding -fPIC (so
that it would be --fast-math -fPIC).  Also, in the directories BipsPl
and Pl2Wam i added -fPIC to the rule for .wam.o files.  In the
directory BipsFD, GPLCFLAGS was used, but not defined, so i made it
equal to -fPIC.  I did not put --fast-math on it, because i don't
really know what i'm doing here.

With these changes, made to a configured but otherwise completely
clean extraction, compilation was successful and at least the program
gprolog is willing to accecpt input.  (I haven't pushed it very hard,
so we'll see how things go.)

Note that i did not pass -no-pie to gplc, because it does not accept
that option.

I imagine this process is far short of ideal, so i'd be grateful for
any clues on how to do this without hand-editing any Makefiles.  For
example, a configure option of --with-gplc-flags would be useful, but
./configure --help does not reveal such a flag.

In any event, i'm posting because i don't think my system is very
unique and other debian users may run into this problem.

Thanks for any guidance! :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]