Re: Failure to build GPC under Linux

John Ries <[email protected]> Sat, 16 May 2020 14:49:47 -0700
Newsgroups gmane.comp.compilers.gpc
Message-ID <CAKqWTQL++5gy7P+A7_rnm3bT=UL3TGhrnodYtac7hDoJcDP3kQ@mail.gmail.com>
--===============4744997918282684082==
Content-Type: multipart/alternative; boundary="0000000000003ced8f05a5cae9f9"

--0000000000003ced8f05a5cae9f9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Well. that didn't work.  I get:

gpc-4.3.5 -c queues.p
gpc-4.3.5 -c ranklist.p
gpc-4.3.5 -o sav sav.p
/usr/bin/ld: cannot find -lgpc
collect2: ld returned 1 exit status

The only libgpc.a I see is from the GPC I built in 2014, so something is
definitely wrong.  I'll work in this some more later; but in the mean time,
any ideas?

John L. Ries
26215 197th Ave. SE
Covington, WA  98042
(435) 867-8885


On Sat, May 16, 2020 at 1:55 PM John Ries <[email protected]> wrote:

> Things have definitely improved.  After applying sum1.diff (I'm running
> Fedora, which is not a Debian derivative), I was able to build gpc
> configured as follows:
>
> SRCDIR=3D../gcc-4.3.5
> $SRCDIR/configure --program-suffix=3D-4.3.5 --disable-shared \
>                   --enable-languages=3Dpascal --disable-multilib \
>                   --disable-mapped-location
>
> But when running "make check", I get the following:
>
> cc -DHAVE_CONFIG_H -g -O2 -I..
> -I../../../gcc-4.3.5/libiberty/testsuite/../../include  -o test-demangle =
\
> ../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c ../libiberty.a
> ../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c:49:1: error:
> conflicting types for =E2=80=98getline=E2=80=99
>    49 | getline(buf)
>       | ^~~~~~~
> In file included from
> ../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c:26:
> /usr/include/stdio.h:616:18: note: previous declaration of =E2=80=98getli=
ne=E2=80=99 was
> here
>   616 | extern __ssize_t getline (char **__restrict __lineptr,
>       |                  ^~~~~~~
> ../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c: In function
> =E2=80=98protect_end=E2=80=99:
> ../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c:105:21: warning:
> implicit declaration of function =E2=80=98getpagesize=E2=80=99
> [-Wimplicit-function-declaration]
>   105 |   size_t pagesize =3D getpagesize();
>
> Cause for concern?
>
> I am going to go ahead and install and see if I can build SAV.
>
> John L. Ries
> 26215 197th Ave. SE
> Covington, WA  98042
> (435) 867-8885
>
>
> On Sat, May 16, 2020 at 6:34 AM Waldek Hebisch <[email protected]>
> wrote:
>
>> On Sun, May 10, 2020 at 07:18:01PM -0700, John Ries wrote:
>> > The error messages are:
>> >
>> > ../../gcc-4.3.5/gcc/toplev.c:545:1: error: redefinition of
>> ???floor_log2???
>> >   545 | floor_log2 (unsigned HOST_WIDE_INT x)
>> >       | ^~~~~~~~~~
>> > In file included from ../../gcc-4.3.5/gcc/toplev.c:58:
>> > ../../gcc-4.3.5/gcc/toplev.h:177:1: note: previous definition of
>> > ???floor_log2??? wa
>> > s here
>> >   177 | floor_log2 (unsigned HOST_WIDE_INT x)
>> >       | ^~~~~~~~~~
>> > ../../gcc-4.3.5/gcc/toplev.c:580:1: error: redefinition of
>> ???exact_log2???
>> >   580 | exact_log2 (unsigned HOST_WIDE_INT x)
>> >       | ^~~~~~~~~~
>> > In file included from ../../gcc-4.3.5/gcc/toplev.c:58:
>> > ../../gcc-4.3.5/gcc/toplev.h:183:1: note: previous definition of
>> > ???exact_log2??? wa
>> > s here
>> >   183 | exact_log2 (unsigned HOST_WIDE_INT x)
>> >       | ^~~~~~~~~~
>> >
>> > There is probably a GCC flag to allow such duplicate definitions, but =
I
>> > haven't found it yet (apparently, it isn't
>> -Wnoduplicate-decl-specifier).
>> > I'm using the GCC 4.3.5 codebase and building with GCC 9.3.1 under
>> Fedora
>> > 31 (x86_64).
>> >
>> > I'm running configure as follows:
>> >
>> > SRCDIR=3D../gcc-4.3.5
>> > export CFLAGS =3D"-fkeep-inline-functions -W -Wall -Wwrite-strings \
>> >                 -Wstrict-prototypes -Wmissing-prototypes \
>> >                 -Wold-style-definition -Wmissing-format-attribute \
>> >                 -pedantic -Wno-long-long -Wno-variadic-macros \
>> >                 -Wno-overlength-strings -fno-common \
>> >                 -Wnoduplicate-decl-specifier"
>> >
>> > $SRCDIR/configure --program-suffix=3D-4.3.5 --disable-shared \
>> >                   --enable-languages=3Dpascal
>> >
>> > The definition of CFLAGS was my attempt to allow the code to compile.
>> It
>> > made no difference.
>> >
>> > Any ideas as to how to proceed would be greatly appreciated.
>>
>> To compile with gcc-4.3.6 on Debian 10 I need two attached patches.
>> First one fixes to problem above and a few other problems.
>>
>> The second patch is a gross hack, to work around major breakage
>> due to changes in Debian.  Namely, Debian moved several critical
>> files to archtecture specific subdirectories.  For example,
>> instead of
>>
>> /usr/lib/crti.o
>>
>> there is
>>
>> /usr/lib/x86_64-linux-gnu/crti.o
>>
>> (or analogous thing for different architecture).  Notably,
>> compilation of GPC is affected by location of C include files.
>> If most C include files are in
>>
>> /usr/include/x86_64-linux-gnu
>>
>> then your system is affected.  ATM I do not know which distributions
>> use this scheme and which switched to Debian way.  The
>> second patch somewhat handles this issue.  It is unstatisfactory,
>> as it hardcodes 'x86_64-linux-gnu' and there is some (small ???)
>> breakage when compiling C files (this affects mixed Pascal and C
>> projects).  Anyway, with both patches applied I can compile
>> GPC on top of gcc-4.3.6 in Debian 10 using configure line:
>>
>> ../gcc-4.3.6.nn2/configure --enable-languages=3Dc,pascal --disable-multi=
lib
>> --disable-mapped-location
>>
>> Note that I always compile in directory separate from sources,
>> that is reason for '../' at the start. '.nn2' suffix is to
>> indicate that this is patched gcc (with two attached patches and
>> gcc-4.3.5 patch).
>>
>>
>> --
>>                               Waldek Hebisch
>>
>

