The following switches are available with gnatbind; details will be presented in subsequent sections.
Display Copyright and version, then exit disregarding all other options.
If `–version' was not used, display usage, then exit disregarding all other options.
Indicates that, if supported by the platform, the adainit procedure should be treated as an initialisation routine by the linker (a constructor). This is intended to be used by the Project Manager to automatically initialize shared Stand-Alone Libraries.
Specify directory to be searched for ALI files.
Specify directory to be searched for source file.
Output ALI list (to standard output or to the named file).
Generate brief messages to
stderr even if verbose mode set.
Check only, no generation of binder output file.
This switch can be used to change the default task stack size value
to a specified size nn, which is expressed in bytes by default, or
in kilobytes when suffixed with k or in megabytes when suffixed
In the absence of a
[k|m] suffix, this switch is equivalent,
in effect, to completing all task specs with
pragma Storage_Size (nn);
When they do not already have such a pragma.
This switch can be used to change the default secondary stack size value to a specified size nn, which is expressed in bytes by default, or in kilobytes when suffixed with k or in megabytes when suffixed with m.
The secondary stack is used to deal with functions that return a variable sized result, for example a function returning an unconstrained String. There are two ways in which this secondary stack is allocated.
For most targets, the secondary stack is growing on demand and is allocated as a chain of blocks in the heap. The -D option is not very relevant. It only give some control over the size of the allocated blocks (whose size is the minimum of the default secondary stack size value, and the actual size needed for the current allocation request).
For certain targets, notably VxWorks 653 and bare board targets, the secondary stack is allocated by carving off a chunk of the primary task stack. By default this is a fixed percentage of the primary task stack as defined by System.Parameter.Sec_Stack_Percentage. This can be overridden per task using the Secondary_Stack_Size pragma/aspect. The -D option is used to define the size of the environment task’s secondary stack.
Output complete list of elaboration-order dependencies.
Store tracebacks in exception occurrences when the target supports it. The "a" is for "address"; tracebacks will contain hexadecimal addresses, unless symbolic tracebacks are enabled.
See also the packages GNAT.Traceback and GNAT.Traceback.Symbolic for more information. Note that on x86 ports, you must not use `-fomit-frame-pointer' `gcc' option.
Store tracebacks in exception occurrences when the target supports it. The "s" is for "symbolic"; symbolic tracebacks are enabled.
Currently the same as -Ea.
Force elaboration order.
Force the checks of elaboration flags. `gnatbind' does not normally generate checks of elaboration flags for the main executable, except when a Stand-Alone Library is used. However, there are cases when this cannot be detected by gnatbind. An example is importing an interface of a Stand-Alone Library through a pragma Import and only specifying through a linker switch this Stand-Alone Library. This switch is used to guarantee that elaboration flag checks are generated.
Output usage (help) information.
Use 32-bit allocations for __gnat_malloc (and thus for access types). For further details see Dynamic Allocation Control.
Use 64-bit allocations for __gnat_malloc (and thus for access types). For further details see Dynamic Allocation Control.
Specify directory to be searched for source and ALI files.
Do not look for sources in the current directory where gnatbind was invoked, and do not look for ALI files in the directory containing the ALI file named in the gnatbind command line.
Output chosen elaboration order.
Bind the units for library building. In this case the adainit and adafinal procedures (Binding with Non-Ada Main Programs) are renamed to xxx‘init and ‘xxx‘final. Implies -n. (:ref:‘GNAT_and_Libraries, for more details.)
Rename generated main program from main to xyz. This option is supported on cross environments only.
Limit number of detected errors or warnings to n, where n is in the range 1..999999. The default value if no switch is given is 9999. If the number of warnings reaches this limit, then a message is output and further warnings are suppressed, the bind continues in this case. If the number of errors reaches this limit, then a message is output and the bind is abandoned. A value of zero means that no limit is enforced. The equal sign is optional.
No main program.
Do not look for sources in the system default directory.
Do not look for library files in the system default directory.
Specifies the default location of the runtime library. Same meaning as the equivalent `gnatmake' flag (Switches for gnatmake).
Name the output file file (default is
Note that if this option is used, then linking must be done manually,
gnatlink cannot be used.
Output object list (to standard output or to the named file).
Pessimistic (worst-case) elaboration order.
Generate binder file suitable for CodePeer.
Output closure source list, which includes all non-run-time units that are included in the bind.
Like `-R' but the list includes run-time units.
Require all source files to be present.
Specifies the value to be used when detecting uninitialized scalar objects with pragma Initialize_Scalars. The xxx string specified with the switch is one of:
infor an invalid value.
If zero is invalid for the discrete type in question, then the scalar value is set to all zero bits. For signed discrete types, the largest possible negative value of the underlying scalar is set (i.e. a one bit followed by all zero bits). For unsigned discrete types, the underlying scalar value is set to all one bits. For floating-point types, a NaN value is set (see body of package System.Scalar_Values for exact values).
lofor low value.
If zero is invalid for the discrete type in question, then the scalar value is set to all zero bits. For signed discrete types, the largest possible negative value of the underlying scalar is set (i.e. a one bit followed by all zero bits). For unsigned discrete types, the underlying scalar value is set to all zero bits. For floating-point, a small value is set (see body of package System.Scalar_Values for exact values).
hifor high value.
If zero is invalid for the discrete type in question, then the scalar value is set to all one bits. For signed discrete types, the largest possible positive value of the underlying scalar is set (i.e. a zero bit followed by all one bits). For unsigned discrete types, the underlying scalar value is set to all one bits. For floating-point, a large value is set (see body of package System.Scalar_Values for exact values).
The underlying scalar is set to a value consisting of repeated bytes, whose
value corresponds to the given value. For example if
BF is given,
then a 32-bit scalar value will be set to the bit patterm
In addition, you can specify `-Sev' to indicate that the value is
to be set at run time. In this case, the program will look for an environment
variable of the form
GNAT_INIT_SCALARS=`yy', where yy is one
of `in/lo/hi/‘xx*‘ with the same meanings as above.
If no environment variable is found, or if it does not have a valid value,
then the default is *in' (invalid values).
Link against a static GNAT run time.
Link against a shared GNAT run time when available.
Tolerate time stamp and other consistency errors.
Set the time slice value to n milliseconds. If the system supports the specification of a specific time slice value, then the indicated value is used. If the system does not support specific time slice values, but does support some general notion of round-robin scheduling, then any nonzero value will activate round-robin scheduling.
A value of zero is treated specially. It turns off time slicing, and in addition, indicates to the tasking run time that the semantics should match as closely as possible the Annex D requirements of the Ada RM, and in particular sets the default scheduling policy to FIFO_Within_Priorities.
Enable dynamic stack usage, with n results stored and displayed at program termination. A result is generated when a task terminates. Results that can’t be stored are displayed on the fly, at task termination. This option is currently not supported on Itanium platforms. (See Dynamic Stack Usage Analysis for details.)
Verbose mode. Write error messages, header, summary output to
Store the given association of key to value in the bind environment. Values stored this way can be retrieved at run time using GNAT.Bind_Environment.
Warning mode; x = s/e for suppress/treat as error.
Override default wide character encoding for standard Text_IO files.
Exclude source files (check object consistency only).
Set default exit status value, normally 0 for POSIX compliance.
Enable leap seconds support in Ada.Calendar and its children.
No main subprogram.
You may obtain this listing of switches by running gnatbind with no arguments.
|• Consistency-Checking Modes:|
|• Binder Error Message Control:|
|• Elaboration Control:|
|• Output Control:|
|• Dynamic Allocation Control:|
|• Binding with Non-Ada Main Programs:|
|• Binding Programs with No Main Subprogram:|