[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    Re: [Pcc] latest PCC and Linux, here you go
From:       Aharon Robbins <arnold () skeeve ! com>
Date:       2014-11-30 17:41:00
Message-ID: 201411301741.sAUHf0wp002729 () skeeve ! com
[Download RAW message or body]

Hi Thorsten.

> Date: Sat, 29 Nov 2014 21:31:38 +0000 (UTC)
> From: Thorsten Glaser <tg@mirbsd.de>
> To: Aharon Robbins <arnold@skeeve.com>
> cc: pcc@lists.ludd.ltu.se
> Subject: Re: [Pcc] latest PCC and Linux, here you go
>
> Aharon Robbins dixit:
>
> >Here are diffs that fix the issues with Linux and with dependencies.
>
> I'm curious as to your problems. I just added the M-A patch
> to a checkout and built pcc with no problems. I had pcc-libs
> built with GCC, and could immediately build 99 bottles of beer
> with that with no problems, those additional files were just
> found correctly after the M-A patch was added.

My problems are described in a sec. I did not try the M-A patch; it may
be that it addresses some of them.  If so, that is just fine with me and
it's up to the PCC developers to decide what they want to incorporate
in their code base.

On an x86_64 Ubuntu 12.04 Linux system, I check out pcc and pcc-libs
with CVS, getting the trunk by default.

configure and build and install of both works fine.

1. The resulting pcc cannot compile a hello world program since the
include of <stdio.h> goes looking for <stddef.h> and doesn't find it.

This is due to the version mismatch between the configure.ac of pcc
and that of pcc-libs; pcc-libs puts headers and other stuff in a place
different from where pcc looks for it.  Fixing pcc-libs/configure.ac
and rebuilding fixes this issue.

2. Run 'make clean', configure, make, make install and now the
resulting pcc can compile the hello world program but not link it.

This is due to the fact that the driver looks for various crt*.o files
that aren't installed.  Fixing pcc-libs/csu/linux/Makefile to compile
and install the larger list of files fixes this issue.

3. Run 'make clean', configure, make, make install and now the
resulting pcc can compile the hello world program and link it.
All is well, right?

Not quite.  In the gawk code base (which is what interests *me* :-)
I can do

	./configure CC=pcc && make

and I get a nice gawk executable. I then do 'make check' and things
blow up.

Why? The makefile tries to include various *.Po files from the .deps
directory.  These are the result of running pcc -M on each file in
order to produce dependencies for make.

What's the problem?  The files include the dependencies, AND ALSO THE
TEXT OF THE PREPROCESSED FILE!  Ooops.  Make doesn't understand typedefs,
struct definitions, and other such stuff. :-)

The changes in the cpp directory fix this problem by restoring the
buffering layer that turned off regular output if -M had been given.
This code is restored from an earlier version of cpp and adapted to the
current structure of cpp which uses stdio to stdout.

4. Run 'make clean', configure, make, make install and now the
compiler builds gawk AND generates only the dependencies in the .deps/*.Po
files and things work just fine.

The cpp changes are critical IMHO.  The configure.ac changes make sense
to me since I suspect that it's desirable to keep the version numbers
in sync.  If the M-A patch solves problems #1 and #2, that's also OK.

HTH,

Thanks,

Arnold
_______________________________________________
Pcc mailing list
Pcc@lists.ludd.ltu.se
http://lists.ludd.ltu.se/cgi-bin/mailman/listinfo/pcc
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic