[TUHS] Portable C Compiler Revived - Revived!
Clem Cole via TUHS
tuhs at tuhs.org
Wed Feb 11 06:05:00 AEST 2026
below. As Arnold says, the repository is Anders Magnusson, and Arnold was
just saying that he was able to get that compiler to compile awk. At his
suggestion, I reached out to Anders for clarification (and CC'ed Arnold).
Much of our interface is below.
On Tue, Feb 10, 2026 at 2:01 AM John Cowan via TUHS <tuhs at tuhs.org> wrote:
> There's some interesting things in there: the f77 and fcom compilers (but
> not the i77 library);
Yes, that would need to be added as a minimum if this were to
be targeted for real work. I did not poke at it too far, but given that it
is missing i77, I suspect the ANSI suite would return a number of issues.
Moreover, the UCB 4.X release of F77 was never particularly strong (and
could not pass it either).
> the "inc" (?) and "none" (bare metal) operating
> systems; and the "m16c" (Mitsubishi), "nova" (Data General), "pdp7", and
> "pdp10" architectures.
Yes, he was extremely prolific but .. there are some missing pieces. WRT
to the pdp10 target, it would be interesting how compairs the one in Panda
(TOPS-20) distribution, which is used to prove a "UNIX-Like" (sort of) set
of commands for TOPS-20.
> There is also a separate compiler called "mip": I don't know what that is.
>
The mip directory in the original PCC suite is the "Machine Independent
Pieces" and is common to all target ISAs and OSs (which are primarily
UNIX-based).
My Question to Anders in blue/ his response in orange:
1.) So, the first core question I have is, what is the provenance of your
code base? Is it based on one of the original PCC threads (V7 or V32)
directly, or modified by UCB (or someone else), or any of this code based
on the later PCC2?
The original 32V code. I fetched it when Caldera released it around 25
years ago. The BSD improvements was not released publically then.
I had a wiki up until a few years ago about this (until the machine running
it broke down). Quite trivial but with some useful information. Haven't
spent any time to set it up again. Available using webarchive:
https://web.archive.org/web/20230819230148/http://pcc.ludd.ltu.se/
2.) Looking at the man page source, am I correct in believing the C
front-end supports C99?
True. I have over the last 25 years done quite some improvements, also in
the backend.
3.) You have a directory called cxxcom and seem to build a binary of that
name, but no man page. Looking at some of the files, such as cgram.y It
looks to me like you are declaring C++ tokens also? So I'm thinking this
is a C++ implementation. If so, does it try to follow any of the C++
standards (which ones)?
:-) This was something I did quite some time ago (around 20 years ago)
(because I had some free time). It is not working; and is very
rudimentary. It passed "Hello World", but not much more than that. I
checked it in so that it shouldn't get lost if someone wants to rescurrect
it.
4.) You have a bunch of backends besides PDP-11 and VAX. You clearly wrote
many of these, which is impressive. Did the PDP-11 and Vax start from the
original Johnson (PDP-11) and Riesner (Vax) code bases? Did any of the
others come from elsewhere (such as the set released by Steve Ward's RTS
group at MIT)?
The VAX was from 32V. The PDP11 backend was written by me, and as far as I
remember, there is no other backend coming from any other sources (mostly
due to licensing issues).
5.) The compilers generate assembler mnemonic as did the originals. Given
the wide range of architectures and OS targets, the question arises: which
assemblers and linkers does each target support, and is there a repository
for them?
Well, no. The output is for the OS (or SDK) which it has been ported to. It
is usually expected to run in a Unix environment.
Also note that many of the (more obscure) backends are not complete; for
example Nova do not support any floating point.
6.) It was unclear to me if these compilers could easily be built as
cross-compilers.
Yes, most of them can. It uses the normal configure, so just specify a
different target.
I have broken out the floating point stuff so targets like vax/pdp11 easily
should be able to cross-compile.
A small idea/request. It would be helpful if you had a text file called
READ_ME with notes like my questions and maybe a few more details WRT to
each, plus any hints on how to build them. I also think it would be
helpful to include a short description of the provenance. Since I think
these are based on either V7/V32 PCC, it might be wise to consider placing
a copy of the Caldera license [
https://www.tuhs.org/Archive/Caldera-license.pdf] at the top level of your
tree.
I think the questions you asked are answered on the (archived) web site.
Maybe add a link to it somewhere?
The caldera license is added to each file (as is common), but having
license information about the project might be a good idea as well.
...I am not really up-to-speed with using git/github, so feel free to
provide improvements that way :-)
I'm trying to learn (in the little time I have left hacking - daytime job
takes quite some time for me).
More information about the TUHS
mailing list