Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ada(1) — HP-UX 7.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ada.fmgr(1)

ada.format(1)

ada.funlock(1)

ada.lmgr(1)

ada.lsfam(1)

ada.lslib(1)

ada.make(1)

ada.mkfam(1)

ada.mklib(1)

ada.mvfam(1)

ada.mvlib(1)

ada.probe(1)

ada.protect(1)

ada.rmfam(1)

ada.rmlib(1)

ada.umgr(1)

ada.unlock(1)

ada.xref(1)

ADA(1)  —  Series 300 Only (Requires Optional Ada Software)

NAME

ada − Ada compiler

SYNOPSIS

ada [ options ] [ files ] libraryname

Remarks:

This command requires installation of optional Ada software (not included with the standard HP-UX operating system) before it can be used. 

DESCRIPTION

Ada is the HP-UX Ada compiler.  It accepts several types of file arguments:

(1) Arguments whose names end with .ad?, where ?  is any single alphanumeric character, are taken to be Ada source files. 

(2) The libraryname argument names an Ada library that must have been previously created using the ada.mklib(1) command.  An Ada library is an HP-UX directory containing files that are used by the various components of the Ada compilation system.  There is no required or standard suffix on the name of an Ada library. 

The named source files are compiled, and each successfully compiled unit is placed in the specified Ada library by the compiler.  When binding, or binding and linking, information is extracted from the Ada library to perform the bind and/or link operation.  The Ada library must always be specified. 

To ensure the integrity of the internal data structures of Ada libraries, libraries are locked for the duration of any operations which are performed on them.  During compilation, libraryname is normally locked for updating and other Ada libraries can be locked for reading.  During binding/linking, Ada libraries are only locked for reading. 

If ada cannot obtain a lock after a suitable number of retries, it displays an informational message and terminates. 

Users are strongly discouraged from placing any additional files in Ada library directories.  User files in Ada libraries are subject to damage by or might interfere with proper operation of ada and related tools. 

(3) All other file arguments, including those whose names end with .o or .a are passed on to the linker ld(1) to be linked into the final program.  It is not possible to link-only with the ada(1) command. 

(4) Although shown in the preferred order above, options, files, and libraryname arguments can appear in any order. 

Environment Variables

The environment variable ADA_PATH is associated with all components of the Ada compilation system.  It must be set properly and exported before any component of the Ada compilation system (including ada) can be used (see ada(1), Environment Variables). 

Normally this variable is defined and set in the systemwide shell startup files /etc/profile (for sh(1) and ksh(1)) and /etc/csh.login (for csh(1)).  However, it can be set by a user either interactively or in a personal shell startup file, .profile (for sh(1) and ksh(1)) or .cshrc (for csh(1)). 

ADA_PATH must contain the path name of the directory in which the Ada compiler components have been installed. 

The value of this variable must be a rooted directory (i.e.  it must begin with a /) and the directory specification must not end with a /. 

ADAOPTS

The environment variable ADAOPTS can be used to supply commonly used (or default) arguments to ada.  ADAOPTS is associated directly with ada (it is not used by any other component of the Ada compilation system). 

Arguments can be passed to ada through the ADAOPTS environment variable, as well as on the command line.  Ada(1) picks up the value of ADAOPTS and places its contents before any arguments on the command line.  For example (in sh(1) notation),

$ ADAOPTS="-v -e 10"
$ export ADAOPTS
$ ada -L source.ada test.lib

is equivalent to

$ ada -v -e 10 -L source.ada test.lib

Compiler Options

The following options are recognized:

−a Store the supplied annotation string in the library with the compilation unit.  This string can later be displayed by the unit manager.  The maximum length of this string is 80 characters.  The default is no string. 

−b Display abbreviated compiler error messages (default is to display the long forms). 

−c Suppress link phase and, if binding occurred, preserve the object file produced by the binder.  This option only takes effect if linking would normally occur.  Linking normally occurs when binding has been requested. 

Use of this option causes an informational message to be displayed on standard error indicating the format of the ld(1) command that should be used to link the program.  It is recommended that the user supply additional object (.o) and archive (.a) files and additional library search paths (-lx) only in the places specified by the informational message. 

When ld is later used to actually link the program, the following conditions must be met:

1.  The Ada library specified when the bind was performed must be respecified. 

2.  The .o file generated by the binder must be specified before any HP-UX archive is specified (either explicitly or with −l). 

