Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ pc(1) — Sun WorkShop 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

pc(1)  —  USER COMMANDS

NAME

pc − Pascal compiler

SYNOPSIS

pc [ −a ] [ −B binding ] [ −b ] [ −bsdmalloc ] [ −C ] [ −c ] [ −calign ] [ −cg89 ] [ −cg92 ]

[ −cond ] [ −config variable ] [ −Dname[=def ] ] [ −dalign ] [ −dn ] [ −dryrun ]

[ −dy ] [ −fast ] [ −fnonstd ] [ −G ] [ −g ] [ −H ] [ −help ] [ −Ipathname ]

[ −i name ] [ −KPIC ] [ −Kpic ] [ −keeptmp ] [ −L ] [ −l ] [ −Ldirectory ]

[ −libmil ] [ −llib ] [ −misalign ] [ −native ] [ −nocx ] [ −nolib ]

[ −nolibmil ] [ −noqueue ] [ −notrace ] [ −O[level] ] [ −o filename ]

[ −P ] [ −p ] [ −pg ] [ −PIC ] [ −pic ] [ −Qoption program option ]

[ −Qpath pathname ] [ −Qproduce sourcetype ] [ −qp ] [ −R ] [ −R path ]

[ −S ] [ −s[level] ] [ −sb ] [ −sbfast ] [ −tc ] [ −temp=dir ] [ −time ] [ −U name ]

[ −V ] [ −V[level] ] [ −v ] [ −w ] [ −xa ] [ −xF ] [ −xl ] [ −xlibmil ]

[ −xlicinfo ] [ −xMerge ] [ −xnolib ] [ −xpg ] [ −xs ] [ −xsb ] [ −xsbfast ] [ −Z ]
sourcefile ...

DESCRIPTION

This man page describes the SPARCompiler Pascal 3.0.3 release for Solaris 1.x and 2.x.  pc is the SPARCompiler Pascal compiler.  If given an argument file ending with .p (or .pas), pc compiles the file and leaves the result in an executable file, called a.out by default. 

A program can be separated into multiple .p (or .pas) files.  pc compiles a number of .p (or .pas) files into object files (with the extension .o in place of .p or .pas).  Object files can then be linked into an executable file.  To successfully create an executable file, one object file must supply a program statement file.  The rest of the files must consist only of declarations which logically nest within the program. 

Object files created by other language processors can be linked together with object files created by pc.  The functions and procedures they define must have been declared by all the .p (or .pas) files which call those routines, using the extern, external, or
nonpascal routine options. 

You must use the −lpfc and −lpc options when you compile a Pascal/FORTRAN program. 

pc supports ISO Level 0 and Level 1 standard Pascal, including conformant array parameters. 

OPTIONS

−a, −xa Inserts code to count how many times each basic block is executed.  See tcov(1). 

−B binding Specifies whether bindings of libraries for linking are static or dynamic, indicating whether libraries are non-shared or shared, respectively. 

−b Turns on block-buffering with a block size of 1,024. 

−bsdmalloc (Solaris 1.x only) Specifies faster malloc and uses the more efficient malloc from the library, libbsdmalloc.a.  This option also causes the flags, −u_malloc/lib/libbsdmalloc.a, to be passed to the linker. 

−C Compiles code to perform subscript, subrange, and other checks, and verify assert statements.  Pointers are checked by the −H option.  The Pascal −C option differs significantly from the −C option of the cc compiler. 

−c Suppresses linking with ld(1) and produce a .o object file for each source file. 

−calign Allocates storage in records the same way as the C compiler allocates structures. 

−cg89, −xcg89
Generates code for any SPARC systems released in 1989 or later that have features like hardware fsqrts and fsqrtd instructions.  Code compiled with −cg89 should not be executed on Sun-4/1xx and 4/2xx systems with Weitek 1164/5 floating-point hardware.  Use the fpversion(1) command to find out which floating-point hardware you have and which floating-point option to use.  It takes about a minute for the report to be displayed. 

−cg92, −xcg92
Generates code to produce instruction scheduling and special instructions to exploit features available on SPARC systems released in 1992 or later.  Also uses the appropriate inline templates.  Examples of such code are the integer multiply and divide instructions. Use the fpversion(1) command to find out which floating-point hardware you have and which floating-point option to use.  It takes about a minute for the report to be displayed.  Consistency: The −cg89 and −cg92 options are mutually exclusive; you must use them consistently.  Thus, if you compile any procedure with one of these options, you must compile all the procedures of the program with the same option.  Similarly, for a library, compile all the procedures in a library with the same −cg89 or −cg92 option. 

