This appendix contains the following sections:
Introduction
Prelinker
Muncher
This appendix describes the utility programs that are delivered with the C++ compiler. The utility programs help with various link-time issues and are meant to be called from the control program.
When you use a UNIX shell (Bourne shell,
C-shell), arguments containing special characters (such as '( )' and '?') must be enclosed
with "" or escaped. The -? option
(in the C-shell) becomes: "-?"
or -\?.
The prelinker is invoked at link time by the control program to manage automatic instantiation of template entities. It is given a complete list of the object files and libraries that are to be linked together. It examines the external names defined and referenced within those files, and finds cases where template entities are referenced but not defined. It then examines information in the object files that describes instantiations that could have been done during compilation, and assigns the needed instantiations to appropriate files. The prelinker then invokes the compiler again to compile those files, which will do the necessary instantiations.
The invocation syntax of the C++ prelinker is:
where the files list includes all object files and libraries, and the options are:
-? Display an explanation of options at stdout.
-V Display version information at stderr.
-c c Use c as symbol prefix character instead of the default underscore.
-D Do not assign instantiation to non-local object files. Instantiations may only be assigned to object files in the current directory.
-e Treat warnings as errors. This also affects the return value of the application when only warnings occur. A build process will now stop when warnings occur.
-i Ignore invalid input lines.
-lxxx Specify a library (e.g., -lcp).
-L Skip system library search.
-L directory Specify an additional search path for system libraries.
-m Do not demangle identifier names that are displayed.
-n Update the instantiation list files (.ii), but do not recompile the source files.
-N If a file from a non-local directory needs to be recompiled, do the compilation in the current directory. An updated list of object files and library names is written to the file specified by the -o option so that the control program can tell that alternate versions of some of the object files should be used.
-o file Write an updated list of object files and library names to the file specified by file. Use this option when the -N or -O option is used.
-O One instantiation per object mode is used. A list of object files, including the instantiation object files associated with the object files specified on the prelinker command line, is written to the file specified by the -o option.
-q Quiet mode. Turns off verbose mode.
-r Do not stop after the maximum number of iterations. (The instantiation process is iterative: a recompilation may bring up new template entities that need to be instantiated, which requires another recompilation, etc. Some recursive templates can cause iteration that never terminates, because each iteration introduces another new entity that was not previously there. By default, this process is stopped after a certain number of iterations.)
-R number Override the number of reserved instantiation information file lines to be used.
-s number Specifies whether the prelinker should check for entities that are referenced as both explicit specializations and generated instantiations. If number is zero the check is disabled, otherwise the check is enabled.
-S Suppress instantiation flags in the object files.
-T cpu Set the target CPU type. This name is used to determine the actual location of the system libraries relative to the default lib directory.
-u Specify that external names have an added leading underscore. By default, external names do not have a leading underscore. With this option you specify that a leading underscore should be stripped from the external name.
-v Verbose mode.
The muncher implements a lowest-common-denominator method for getting global initialization and termination code executed on systems that have no special support for that.
The muncher accepts the output of the linker as its input file and generates a C program that defines a data structure containing a list of pointers to the initialization and termination routines. This generated program is then compiled and linked in with the executable. The data structure is consulted at run-time by startup code invoked from main, and the routines on the list are invoked at the appropriate times.
The invocation syntax of the C++ muncher is:
where the file is an output file generated by the linker, and the options are:
-? Display an explanation of options at stdout.
-V Display version information at stderr.
-c c Use c as symbol prefix character instead of the default underscore
-i n Skip first n lines of input.
-o file Write output to file.
-u Specify that external names have an added leading underscore. By default, external names do not have a leading underscore. With this option you specify that a leading underscore should be stripped from the external name.