Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/replica/cfront/inf

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


AT&T™ cfront C++ pre-compiler, update to v3.03 of old plan9 port

Introduction
The first and seccond version of plan9 were supplied with the cfront
c++ compilation environment; Later releases were not.  The release of
the Cfront sourcecode by AT&T has enabled the release the Plan9 cfront
package (V3.01).  This has been updated to the most last available
release (V3.03).
http://www.softwarepreservation.org/projects/c_plus_plus

Status
Cfront cannot be regarded as a replacement for a modern c++ compiler
for plan9, however it is interesting and it will compile some simple
historic code (eg the pm troff preprocessor). The compiler is currently
self hosting and will compile pm.

Differences
The major differences between the AT&T release and the plan9
implementation are in the support of multiple hetrogenious
architectures, and the implementation of the compiler driver as a C
program rather than a Bourne shell script.


64bit, long longs
A first attempt at adding support for the "long long" datatype to
cfront was made, sadly this work is not complete, and is currently
commented out, it can be re-enabled by removing the ``FIXME long
long'' comments.

The Task library
The task library remains un-ported and both the 3.01 and 3.03 versions
of the source code are included in the release package.  The structure
of the library was changed from the AT&T for plan9 which makes the
port a little more complex but with some care this should be easy to
finish off.

Templates
All the tools nescessary to support cfront template support have been
compiled, however these have not been tested; Templates were not
supported in the older plan9 c++ releases.

Standard Component library
It was decided not to attempt to port the Standard Component library
as it is now very rarely used.  If there is any interested in this
package then the Citibank changes should be seriously considered.
http://www.opengroup.org/dce/mall/objtran.htm

Standard Template Library
A version of the standard template library which is claimed to work
with cfront (though it is not clear which AT&T release was involved)
is availale for RiscOS™.  This would doubtless require some
modification but could probably be persuaded to work on plan9
http://homepage.ntlworld.com/thouky/software/cathlibcpp/index.html

Mkfile changes
Plan9 seems to have used the .c extension for C++ sourcecode, this
makes generating rules for mkfiles difficult so it was decided to
change the extension on all the C++ source C (capital c) rules have
been added to /sys/src/cmd/mkone /sys/src/cmd/mklib
/sys/src/cmd/mkmany to suit. 

At present C++ object files are still named after the source file and
the target object file.  Unfortunately c++ compilation requires a
postprocessing of executables (to link the chain of static
initialisers together) so a seperate linker must be specified.  This
can be achieved simply by adding the following to c++ centric mkfiles:

	LD=c++/$LD

Steve Simon
Dec 2007

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.