−cond Compiles the lines in your program that begin with the %debug directive.  Use only with the −xl option. 

−config variable
Defines the conditional variable whose name is variable for the preprocessor cppas.  When you use −config, you must declare variable in your program with the %var directive and use the −xl option.  To specify more than one variable, use multiple −config options on the command-line. 

−Dname[=def]
Defines a symbol name to the preprocessor cpp(1).  Equivalent to a #define statement in the source.  If no def is given, name is defined as 1. 

−dalign Assumes that all double-precision floating-point values are double-aligned.  Causes the compiler to generate double load and store instructions wherever possible for faster execution. 

−dn (Solaris 2.x only) Specifies static linking in the link editor. 

−dryrun Shows, but does not execute, the commands constructed by the compilation driver. 

−dy (Solaris 2.x only) Specifies dynamic linking in the link editor. 

−fast Selects the combination of compilation options that optimize for speed of execution without excessive compilation time.  This option chooses the options −O2 and −fnonstd, as well as a set of inline expansion templates.  Do not use this option for programs that depend on IEEE standard exception handling. 

−fnonstd Initializes nonstandard floating-point arithmetic hardware.  Also causes the math library to be linked in by passing −lm to the linker. 

−G (Solaris 2.x only) Directs the link editor to produce a shared object file rather than a dynamically linked executable.  Compiles all object files specified with this option with either the −pic or the −PIC option. 

−g Produces additional symbol table information for dbx(1) and debugger(1). 

−H Compiles code to perform range-checking on pointers into the heap. 

−help, −flags
Summarizes all available options from pc. 

−Ipathname Adds pathname to the list of directories in which to search for #include and %include files with relative file names, that is, those that do not begin with /.  The preprocessor first searches for #include and %include files in the directory containing the source file, then in directories named with −I options, if any, and, finally, in /usr/include. 

−i name Produces a listing for the specified procedure, function, #include, or %include file. 

−keeptmp Keeps temporary files that are created during compilation, so they are retained instead of being deleted automatically. 

−L Maps all identifiers and keywords to lowercase. 

−l Produces a program listing during translation. 

−Ldirectory Adds directory to the ld library path. 

−libmil, −xlibmil
Instructs the compiler to select the best inline templates for the floating-point option and operation system release available on this machine.

−llib Links with the object library liblib.a or liblib.so (for ld(1)).  This option must follow sourcefile.  Pascal is not compatible with libucb.a; do not use the −lucb option. 

−misalign Allows for misaligned data in memory. 

−native Generates code for best floating-point hardware available on the machine you are compiling on. 

−nocx (Solaris 1.x only) Makes the output executable file about 128K bytes smaller by not linking with the −lcx option.  However, the runtime performance and accuracy of binary-decimal base conversion is somewhat compromised. 

−nolib, −xnolib
Does not link with any system or language library; that is, does not pass any −lx options onto ld.  The default is to link such libraries into the executables automatically without your specifying them on the command-line.  The system and language libraries are required for final execution, and you must link them in manually. Using the −nolib option, you can link one of these libraries statically.
Example: Link libsunmath libm statically and link the other libraries dynamically.

pc −xnolib −Bstatic −lsunmath −lm −Bdynamic −lc test.p

There is no dynamic libm; it is always linked statically.  The order for the −lx options is important.  Follow the order shown in the example. 

−nolibmil Resets the −fast option so it does not include inline templates. 

−noqueue Does not queue in the license queue.  When you use this option, if no license is available, the compiler returns without queuing your request and without executing your compile job.  A nonzero status is returned for testing in make files. 

−notrace Disables runtime traceback.  This option is effective only when you are compiling the main program. 

−O[level] Optimizes the object code.  level is one of the following:

1 Does postpass assembly-level (minimum) optimization only. 

2 (Default)  Does global optimization prior to code generation, including loop optimizations, elimination of common subexpressions, copy propagation, automatic register allocation, and so on.  −O2 does not optimize references to or definitions of external or indirect variables. 

3 Same as −O2, but optimizes uses and definitions of external variables.  −O3 does not trace the effects of pointer assignments.  Do not use −O3 nor −O4 when compiling either device drivers or programs that modify external variables from within signal handlers. 

4 Same as −O3, but traces the effects of pointer assignments and gathers alias information. 

