Next: , Previous: Running gnatbind, Up: Binding Using gnatbind


4.2 Switches for gnatbind

The following switches are available with gnatbind; details will be presented in subsequent sections.

--version
Display Copyright and version, then exit disregarding all other options.
--help
If --version was not used, display usage, then exit disregarding all other options.
-a
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.
-aO
Specify directory to be searched for ALI files.
-aI
Specify directory to be searched for source file.
-A
Generate binder program in Ada (default)
-b
Generate brief messages to stderr even if verbose mode set.
-c
Check only, no generation of binder output file.
-C
Generate binder program in C
-dnn[k|m]
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 with m. 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.

-Dnn[k|m]
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, the secondary stack is allocated by carving off a fixed ratio chunk of the primary task stack. The -D option is used to define the size of the environment task's secondary stack.

-e
Output complete list of elaboration-order dependencies.
-E
Store tracebacks in exception occurrences when the target supports it. This is the default with the zero cost exception mechanism. 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.
-F
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.
-h
Output usage (help) information
-I
Specify directory to be searched for source and ALI files.
-I-
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.
-l
Output chosen elaboration order.
-Lxxx
Bind the units for library building. In this case the adainit and adafinal procedures (see Binding with Non-Ada Main Programs) are renamed to xxxinit and xxxfinal. Implies -n. (See GNAT and Libraries, for more details.)
-Mxyz
Rename generated main program from main to xyz. This option is supported on cross environments only.
-mn
Limit number of detected errors to n, where n is in the range 1..999_999. The default value if no switch is given is 9999. Binding is terminated if the limit is exceeded. Furthermore, under Windows, the sources pointed to by the libraries path set in the registry are not searched for.
-n
No main program.
-nostdinc
Do not look for sources in the system default directory.
-nostdlib
Do not look for library files in the system default directory.
--RTS=rts-path
Specifies the default location of the runtime library. Same meaning as the equivalent gnatmake flag (see Switches for gnatmake).
-o file
Name the output file file (default is b~xxx.adb). Note that if this option is used, then linking must be done manually, gnatlink cannot be used.
-O
Output object list.
-p
Pessimistic (worst-case) elaboration order
-R
Output closure source list.
-s
Require all source files to be present.
-Sxxx
Specifies the value to be used when detecting uninitialized scalar objects with pragma Initialize_Scalars. The xxx string specified with the switch may be either

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=xx, where xx 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).

-static
Link against a static GNAT run time.
-shared
Link against a shared GNAT run time when available.
-t
Tolerate time stamp and other consistency errors
-Tn
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.

-un
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.)
-v
Verbose mode. Write error messages, header, summary output to stdout.
-wx
Warning mode (x=s/e for suppress/treat as error)
-Wxe
Override default wide character encoding for standard Text_IO files.
-x
Exclude source files (check object consistency only).
-y
Enable leap seconds support in Ada.Calendar and its children.
-z
No main subprogram.

You may obtain this listing of switches by running gnatbind with no arguments.