--0000000000003ced8f05a5cae9f9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Well. that didn&#39;t work.=C2=A0 I get:<br><br>gpc-4=
.3.5 -c queues.p<br>gpc-4.3.5 -c ranklist.p<br>gpc-4.3.5 -o sav sav.p<br>/u=
sr/bin/ld: cannot find -lgpc<br>collect2: ld returned 1 exit status</div><d=
iv><br></div><div>The only libgpc.a I see is from the GPC I built in 2014, =
so something is definitely wrong.=C2=A0 I&#39;ll work in this some more lat=
er; but in the mean time, any ideas?<br></div><div><br></div><div><div><div=
 dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><=
div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=
=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div><div>John L.=
 Ries</div><div>26215 197th Ave. SE<br></div><div>Covington, WA=C2=A0 98042=
<br></div>(435) 867-8885<br></div></div></div></div></div></div></div></div=
></div></div></div></div></div></div></div><br></div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, May 16, 2020=
 at 1:55 PM John Ries &lt;<a href=3D"mailto:[email protected]">john@they=
arnbard.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex"><div dir=3D"ltr"><div>Things have definitely improved.=C2=A0 Aft=
er applying sum1.diff (I&#39;m running Fedora, which is not a Debian deriva=
tive), I was able to build gpc configured as follows:</div><div><br></div><=
div>SRCDIR=3D../gcc-4.3.5<br>$SRCDIR/configure --program-suffix=3D-4.3.5 --=
disable-shared \<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 --enable-languages=3Dpascal --disable-multilib \<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 --disable-mapped-location<=
/div><div><br></div><div>But when running &quot;make check&quot;, I get the=
 following:</div><div><br></div><div>cc -DHAVE_CONFIG_H -g -O2 -I.. -I../..=