3.  If −lc is specified when linking, any .o file containing code that uses stdio(3S) routines must be specified before −lc is specified. 

−d Cause the compiler to store additional information in the Ada library for the units being compiled for use by the Ada debugger (see ada.probe(1)).  Only information required for debugging is saved; the source is not saved.  (see −D.)  By default, debut information is not stored. 

Cause the binder to produce a debug information file for the program being bound so that the resulting program can be manipulated by the Ada debugger.  The debug information file name will be the executable program file name with .cui appended.  If the debug information file name would be truncated by the file system on which it would be created, an error will be reported. 

Only sources compiled with the −d or −D option contribute information to the debug information file produced by the binder. 

−e <nnn> Stop compilation after <nnn> errors (legal range 0..32767, default 50). 

−i Cause any pending or existing instantiations of generic bodies in this Ada library, whose actual generic bodies have been compiled or recompiled in another Ada library, to be compiled (or recompiled) in this Ada library. 

This option is treated as a special "source" file and the compilation is performed when the option is encountered among the names of any actual source files. 

Any pending or existing instantiations in the same Ada library into which the actual generic body is compiled (or recompiled), do not need this option.  Such pending or existing instantiations are automatically compiled (or recompiled) when the actual generic body is compiled into the same Ada library. 

Warning: Compilation (or recompilation) of instantiations either automatically or by using this option only affects instantiations stored as separate units in the Ada library (see −u).  Existing instantiations which are "inline" in another unit are not automatically compiled or recompiled by using this option.  Units containing such instantiations must be explicitly recompiled by the user if the actual generic body is recompiled. 

−k Cause the compiler to save an internal representation of the source in the Ada library for use by the Ada cross referencer ada.xref(1).  By default, the internal representation is not saved. 

−lx Cause the linker to search the HP-UX library named either /lib/libx.a (tried first) or /usr/lib/libx.a (see ld(1)). 

-m <nnn> The supplied number is the size in Kbytes to be allocated at compile time to manipulate library information.  The range is 500 to 32767.  The default is 500.  The default size should work in almost all cases.  In some extreme cases involving very large programs, increasing this value will improve compilation time.  Also, if the value is to small, STORAGE_ERROR can be raised. 

−n Cause the output file from the linker to be marked as shareable (see −N).  For details refer to chatr(1) and ld(1). 

−o outfile Name the output file from the linker outfile instead of a.out.  In addition, if used with the −c option, name the object file output by the binder outfile.o instead of a.out.o.  If debugging is enabled (with −d or −D), name the debug information file output by the binder outfile.cui instead of a.out.cui. 

The object file output by the binder is deleted if −c is not specified. 

−q Cause the output file from the linker to be marked as demand loadable (see −Q).  For details refer to chatr(1) and ld(1). 

−r <nnn> Set listing line length to <nnn> (legal range 60..255, default 79).  This option applies to the listing produced by both the compiler and the binder (see −B, −L and −W b,−L). 

−s Cause the output of the linker to be stripped of symbol table information (see ld(1) and strip(1)). 

−t c,name Substitute or insert subprocess c with name where c is one or more of a set of identifiers indicating the subprocess(es).  This option works in two modes: 1) if c is a single identifier, name represents the full path name of the new subprocess; 2) if c 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 possible values of c are the following:

b binder body (standard suffix is adabind)

c compiler body (standard suffix is adacomp)

0 same as c

l linker (standard suffix is ld)

−u Cause instantiations of generic program unit bodies to be stored as separate units in the Ada library (see −i). 

If −u is not specified, and the actual generic body has already been compiled when an instantiation of the body is compiled, the body generated by the instantiation is stored "inline" in the same unit as its declaration. 

If −u is specified, or the actual generic body has not already been compiled when an instantiation of the body is compiled, the body generated by the instantiation is stored as a separate unit in the Ada library. 

The −u option may be needed if a large number of generic instantiations within a given unit result in the overflow of a compiler internal table. 

Specifying −u reduces the amount of table space needed, permitting the compiler to complete.  However it also increases the number of units used within the Ada library, as well as introduces a small amount of overhead at execution time, in units which instantiate generics. 

−v Enable verbose mode, producing a step-by-step description of the compilation, binding, and linking  process on standard error. 

−w Suppress warning messages. 

−x Perform syntactic checking only.  The libraryname argument must be supplied, although the Ada library is not modified. 

−B Causes the compiler to produce a compilation listing, suppressing page headers and the error summary at the end of the compilation listing.  This is useful when comparing a compilation listing with a previous compilation listing of the same program, without the page headers causing mismatches.  This option can not be specified in conjunction the −L option. 

−C Only generate checks for stack overflow.  Use of this option may result in erroneous (in the Ada sense) program behavior.  In addition, some checks (such as those automatically provided by hardware) might not be suppressed.  See the Users Guide for more information. 

−D Cause the compiler to store additional information in the Ada library for the units being compiled, for use by the Ada debugger (see ada.probe(1)).  In addition to saving information required for debugging, an internal representation of the actual source is saved.  This permits accurate source level debugging at the expense of a larger Ada library if the actual source file changes after it is compiled.  (see −d.)  By default, neither debug information nor source information is stored. 

Cause the binder to produce a debug information file for the program being bound so that the resulting program can be manipulated by the Ada debugger.  The debug information file name is the executable program file name with .cui appended.  If the debug information file name would be truncated by the file system on which it would be created, an error will be reported. 

Only sources compiled with the −d or −D option contribute information to the debug information file produced by the binder

−G Generate code but do not update the library.  This is primarily intended to allow one to get an assembly listing (with -S) without changing the library.  The libraryname argument must be supplied, although the Ada library is not modified. 

−I Suppress all inlining.  No procedures or functions are expanded inline and pragma inline is ignored.  This also prevents units compiled in the future (without this option in effect) from inlining any units compiled with this option in effect. 

−L Write a program listing with error diagnostics to standard output.  This option can not be specified in conjunction with the −B option. 

−M <main> Invoke the binder after all source files named in the command line (if any) have been successfully compiled.  The argument <main> specifies the entry point of the Ada program; <main> must be the name of a parameterless Ada library level procedure. 

The library level procedure <main> must have been successfully compiled into (or linked into) the named Ada library, either by this invocation of ada or by a previous invocation of ada (or ada.umgr(UTIL)). 

The binder produces an object file named a.out.o (unless −o is used to specify an alternate name), only if the option −c is also specified.  The object file produced by the binder is deleted unless the option −c is specified.  Note that the alternate name is truncated, if necessary, prior to appending .o. 

−N Cause the output file from the linker to be marked as unshareable (see −n).  For details refer to chatr(1) and ld(1). 

−O Invoke the optimizer.  This is equivalent to +O eioE. 

−P <nnn> Set listing page length to <nnn> lines (legal range 10..32767 or 0 to indicate no page breaks, default 66).  This length is the total number of lines listed per listing page.  It includes the heading, header and trailer blank lines, listed program lines, and error message lines.  This option applies to the listing produced by both the compiler and the binder (see −L and −W b,−L). 

−Q Cause the output file from the linker to be marked as not demand loadable (see −q).  For details refer to chatr(1) and ld(1). 

−R Suppress all runtime checks.  However, some checks (such as those automatically provided by hardware) might not be suppressed.  Use of this option may result in erroneous (in the Ada sense) program behavior. 

−S Write an assembly listing of the code generated to standard output.  This output is not in a form suitable for processing with as(1). 

−W c,arg1[,arg2,...,argN]
Cause arg1 through argN to be handed off to subprocess c.  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 c can assume are those listed under the −t option as well as d (driver program). 

For example, the specification to pass the -r (preserve relocation information) option to the linker would be:

-W l,-r

For example, the following:

-W b,-m,10,-s,2

sends the options −m 10 −s 2 to the binder.  Note that all the binder options can be supplied with one -W, (more than one −W can also be used) and that any embedded spaces must be replaced with commas.  Note that −W b is the only way to specify binder options. 

The −W d option specification allows additional implementation−specific options to be recognized and passed through the compiler driver to the appropriate subprocess.  For example,

-W d,-O,eo

sends the option −O eo to the driver, which sends it to the compiler so that the e and o optimizations are performed.  Furthermore, a shorthand notation for this mechanism can be used by prepending the option with +; as follows:

+O eo

This is equivalent to −W d,−O,eo.  Note that for simplicity this shorthand is applied to each implementation−specific option individually, and that the argvalue (if any) is separated from the shorthand argoption with white space instead of a comma. 

−X Perform syntactic and semantic checking.  The libraryname argument must be supplied, although the Ada library is not modified. 

Binder Options

The following options can be passed to the binder using -W b,...:

−W b,−b At execution time, interactive input blocks if data is not available.  All tasks are suspended if input data is not available.  This option is the default if the program contains no tasks (see −W b,−B). 

−W b,−k Keep uncalled subprograms when binding.  The default is to remove them. 

−W b,−m,<nnn>
Set the initial program stack size to <nnn> units of 1024 bytes (legal range 1..32767, default 10 units = 10 * 1024 bytes = 10240 bytes).  The value is rounded up to the next multiple of 2. 

−W b,−s,<nnn>
Cause round-robin scheduling to be used for tasking programs. Set the time slice to <nnn> tens of milliseconds (legal range 1..32767 or 0 to turn off time slicing).  By default, round-robin scheduling is enabled with a time slice of 1 second (<nnn> = 100). 

The time slice granularity is 20 milliseconds (<nnn> = 2). 

−W b,−t,<nnn>
Set task stack size of created tasks to <nnn> units of 1024 bytes. 

Set the initial (and maximum) task stack size (legal range 1..32767, default 8 units = 8 * 1024 bytes = 8192 bytes). 

−W b,−w Suppress warning messages. 

−W b,−x Perform consistency checks without producing an object file and suppress linking.  The −W b,−L option can be used to obtain binder listing information when this option is specified (see −W b,−L below). 

−W b,−B At execution time, interactive input does not block if data is not available.  Only the task(s) doing interactive input are suspended if input data is not available.  This option is the default if the program contains tasks (see −W b,−b). 

−W b,−L Write a binder listing with warning/error diagnostics to standard error. 

−W b,−T Suppress procedure traceback in response to runtime errors and unhandled exceptions. 

Locks

To ensure the integrity of their internal data structures, Ada libraries and families are locked for the duration of operations that are performed on them.  Normally Ada families are locked for only a short time when libraries within them are manipulated.  However, multiple Ada libraries might need to be locked for longer periods during a single operation.  If more than one library is locked, ada places an exclusive lock on one library, so it can be updated, and a shared lock on the other(s), so that they can remain open for read-only purposes. 

An Ada family or library locked for updating cannot be accessed in any way by any part of the Ada compilation system except by the part that holds the lock.  An Ada family or library locked for reading can be accessed by any part of the Ada compilation system desiring to read from the Ada family or library. 

If ada cannot obtain a lock after a suitable number of retries, it displays an informational message and terminates. 

Under some circumstances, an Ada family or Ada library might be locked, but the locking program(s) might have terminated (for example, due to system crash or network failure).  If you determine that the Ada family or Ada library is locked but should not be locked, you may remove the lock. 

Use ada.unlock(1) to unlock an Ada library and ada.funlock(1) to unlock an Ada family.  However, unlocking should be done with care.  If an Ada family or Ada library is actually locked by a tool, unlocking it will permit access by other tools that might find the contents invalid or that might damage the Ada family or Ada library. 

DIAGNOSTICS

The diagnostics produced by ada are intended to be self-explanatory.  Occasional messages might be produced by the linker. 

If a program listing (−B or -L) and/or generated code listing (-S) is requested from the compiler, this listing as well as compiler error messages are written to standard output. 

If neither a program listing nor a generated code listing is requested from the compiler, erroneous source lines and compiler error messages are written to standard error. 

If a binder listing is requested from the binder (with -W b,-L), the binder listing as well as binder error messages are written to standard error. 

If a binder listing is not requested from the binder, binder error messages are written to standard error. 

Errors detected during command line processing or during scheduling of the compiler, binder, or linker, are written to standard error.  If any compiler, binder, or linker errors occur, ada writes a one-line summary to standard error immediately before terminating. 

WARNINGS

Options not recognized by ada are not passed on to the linker.  The option −W l,arg can be used to pass such options to the linker. 

Ada does not generate an error or warning if both optimization and debugging are requested.  However, ada.probe is only capable of limited debugging of optimized code.  Certain ada.probe commands may give misleading or unexpected results.  For example, object values may be stored in registers; therefore the value displayed from memory may be incorrect.  For this reason, the ability to examine or modify objects and expressions may be impaired.  Dead code elimination or code motion may affect single step execution or prevent breakpoints from being set on specific source lines. 

DEPENDENCIES

Series 300

The binder option −W b,−T also causes traceback tables to be excluded from final executable file. 

The following options are specific to the Series 300:

+O what Selectively invoke optimizations.  The what argument must be specified, and indicates which optimizations should be performed. 

