ADA(1) — HP-UX
Series 300 Only
NAME
ada − Ada compiler
SYNOPSIS
ada [ options ] [ files ] libraryname
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 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 and/or 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, 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.
(4) Although shown in the preferred order above; option, file name, and libraryname arguments can appear in any order.
Environment Variables
Two environment variables, ADA_PATH and ADA_PREDEF_LIB, are associated with all components of the the Ada compilation system. Both must be set properly and exported before any component of the Ada compilation system (including ada) can be used.
Normally these variables are defined and set in the systemwide shell startup files /etc/profile (for sh(1)) and /etc/csh.login (for csh(1)). However, they can be set by a user either interactively or in a personal shell, startup file .profile (for sh(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.
ADA_PREDEF_LIB must contain the path name of the directory in which the Ada predefined library has been installed.
The value of both variables 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:
−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 either binding has been requested and/or when non-source files are specified.
Use of this option causes an informational message to be displayed on standard error indicating what format of the ada(1) command can be used to link the program.
When ada 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. (By default, debug information is not stored; see −D.)
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. (By default, debug information file is not produced.)
−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 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 recompiled nor 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)).
If linking a previously bound program (see −c), the .o file produced by the binder must be specified before any use of this option.
−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, name the object file output by the binder outfile.o instead of <main>.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 normally deleted following a successful link (see −c).
−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..132, default 80). This option applies to the listing produced by both the compiler and the binder (see −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 actualy 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 introduce 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.
−C Suppress runtime checks. 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.
−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. (By default, neither debug information nor source information is stored; see −d).
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 (By default, the debug information file is not produced.)
−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.
−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(1)).
The binder produces an object file named <main>.o (unless −o is used to specify an alternate name), which is normally deleted if the link phase is successful (see −c). Note that <main> (or 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 eio.
−P <nnn> Set listing page length to <nnn> lines (legal range 20..32000 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. Some pages might be shorter than specified, since some multi-line messages are moved to a new page rather than split across a page boundary. 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).
−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,−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 output.
−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 a library is added, removed, or renamed. 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, 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 not actually locked, you may remove the lock.
Use ada.unlock(1) to unlock an Ada library and the UNLOCK command of ada.fmgr(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 (-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 output.
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.
Several options have changed since early versions of ada. These options and the changes are noted below.
-i The original −i option functioned incorrectly (that is, its function was reversed from that specified by the documentation). The function previously intended by the original −i option is now available with the −u option. The −i option now supported has an unrelated function.
−W b,-L This binder option required a following argument. The argument is no longer supported. Specification of the argument will elicit a warning message.
−W b,-o This binder option had the same function as the −o compiler option. This binder option is still supported; however, use of the binder option elicits a warning message. The −o compiler option should be used instead.
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.
+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 only <type> currently supported is 68881 (the 68881 math coprocessor). This is the default if the host system provides a 68881 coprocessor.
If this option is specified and −c is also specified, this option must be specified again when ada is used to actually link the program.
+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 coprocessor.
If this option is specified and −c is also specified, this option must be specified again when ada is used to actually link the program.
Unlike other Series 300 compilers, code is generated for the processor type that is specified (or defaulted) when the Ada library is created (see ada.mklib(1)). The compiler cannot be instructed as to which type of code to generate.
A successful bind produces a (non-executable) .o file. The .o file is normally deleted following a successful link, although the file is retained if the compiler option −c is specified or if the link operation fails.
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/adacomp Ada compiler.
$ADA_PATH/adabind Ada binder.
$ADA_PATH/alternate Ada predefined library (sequential version).
$ADA_PATH/installation
Ada installation family.
$ADA_PATH/public Ada public family.
$ADA_PATH/*_mod_str
Ada compiler listing processor message file.
$ADA_PATH/*_err_tpl Ada compiler/binder error message files.
$ADA_PREDEF_LIB Ada predefined library, tasking version.
/lib/crt0.o C run-time startup.
/usr/lib/libada010.a Ada run-time HP-UX library (MC68010).
/usr/lib/libada020.a Ada run-time HP-UX library (MC68020).
/usr/lib/libada881.a Ada run-time HP-UX library (MC68881).
/lib/libc.a HP−UX C library.
/lib/libm.a HP−UX math library
SEE ALSO
ada.fmgr(1), ada.format(1), ada.mklib(1), ada.mvlib(1), ada.probe(1), ada.protect(1), ada.rmlib(1), ada.umgr(1), ada.unlock(1). ada.xref(1).
Ada User’s Guide (Series 300), HP Part No. 98860-90000.
Ada Tools Manual, HP Part No. 98860-90020.
Reference Manual for the Ada Programming Language (ANSI/MIL-STD-1815A), HP Part No. 97055-90610.
Reference Manual for the Ada Programming Language −− Appendix F (Series 300), HP Part No. 98860-90010.
INTERNATIONAL SUPPORT
8-bit file names.
Hewlett-Packard Company — May 11, 2021