−O without a level number is the same as −O2.  Levels 3 and 4 are not recommended because of the extreme increase in compilation time and relatively minor improvement over −O2 in runtime performance for most programs. 

−o filename Names the generated executable filename.  This file must have the appropriate suffix for the type of file to be produced by the compilation (see FILES, below).  filename cannot be the same as the source file name because the compiler does not overwrite the source file. 

−P Uses partial evaluation semantics for the boolean operators and and or.  Left-to-right evaluation is then guaranteed, and the second operand is evaluated only if necessary to determine the result. 

−p Prepares the object code to collect data for profiling with prof(1).  Calls a runtime recording mechanism that produces a mon.out file at normal termination. 

−pg, Prepares the object code to collect data for profiling with gprof(1).  Calls a runtime recording mechanism that produces a gmon.out file at normal termination. 

−pic, −Kpic, −PIC, −KPIC
Generates position-independent (PIC) code.

−Qoption program option
Passes option to program.  The option value must be appropriate to that program and can begin with a plus or minus sign.  program can be as(1) (Solaris 1.x only), fbe(1) (Solaris 2.x only), cpp(1), cppas, inline(1), iropt, cg, ld(1), pc0, or pc3. 

−Qpath pathname
Inserts the directory pathname into the compilation search path to use alternative versions of programs invoked during compilation.  This path is also searched first for certain relocatable object files that are implicitly referenced by the compilation driver. 

−Qproduce sourcetype
Produces source code of the type sourcetype, which can be one of the following:

.o Object file from as(1)

.s Assembler source

.pi Preprocessed Pascal source from cpp(1)

−qp Same as −p option. 

−R (Solaris 1.x only) Instructs pc to call the assembler, as(1).  This option merges the data segment of the resulting program with the text segment.  See −xMerge that works for Solaris 2.x only. 

−R path (Solaris 2.x only) Stores path in the output object file and passes path to the runtime linker, ld(1).  path is a colon-separated list of directories used to specify library search directories to the runtime linker.  If both LD_RUN_PATH and the −R option are specified, the libraries in the −R list are scanned first.  Use this option if you want to ship an executable that users can run without any special option for the paths to your dynamic libraries. 

−S Compiles the named program and leaves the assembly language output on the corresponding file suffixed .s.  No .o file is created. 

-s[level] Accepts standard Pascal only; nonstandard constructs and extensions cause warning diagnostics.  SPARCompiler Pascal has two levels of compliance with standard Pascal: Level 0 and Level 1.  The option can be:

−s or −s1 Accepts Level 1 compliance with standard Pascal. 

−s0 Accepts Level 0 compliance with standard Pascal. 

This option also performs the action of −L; that is, it maps all uppercase letters in keywords and identifiers to lowercase. 

−sb, −xsb Produces a database for the SPARCworks SourceBrowser. 

−sbfast,  −xsbfast
Produces a database only for the SPARCworks SourceBrowser and stops.  Does not compile, assemble, or link.  Does not make object files.  This option is similar to −sb, but −sbfast produces the code browser database only. 

−tc Generates pc3 stab information to allow cross-module type-checking. 

−temp=dir Sets the directory for temporary files that are created during compilation to dir. 

−time Reports execution performance statistics for the various compilation passes. 

−U name Removes any initial definition of the cpp(1) symbol name.  This option is the inverse of the −D option. 

−V Reports versions of the programs invoked by the compiler driver. 

−V[level] Invokes a series of options, depending on the level:

−V0 Equivalent to −C, −H, −L, and −s0

−V1 Equivalent to −C, −H, −L, and −s1

−v Prints the command-line used to call each compilation pass: verbose. 

−w Suppresses warning messages. 

−xF (Solaris 2.x only) Function-level reordering.  Enables performance analysis of the executable using the SPARCworks Analyzer and Debugger (see the analyzer (1) and debugger (1) man pages).  This option also causes the assembler to generate some debugging information in the object file, necessary for data collection.  Generates code that can be reordered at the function level.  This option takes each function in the file and places it into a separate section.  For example, functions fcn1() and fcn2() are placed in the sections .text%fcn1 and .text%fcn2.  You can control the order of functions in the final executable by using this option and the loader −Mmapfile option.  Within the mapfile, if you include the flag O (that’s an oh, for order, not a zero) in the string of segment flags, then the static linker ld attempts to place sections in the order they appear in the mapfile.  See the Solaris documentation for more details about this option, the segment flags, and the mapfile. 