/../gcc-4.3.5/libiberty/testsuite/../../include =C2=A0-o test-demangle \<br=
>	../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c ../libiberty.a<br>=
../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c:49:1: error: conflic=
ting types for =E2=80=98getline=E2=80=99<br>=C2=A0 =C2=A049 | getline(buf)<=
br>=C2=A0 =C2=A0 =C2=A0 | ^~~~~~~<br>In file included from ../../../gcc-4.3=
.5/libiberty/testsuite/test-demangle.c:26:<br>/usr/include/stdio.h:616:18: =
note: previous declaration of =E2=80=98getline=E2=80=99 was here<br>=C2=A0 =
616 | extern __ssize_t getline (char **__restrict __lineptr,<br>=C2=A0 =C2=
=A0 =C2=A0 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
^~~~~~~<br>../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c: In funct=
ion =E2=80=98protect_end=E2=80=99:<br>../../../gcc-4.3.5/libiberty/testsuit=
e/test-demangle.c:105:21: warning: implicit declaration of function =E2=80=
=98getpagesize=E2=80=99 [-Wimplicit-function-declaration]<br>=C2=A0 105 | =
=C2=A0 size_t pagesize =3D getpagesize();<br>=C2=A0</div><div>Cause for con=
cern?<br><br></div><div>I am going to go ahead and install and see if I can=
 build SAV.<br></div><div><br> </div><div><div><div dir=3D"ltr"><div dir=3D=
"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><di=
v><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div><div>John L. Ries</div><=
div>26215 197th Ave. SE<br></div><div>Covington, WA=C2=A0 98042<br></div>(4=
35) 867-8885<br></div></div></div></div></div></div></div></div></div></div=
></div></div></div></div></div><br></div></div><br><div class=3D"gmail_quot=
e"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, May 16, 2020 at 6:34 AM Wa=
ldek Hebisch &lt;<a href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex">On Sun, May 10, 2020 at 07:18:01PM -0700, John =
Ries wrote:<br>
&gt; The error messages are:<br>
&gt; <br>
&gt; ../../gcc-4.3.5/gcc/toplev.c:545:1: error: redefinition of ???floor_lo=
g2???<br>
&gt;=C2=A0 =C2=A0545 | floor_log2 (unsigned HOST_WIDE_INT x)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0| ^~~~~~~~~~<br>
&gt; In file included from ../../gcc-4.3.5/gcc/toplev.c:58:<br>
&gt; ../../gcc-4.3.5/gcc/toplev.h:177:1: note: previous definition of<br>
&gt; ???floor_log2??? wa<br>
&gt; s here<br>
&gt;=C2=A0 =C2=A0177 | floor_log2 (unsigned HOST_WIDE_INT x)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0| ^~~~~~~~~~<br>
&gt; ../../gcc-4.3.5/gcc/toplev.c:580:1: error: redefinition of ???exact_lo=
g2???<br>
&gt;=C2=A0 =C2=A0580 | exact_log2 (unsigned HOST_WIDE_INT x)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0| ^~~~~~~~~~<br>
&gt; In file included from ../../gcc-4.3.5/gcc/toplev.c:58:<br>
&gt; ../../gcc-4.3.5/gcc/toplev.h:183:1: note: previous definition of<br>
&gt; ???exact_log2??? wa<br>
&gt; s here<br>
&gt;=C2=A0 =C2=A0183 | exact_log2 (unsigned HOST_WIDE_INT x)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0| ^~~~~~~~~~<br>
&gt; <br>
&gt; There is probably a GCC flag to allow such duplicate definitions, but =
I<br>
&gt; haven&#39;t found it yet (apparently, it isn&#39;t -Wnoduplicate-decl-=
specifier).<br>
&gt; I&#39;m using the GCC 4.3.5 codebase and building with GCC 9.3.1 under=
 Fedora<br>
