Re: Failure to build GPC under Linux

Waldek Hebisch <[email protected]> Sat, 16 May 2020 23:54:25 +0200
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
On Sat, May 16, 2020 at 01:55:01PM -0700, John Ries 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=../gcc-4.3.5
> $SRCDIR/configure --program-suffix=-4.3.5 --disable-shared \
>                   --enable-languages=pascal --disable-multilib \
>                   --disable-mapped-location

You wrote that you are running Fedora, so I knew that.  I do not
know what is Fedora position concerning moving locations of
system files.  IIUC Debian changes were result of a proposal
supposedly having wide support.  I do not know if Fedora
decided that they will not make the changes or if they made
change preserving backwards compatibility.  In the second
case this may be a time bomb, some day they may decide
that backwards compatibility is no longer needed.
 
> 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 ???getline???
>    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 ???getline??? was
> here
>   616 | extern __ssize_t getline (char **__restrict __lineptr,
>       |                  ^~~~~~~
> ../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c: In function
> ???protect_end???:
> ../../../gcc-4.3.5/libiberty/testsuite/test-demangle.c:105:21: warning:
> implicit declaration of function ???getpagesize???
> [-Wimplicit-function-declaration]
>   105 |   size_t pagesize = getpagesize();
> 
> Cause for concern?

The above alone is no reason to worry.  GCC testsuite contains a lot
The above looks like test program which makes assumption about system
header files which are no longer valid.  GCC testsuite contains a lot
of test programs, and if one of them has such problem there is no
reason to worry.

More relevant for you is GPC testsuite.  I do not remember if
GCC 'make check' runs Pascal tests.  I normally run Pascal tests
chacging directory to 'gcc' subdirectory of build tree and typing

make pascal.check-long > ../chk_logg 2>&1

Note: the results take several screens so I use redirection to
catch them in file.  With gcc-4.x.x testsuite will fail if run
immediately after build.  Either install before running testsuite
or copy 'libgpc.a' from libgpc build directory to gcc subdirectory
and copy rts-confing.inc from libgpc build directory to gcc/p/rts
subdirectory (you need to create rts subdirectiry).

I normally do the second (copy files needed to run testsuite).

-- 
                              Waldek Hebisch