−xl Implements the extended language features of Pascal:

•Sets the default integer size to 16 bits. 

•Sets the default real size to 32 bits. 

•Sets the default enumerated type size to 16 bits. 

•Runs the source file through the preprocesser cppas before it is processed by the Pascal compiler. 

•Supports nonpascal as a routine option. 

•Turns on the −L option. 

•Sets the default writing of enumerated and boolean variables to uppercase and 15-character width format. 

•Does not generate an error if the value of the expression in a case statement does not match any of the case values. 

•Does not generate an error when integer or real constant literals overflow implementation limits. 

•Does not generate a warning when the argument to the addr function is a local or private variable. 

•Sets the default visibility for top-level variables, procedures, and functions in programs to private. 

•Sets the default visibility for top-level variables in modules to private; for top-level procedures and functions in modules, to
public. 

−xlicinfo Returns license information about the licensing system.  In particular, returns the name of the license server and the IDs of users who have checked out licenses.  Generally, with this option, no compilation is done and a license is not checked out.  If a conflicting option is used, then the latest one on the command-line prevails, and a warning is generated. Example: pc  −c  −xlicinfo  any.p does no compilation and reports license information.  Example: pc  −xlicinfo  −c  any.p does compilation, but does not report license information. 

−xMerge (Solaris 2.x only) Merges the data segment into the text segment. 

−xs (Solaris 2.x only) Disables autoload for dbx in case you cannot keep the .o files around.  This option passes the −s option to the assembler and the linker, and causes the assembler to place all stabs in the .stab section.  By default, all stabs are placed in the .stab.excl section.  The static linker ld always strips out the .stab.excl section.  Hence, use this option only in cases where the stabs have to remain in the final executable in the .stab section. 

−Z Initializes local variables to zero.  Other arguments are taken to be linker option arguments or libraries of pc-compatible routines.  Certain flags can also be controlled by comments within the program, as described in the SPARCompiler Pascal User’s Guide. 

FILES

a.out Executable output file

file.a Library of object files

file.d tcov(1) test coverage input file

file.il inline(1) expansion file

file.o Object file

file.p Pascal source file

file.pas Pascal source file

file.pi Pascal source after preprocessing with cpp(1)

file.s Assembler source file

file.S Assembler source for cpp(1)

file.tcov Output from tcov(1)

as Assembler (Solaris 1.x only)

cg Code generator

cpp C preprocessor

cppas Pascal preprocessor

crt0.o Runtime startup

fbe Assembler (Solaris 2.x only)

gcrt0.o Startup for profiling with gprof(1)

gmon.out File produced for analysis by gprof(1)

inline Inline expander of library calls

iropt Object code optimizer

libm.a Math library

libpc.a Intrinsic functions and Pascal I/O library

libpc.so.3.0 Shared library

libpfc.a Startup code for combined Pascal and FORTRAN 77
programs

libpfc_p.a Profiling library for combined Pascal and FORTRAN 77
programs

mcrt0.o Startup for profiling with prof(1)

mon.out File produced for analysis by prof(1)

pc Compiler command-line processing driver for Pascal

pc0 Compiler front-end

pc3 Separate compilation consistency checker

pcexterns.o External definitions

SEE ALSO

SPARCompiler Pascal 3.0.3 User’s Guide

SPARCompiler Pascal 3.0.3 Reference Manual

SPARCompiler Pascal 3.0.3 Quick Reference

DIAGNOSTICS

In the diagnostic output of the translator, lines containing syntax errors are listed with a flag indicating the point of error. Diagnostic messages indicate the action which the recovery mechanism took to be able to continue parsing.  Some diagnostics indicate only that the input is "malformed."  This situation occurs if the recovery can find no simple correction to make the input syntactically valid. Semantic error diagnostics indicate a line in the source text near the point of error.  Some errors evoke more than one diagnostic to help pinpoint the error; the follow-up messages begin with an ellipsis "..." The first character of each error message indicates its class:

E Fatal error; no code is generated. 

e Nonfatal error. 

w Warning −− a potential problem. 

s Nonstandard Pascal construct warning. 

If a severe error occurs which inhibits further processing, the translator gives a diagnostic and then quits.  Names whose definitions conflict with library definitions draw a warning. The library definition is then replaced by the one supplied in the Pascal program.

Sun Microsystems  —  Last change: 1 August 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026