pc(1)
Requires Optional Pascal Compiler Software
NAME
pc − Pascal compiler
SYNOPSIS
pc [options] file ...
REMARKS
This manual entry describes the generic HP Pascal compiler. Implementation dependencies for different architectures are noted as needed.
DESCRIPTION
pc is the HP standard Pascal compiler. It accepts several types of file arguments:
• Arguments whose names end with .p are taken to be Pascal source files. They are each compiled, and each corresponding object program or module(s) is left in the current directory in a file whose name is that of the source, with .o substituted for .p. The .o file is immediately deleted (leaving only the linked executable file) if only a single source is compiled and linked, if the -C option is specified, or if the source fails to compile correctly.
• All other file arguments, including those whose names end with .o, .a, or .sl, are passed on to the ld linker (see (ld(1)) to be linked into the final program.
Options and other arguments can be passed to the compiler through the PCOPTS environment variable as well as on the command line. The compiler picks up the value of PCOPTS and places its contents before any arguments on the command line. For example (in sh(1) notation),
PCOPTS=-v
export PCOPTS
pc -L prog.p
is equivalent to
pc -v -L prog.p
When set, the TMPDIR environment variable specifies a directory to be used for temporary files, overriding the default directories /tmp and /usr/tmp.
Options
pc recognizes the following options:
-A Produce warnings for the use of non- ANSI -Pascal features (same as $ANSI ON$).
-C Suppress code generation. No .o file is created and linking is suppressed. This is effectively a request for syntax/semantic checking only (same as $CODE OFF$ ).
-c Suppress linking and only produce object (.o) files from source files.
-Dname=bool
-Dname Define name as if by a $SET directive on the 0th line of the source file. bool can be either TRUE or FALSE; if no =bool is given, name is set to TRUE. Whether name and bool are uppercase or lowercase is insignificant. The order in which the compiler encounters $SETs (regardless of relative order on the command-line) is: -Dname=bool, +Q dfile, source file. Hence, the compiler overrides -Dname=bool with any subsequent duplicate $SETs, always taking the last one seen (with a warning). (The -D option is not available on Series 300/400 systems).
-g Generate additional information needed by a symbolic debugger, and ensure that the program is linked as required. See the appropriate implementation reference manual for more information on symbolic debugging support.
-G Prepare object files for profiling with gprof (see gprof(1)).
-Idir Add dir to the list of directories that are searched for $INCLUDE files whose names do not begin with /. The directory containing the source file is always searched first, followed by any directories specified with the -I option, then the current working directory, and finally the standard directory /usr/include.
-L Write a program listing to stdout (see the DEPENDENCIES section below for exceptions).
-lx Cause the linker to search the library libx.sl or libx.a in an attempt to resolve currently unresolved external references. Because a library is searched when its name is encountered, placement of a -l is significant. If a file contains an unresolved external reference, the library containing the definition must be placed after the file on the command line. See ld(1) for further details.
-N Cause the output file from the linker to be marked as unshareable (see -n). For details and system defaults, refer to the linker documentation (ld(1)).
-n Cause the output file from the linker to be marked as shareable (see -N). For details and system defaults, refer to the linker documentation (ld(1)).
-o outfile Name the output file from the linker outfile instead of a.out.
-p Prepare object files for profiling with prof (see prof(1)).
-P lines Specifies the number of lines (including any header or trailer) which should be listed per page of generated listing (same as $LINES n$).
-Q Cause the output file from the linker to be marked as not demand-loadable (see -q). For details and system defaults, refer to the linker documentation (ld(1)).
-q Cause the output file from the linker to be marked as demand loadable (see -Q). For details and system defaults, refer to the linker documentation (ld(1)).
-s Cause the output of the linker to be stripped of symbol table information (see ld(1) and strip(1)) (this option is incompatible with symbolic debugging).
-t x,name Substitute or insert subprocess x with name where x is one or more of an implementation-defined set of identifiers indicating the subprocess(es). This option works in two modes:
• If x is a single identifier, name represents the full pathname of the new subprocess;
• If x is a set of (more than one) identifiers, name represents a prefix to which the standard suffixes are concatenated to construct the full path name of the new subprocesses.
The values x can assume are:
c compiler body (standard suffix is pascomp)
0 same as c
l linker (standard suffix is ld)
-v Enable verbose mode, producing a step-by-step description of the compilation process on stderr.
-w Suppress warning messages (same as $WARN OFF$).
-W x,arg1[,arg2,...,argN]
Cause arg1 through argN to be handed off to subprocess x. The argi are of the form:
-argoption[,argvalue],
where argoption is the name of an option recognized by the subprocess and argvalue is a separate argument to argoption where necessary. The values that x can assume are those listed under the -t option, as well as the value d (driver program), which has a special meaning explained below.
For example, the specification to pass the -a archive option to the linker to cause it to link against an archive library rather than a shared library would be:
-W l,-a,archive
The -W d option specification allows additional, implementation-specific options to be recognized and passed through the compiler driver to the appropriate compiler subprocesses. For example, on Series 300/400 systems:
-W d,-U
sends the option -U to the driver and compiler. Furthermore, a shorthand notation for this mechanism can be used by inserting + in front of the option name; as in
+U
which is equivalent to the previous option expression. Note that for simplicity this shorthand is applied to each implementation-specific option individually, and that the argvalue is no longer separated from the argoption by a comma (see -W).
-Y Enable 16-bit Native Language Support when parsing string literals and comments (same as $NLS_SOURCE ON$). Note that 8-bit parsing is always supported.
+a Cause the compiler to generate archived object (.a) files instead of simple object (.o) files. This allows source files containing multiple HP Pascal modules to be compiled such that each module can be linked independently. Use of this option is discouraged for portability reasons. It is provided to facilitate migration from Series 200 HP-UX releases prior to Release 5.1 (where .a files were always generated), to 5.1 and subsequent releases. Otherwise, it is recommended that modules needing separate linkability be placed in separate source files. To facilitate use of previously existing makefiles and scripts that depended on the archive generation, the PCOPTS environment variable can be used (e.g., set PCOPTS= "+a$PCOPTS" ).
+Q dfile Cause dfile to be read before compilation of each source file. dfile must contain only compiler directives.
+R Inhibit range checking (same as $RANGE OFF$).
EXTERNAL INFLUENCES
Environment Variables
LANG determines the language in which messages are displayed.
PCOPTS specifies options passed to the compiler.
TMPDIR specifies a directory to be used for temporary files.
International Code Set Support
Single- and multi-byte character code sets are supported only in strings and comments.
EXAMPLES
Series 700/800:
The following two commands create one.o and two.o, in succession, then link one.o and two.o with /usr/lib/end.o to create prog.
pc -cg one.p two.p
pc -g one.o two.o -o prog
To link object files that were compiled with +DA1.1, be sure to use the +DA1.1 option to pc (in order to link one.o and two.o with the math libraries in /lib/pa1.1 and /usr/lib/pa1.1):
pc +DA1.1 one.o two.o
An object file can conveniently be renamed using the -c and -ooutfile options:
pc -g -c file.p -o ../obj/Debug/file.o
The following command causes level 3 optimization to be performed, dropping to level 1 optimization for those procedures containing more than 700 basic blocks.
pc +Obb700 +O3 file.p
DIAGNOSTICS
The diagnostics produced by pc are intended to be self-explanatory. Occasional messages may be produced by the linker.
A list of all compiler errors are contained in /usr/lib/paserrs.
If a listing is requested (-L option), errors are written to the listing file (stdout). If a listing is requested and if stdout and/or stderr has been redirected to something other than a terminal, errors are also written to stderr. If no listing is requested (no -L option), errors are written to stderr. This effectively guarantees that stderr will always receive error messages unless duplicate error messages would be printed on the terminal.
DEPENDENCIES
Series 300/400
The Series 300/400 compiler provides only limited support for shared libraries by allowing production of dynamic load libraries. Refer to the +l option below for more information.
The -L option writes a program listing to the file given in the $LIST filename$ option in the source, instead of to stdout.
The Series 300/400 compiler does not support the -Dname=bool option.
The following options are implemented only on Series 300/400:
-T Causes the compiler to produce a symbol table in the listing file as if the source file contains a $TABLES ON$. This option requires a -L option.
+A Cause the compiler to always use 2-byte data and stack alignment rules instead of default 4-byte alignment rules for stacks and data objects exceeding four bytes. Refer to the reference manual for more details.
+M Cause the compiler not to generate inline code for the MC 68881 floating-point coprocessor. Library routines are referenced for math and intrinsic operations.
+l Produces a supplementary symbol table to support the production of dynamic load libraries. Refer to the Programming on HP-UX and HP Pascal Reference Manual for a complete discussion of this type of library.
+bfpa Generate code that uses the HP 98248A floating-point accelerator card if it is installed at run-time. If the card is not installed, floating point operations are done on the MC 68881 math coprocessor.
+ffpa Generate code for the HP 98248A floating point accelerator card. This code does not run unless the card is installed.
+U Allow certain packed fields and elements to be passed by VAR (Same as $ALLOW_PACKED ON$).
Series 700/800
The following Series 300/400 options are ignored and warnings are issued: +M, +bfpa, and +ffpa.
The following options are implemented on Series 700 and 800 systems:
-y Generate additional information needed by static analysis tools, and ensure that the program is linked as required for static analysis. This option is incompatible with optimization.
+z,+Z Both of these options cause the compiler to generate position-independent code for use in building shared libraries. The options -G and -p are ignored if +z or +Z is used. Normally, +z should be used to generate position-independent code. However, when certain limits are exceeded, +Z is required to generate position-independent code. The ld linker (see ld(1)) issues the error mesage when building a shared library indicating when +Z is required. If both +z and +Z are specified, only the last one encountered is used. For a more complete discussion regarding position-independent code and these options, see the manual Programming on HP-UX. (+z is the same as $SHLIB_CODE ON$; +Z is the same as $SHLIB_CODE 2$).
-O Perform level 2 optimizations.
-S Output an assembly file. This file is named filename.s , where filename is the basename of the source file.
+C Convert MPE -style file names (file[.group[.account]]) into HPUX -style filenames ([[account/]group/]file) in compiler directives such as $INCLUDE and $SYSINTR. This option expects a strictly MPE -like directory structure; i.e. "group"-level directories under "account"-level directories, and source files only in "group"-level directories. See the Series 800 HP Pascal Programmers’ Guide for details on the semantics of this option. Same as $CONVERT_MPE_NAMES ON$.
+N Turn off notes (same as $NOTES OFF$). Notes are also automatically turned off when -w is specified.
+Oarg Perform optimizations selected by arg. There are two kinds of arguments to the +O optimization option. Those in the first group can have arg defined as:
1 Perform level 1 optimizations. These include branch optimizations, dead code elimination, instruction scheduling, and peephole optimization.
2 Perform level 2 optimizations. These include common subexpression elimination, constant folding, loop invariant code motion, coloring register allocation, and store-copy optimization. Level 2 optimizations are a superset of Level 1 optimizations. The -O option is equivalent to the +O2 option.
3 Perform level 3 optimizations. These include (but are not limited to) interprocedural global optimizations. Level 3 optimizations are a superset of Level 2 optimizations.
Those in the second group can have arg defined as:
s Suppress optimizations which tend to increase the generated code size. Currently, these optimizations include software pipelining and loop unrolling.
bbnum Specify the maximum number of basic blocks allowed in a procedure which is to be optimized at level 2. If a procedure contains more than num basic blocks, level 1 optimization is performed for that procedure. The default value for num is 500 (same as $OPTIMIZE ’BASIC_BLOCKS num’$).
The arguments in the second group implicitly request level 2 optimizations, but an argument from the first group will override the implicit level 2, regardless of their relative positions on the command line.
+DAmodel Generate object code for a specific version of the PA-RISC architecture. model can be either a model number (such as 750 for the HP 9000 Model 750), or one of the following generic architecture specifications:
1.0 Generate object code suitable for all implementations of PA-RISC 1.0 or higher. This is the default for all Series 800 models.
1.1 Generate object code suitable for all implementations of PA-RISC 1.1. This is the default for all Series 700 models.
Object code generated for PA-RISC 1.1 will not execute on PA-RISC 1.0 implementations.
In addition, the +DA option allows the user to selectively link with PA-RISC 1.0 or PA-RISC 1.1 Math Libraries.
+DSmodel Perform instruction scheduling appropriate for a specific implementation of the PA-RISC architecture. model can be either a model number (e.g., 870 for the HP 9000 Model 870), or one of the following generic architecture specifications:
1.0 Perform generic scheduling tuned to a model representative of PA-RISC 1.0 implementations.
1.1 Perform generic scheduling tuned to a model representative of PA-RISC 1.1 implementations.
The default scheduling is based on the model number returned by uname() (see uname(2)).
This option affects only performance of the object code by scheduling the code based on the specific latencies of the target implementation. The resulting code will execute correctly on other implementations (subject to the +DA option above).
+FPflags Specify how the run time environment for floating-point operations should be initialized at program start up. The default is that all behaviors are disabled. See ld(1) for specific values of flags. To dynamically change these settings at run time, refer to fpgetround(3M).
FILES
file.p input file (Pascal source file)
file.o compiler-generated or other object file to be relocated at link time
a.out linked executable output file
/usr/lib/pascomp compiler
/usr/lib/paserrs compiler error message file
/lib/crt0.o runtime startup
/lib/libc.a HP-UX system library (C-language library)
/lib/libc.sl shared version of the HP-UX system library (C-language library)
/usr/tmp/* temporary files used by the compiler
Series 300/400
file.a optionally generated object archive file
/lib/libm.a HP-UX math library
/lib/libm.sl shared version of the HP-UX math library
/usr/lib/escerrs Pascal escape codes
/usr/lib/syserrs HP-UX system messages
/usr/lib/ioerrs Pascal I/O results
/lib/libpc.a Pascal run-time library
/lib/libp/libpc.a profilable Pascal run-time library
/usr/lib/libheap2.a Pascal run-time library, alternate heap manager
/lib/libp/libheap2.a profilable Pascal run-time library, alternate heap manager
Series 700/800
/lib/libm.a PA-RISC 1.0 Math Library
/lib/libm.sl shared version of PA-RISC 1.0 Math Library
/lib/pa1.1/libm.a PA-RISC 1.1 Math Library
/lib/pa1.1/libm.sl shared version of PA-RISC 1.1 Math Library
/usr/lib/nls/$LANG/pc_msgs.cat
error message catalog
/usr/include/pasesc.ph symbolic definitions of library escape codes
/usr/lib/libcl.a PA-RISC 1.0 Pascal run-time library
/usr/lib/libcl.sl shared version of PA-RISC 1.0 Pascal run-time library
/usr/lib/pa1.1/libcl.a PA-RISC 1.1 Pascal run-time library
/usr/lib/pa1.1/libcl.sl shared version of PA-RISC 1.1 Pascal run-time library
/usr/lib/pasopts global compiler options file
/usr/lib/sched.models processor implementation file
/usr/lib/paslib default system module library
SEE ALSO
Texts and Tutorials
Programming in Pascal with Hewlett-Packard Pascal by Peter Grogono.
Programming on HP-UX.
Series 300/400
HP Pascal Reference Manual
Series 700/800
HP Pascal Reference Manual"
HP Pascal Programmers’ Guide
HP-UX Floating-Point Guide
See manuals(5) for list of part numbers.
Program management and analysis tools:
softstatic(1) static analysis tool (shipped with SoftBench software)
Profiling and debugging tools:
gprof(1) display call graph profile data
prof(1) display profile data
xdb(1) invoke the FORTRAN, C, C++, and Pascal symbolic debugger
System tools:
ar(1) create archived libraries
ld(1) invoke the linker
Miscellaneous:
matherr(3M) trap math errors
strip(1) strip symbol and line number information from an object file
Hewlett-Packard Company — HP-UX Release 9.0: August 1992