&gt; 31 (x86_64).<br>
&gt; <br>
&gt; I&#39;m running configure as follows:<br>
&gt; <br>
&gt; SRCDIR=3D../gcc-4.3.5<br>
&gt; export CFLAGS =3D&quot;-fkeep-inline-functions -W -Wall -Wwrite-string=
s \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Wstrict-=
prototypes -Wmissing-prototypes \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Wold-sty=
le-definition -Wmissing-format-attribute \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-pedantic=
 -Wno-long-long -Wno-variadic-macros \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Wno-over=
length-strings -fno-common \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0-Wnodupli=
cate-decl-specifier&quot;<br>
&gt; <br>
&gt; $SRCDIR/configure --program-suffix=3D-4.3.5 --disable-shared \<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0--=
enable-languages=3Dpascal<br>
&gt; <br>
&gt; The definition of CFLAGS was my attempt to allow the code to compile.=
=C2=A0 It<br>
&gt; made no difference.<br>
&gt; <br>
&gt; Any ideas as to how to proceed would be greatly appreciated.<br>
<br>
To compile with gcc-4.3.6 on Debian 10 I need two attached patches.<br>
First one fixes to problem above and a few other problems.<br>
<br>
The second patch is a gross hack, to work around major breakage<br>
due to changes in Debian.=C2=A0 Namely, Debian moved several critical<br>
files to archtecture specific subdirectories.=C2=A0 For example,<br>
instead of<br>
<br>
/usr/lib/crti.o<br>
<br>
there is<br>
<br>
/usr/lib/x86_64-linux-gnu/crti.o<br>
<br>
(or analogous thing for different architecture).=C2=A0 Notably,<br>
compilation of GPC is affected by location of C include files.<br>
If most C include files are in<br>
<br>
/usr/include/x86_64-linux-gnu<br>
<br>
then your system is affected.=C2=A0 ATM I do not know which distributions<b=
r>
use this scheme and which switched to Debian way.=C2=A0 The<br>
second patch somewhat handles this issue.=C2=A0 It is unstatisfactory,<br>
as it hardcodes &#39;x86_64-linux-gnu&#39; and there is some (small ???)<br=
>
breakage when compiling C files (this affects mixed Pascal and C<br>
projects).=C2=A0 Anyway, with both patches applied I can compile<br>
GPC on top of gcc-4.3.6 in Debian 10 using configure line:<br>
<br>
../gcc-4.3.6.nn2/configure --enable-languages=3Dc,pascal --disable-multilib=
 --disable-mapped-location<br>
<br>
Note that I always compile in directory separate from sources,<br>
that is reason for &#39;../&#39; at the start. &#39;.nn2&#39; suffix is to<=
br>
indicate that this is patched gcc (with two attached patches and<br>
gcc-4.3.5 patch).<br>
<br>
<br>
-- <br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Waldek Hebisch<br>
</blockquote></div>
</blockquote></div>

--0000000000003ced8f05a5cae9f9--


--===============4744997918282684082==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc

--===============4744997918282684082==--