Installing EDG-based Zephyr compilers

Site Map

Introduction

ASDL

CSDL

  • CCL
  • \-RTL
  • SLED
  • vpo

    RTLs

    Talks & Papers

    Software

    People

    Mailing lists

    Job Openings


    Nat'l Infrastructure

  • What & Why?
  • Sponsors

  • This file contains instructions for building the Edison Design Group (EDG) C++ compiler with the sparc-solaris VPO back end. Links to the source code are on our software page.

    Prerequisites

    You must have All these except the EDG front end are included in the Zephyr ``everything you need'' bundle.

    Preliminaries

    Before you get started building the compiler,
    1. Build and install noweb, using the instructions in the noweb distribution.
    2. Build VPO, using the instructions in the VPO distribution.
    3. Check your PATH variable to ensure that the commands notangle, gcc, lorder, tsort, and ranlib all work. On a Solaris system, you will probably need to put /usr/ccs/bin in your PATH

    Building the compiler

    Configure the back ends:

    Using the compiler

    Compile with the ./bin/eccp driver script. You may want to make a symbolic link to it in a directory in your PATH.

    By default, eccp compiles C++.

    To compile ANSI C, use eccp --c or eccp -m.

    To compile C++ with exception handling, use eccp -x. This option adds a fair amount of extra code to each function, so you probably don't want to use -x unless you need it.

    Use the -k flag to ``keep'' all intermediate files. The *.cex file is the raw vpo input file. The *.dec file is the decoded *.cex file. You'll also get a *.s and a *.o file. You may also get several *.munch.* files. The eccp driver script may need to build a *.munch.c file on the fly that defines an array of pointers to initialization functions. The driver script compiles this file and links it in with the rest of the program, which causes the run time library to call the initialization functions when the C++ program starts.

    Incompatibilities

    Do not try to link C++ code with class libraries compiled by other C++ compilers; name mangling is probably different. Get source for the libraries you want to use, and compile them with eccp.

    There is one major incompatibility between code compiled with EDG and code from Sun and GNU compilers; they use different calling conventions for functions returning structs by value. (Passing structs by value is compatible.) If a function returns a struct by value, be sure both the caller and callee are compiled with EDG or neither are compiled with EDG.

    If you compile code that calls alloca(), you'll probably need to link with a portable version of alloca(). Sun and GNU compilers both treat alloca() as a special case, replacing it inline assembly code that manipulates the stack. EDG does not tolerate this stack manipulation, so you must obtain a callable alloca() and link with it.

    Documentation

    The EDG C++ front end document edg/release_2.40/doc/plm.PostScript is very large and includes a section on command line options for edgcpfe. The eccp driver script does not recognize most edgcpfe options, so it just passes any unrecognized options to edgcpfe.

    The annotated source for the sparc-solaris VPO input generating back end is edg-backends/sparc-solaris/sparc-vpo-be.c.PostScript. It is built from the noweb source file sparc-vpo-be.c.nw. Any *.nw file can be formatted with noweave.


    Back to Zephyr software or home page