The what argument can be a combination of the letters e, i, o, and p.  Either e or p, but not both, can be specified.  All other combinations are permitted; however, at most one of each letter can be specified. 

e Same as p (below). 

i Permit procedures and functions not declared with pragma inline to be expanded inline at the compiler’s discretion.  Only procedures and functions in the current source file are considered. 

Procedures and functions declared with pragma inline are always considered candidates for inline expansion unless −I is specified; this optimization only causes additional procedures and functions to be considered. 

o Peephole optimizations are performed on the final object code. 

p Optimizations are performed to remove unnecessary checks, optimize loops, and remove dead code. 

E Same as P (below). 

P Optimizations are performed on common subexpressions and register allocation. 

+h <type> Bind/link the program to use the specified <type> of hardware floating point assist for user code floating point operations (see +H).  The two <type>’s currently supported are 68881 (the 68881 math coprocessor) and 68882 (the 68882 math coprocessor).  The code generated is the same for either <type>.  This is the default if the host system provides a 68881 or a 68882 coprocessor. 

+i <type> Compile the program to inline the specified <type> of hardware floating point assist for user code floating point operations (see +I).  The two <type>’s currently supported are 68881 (the 68881 math coprocessor) and 68882 (the 68882 math coprocessor).  The code generated is the same for either <type>.  This is the default if the host system provides a 68881 or a 68882 coprocessor. 

+H Bind/link the program to use software floating point routines for user code floating point operations (see +h).  This is the default if the host system does not provide a 68881 or 68882 coprocessor. 

+I Compile the program to make calls to a math library for user code floating point operations (see +i).  The +h option is then used at bind/link time to specify whether hardware or software is used for floating point operations.  This is the default if the host system does not provide a 68881 or 68882 coprocessor. 

Unlike other Series 300 compilers, it is not possible to link-only using the ada(1) command.  If separate linking is desired, use the ld(1) command. 

A successful bind produces a (non-executable) .o file.  The .o file is normally deleted unless the compiler option −c is specified. 

AUTHOR

Ada was developed by HP and Alsys. 

FILES

file.ad?  input file (Ada source file). 

libraryname user Ada library (created using ada.mklib(1)) in which compiled units are placed by a successful compilation and from which the binder extracts the units necessary to build a relocatable file for ld(1).  Temporary files generated by the compiler are also created in this directory and are automatically deleted on successful completion.  Users are strongly discouraged from placing any additional files in Ada library directories.  User files in Ada libraries are subject to damage by or may interfere with proper operation of ada and related tools. 

file.o binder-generated object file or user-specified object file relocated at link time. 

a.out linked executable output file. 

file.cui binder-generated debug information file. 

$ADA_PATH/ada Ada compilation control program. 

$ADA_PATH/adacomp Ada compiler. 

$ADA_PATH/adabind Ada binder. 

$ADA_PATH/ada_environ
Ada environment description file.

$ADA_PATH/adaargu Ada argument formatter. 

$ADA_PATH/alternate Ada predefined library (sequential version). 

$ADA_PATH/installation
Ada installation family.

$ADA_PATH/public Ada public family. 

$ADA_PATH/err_tpl Ada compiler/binder error message files. 

$ADA_PATH/predeflib Ada predefined library, tasking version. 

$ADA_PATH/libada020.a
Ada run-time HP-UX library (MC68020).

$ADA_PATH/libada881.a
Ada run-time HP-UX library (MC68881).

/lib/crt0.o C run-time startup. 

/lib/libc.a HP−UX C library. 

/lib/libm.a HP−UX math library

SEE ALSO

ada.fmgr(1), ada.format(1), ada.funlock(1), ada.lmgr(1), ada.lsfam(1), ada.lslib(1), ada.make(1), ada.mkfam(1), ada.mklib(1), ada.mvfam(1), ada.mvlib(1), ada.probe(1), ada.protect(1), ada.rmfam(1), ada.rmlib(1), ada.umgr(1), ada.unlock(1), ada.xref(1),

Ada User’s Guide (Series 300),

Ada Tools Manual,

Reference Manual for the Ada Programming Language (ANSI/MIL-STD-1815A),

Reference Manual for the Ada Programming Language, Appendix F (Series 300).

EXTERNAL INFLUENCES

International Code Set Support

Single-byte character code sets are supported within file names. 

Hewlett-Packard Company  —  HP-UX Release 7.0: Sept 1989

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