.\" .\". \"ident "@(#)ctrans:man/CC.1 1.1.1.1" .\"." Sun @(#)CC.1 1.136 10/21/98 16:29:42 SMI .\". \"This CC man page is generated by: troff -man CC.1 .\". \alias pm_new '(troff -t -Tlw -mansun \!* | lpr -n ) >& /dev/null &' .\". \alias pman_new '(troff -Tlw -mansun -t \!*) | preview &' .\". \"This man page reflects the Sun`s native compiler .\". \"All Rights Reserved .\". \"THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF .\". \"SUN MICROSYSTEMS .\". \"The copyright notice above does not evidence any .\". \"actual or intended publication of such source code. .TH CC 1 "00/04/05 Sun WorkShop 6" .ds ]W .if n .na .UC 4 .SH NAME CC \- Sun WorkShop Compilers C++ 6 .SH SYNOPSIS .IP \fBCC .RB [ \-386 ] .RB [ \-486 ] .RB [ \-a ] .RB [ \-B "(\fBdynamic\fR|\fBstatic\fR|\fBsymbolic\fR)]" .RB [ \-c ] .RB [ \-cg ( 89 |\fB92\fR)] .RB [ \-compat [ = ( 4\fR|\fB5\fR)]] .RB [ \+d ] .RB [ \-D\fIname [ =\fIdef ]] .RB [ \-d ( y |\fBn\fR)] .RB [ \-dalign ] .RB [ \-dryrun ] .RB [ \-E ] .RB [ +e ( 0 | 1\fR)] .RB [ \-fast ] .RB [ \-features=\fIa ] .RB [ \-flags ] .RB [ \-fnonstd ] .RB [ \-fns [ = ( yes\fR|\fBno\fR)]] .RB [ \-fprecision=\fIp ] .RB [ \-fround=\fIr ] .RB [ \-fsimple [ =\fIn ]] .RB [ \-fstore ] .RB [ \-ftrap=\fIt ] .RB [ \-G ] .RB [ \-g ] .RB [ \-g0 ] .RB [ \-H ] .RB [ "\-h\ \fIlname" ] .RB [ \-help ] .RB [ \-i ] .RB [ "\-I\ \fIdir" ] .RB [ \-instances=\fIi ] .RB [ \-keeptmp ] .RB [ \-KPIC ] .RB [ \-Kpic ] .RB [ \-L\fIdir ] .RB [ \-l\fIlib ] .RB [ \-libmieee ] .RB [ \-libmil ] .RB [ \-library=\fIlib ] .RB [ \-migration ] .RB [ \-misalign ] .RB [ \-mt ] .RB [ \-native ] .RB [ \-noex ] .RB [ \-nofstore ] .RB [ \-nolib ] .RB [ \-nolibmil ] .RB [ \-noqueue ] .RB [ \-norunpath ] .RB [ \-O [ \fIn ]] .RB [ "\-o\ \fIfile" ] .RB [ +p ] .RB [ \-P ] .RB [ \-p ] .RB [ \-pentium ] .RB [ \-pg ] .RB [ \-PIC ] .RB [ \-pic ] .RB [ \-pta ] .RB [ \-pti\fIdir ] .RB [ \-pto ] .RB [ \-ptr\fIdir ] .RB [ \-ptv ] ./".RB [ "\-Qcomponent\ \fIcomponent path" ] ./".RB [( \-Q | \-q ) "dir\ \fIdir" ] .RB [( "\-Qoption\fR|\fB\-qoption" ) "\ \fIphase option" ] ./" .RB [( \-Qpath | \-qpath ) "\ \fIdir" ] .RB [( "\-Qproduce\fR|\fB\-qproduce" ) "\ \fItype" ] .RB [ \-qp ] .RB [ \-R\fIpath ] .RB [ \-readme ] .RB [ \-S ] .RB [ \-s ] .RB [ \-sb ] .RB [ \-sbfast ] .RB [ \-staticlib=\fIllst ] .RB [ \-temp=\fIdir ] .RB [ \-template=\fIw ] .RB [ \-time ] .RB [ \-U \fIname ] ./".RB [ "\-u\ \fIname" ] .RB [ \-unroll=\fIn ] .RB [ \-V ] .RB [ \-v ] .RB [ \-vdelx ] .RB [ \-verbose=\fIvlst ] .RB [ \+w ] .RB [ \+w2 ] .RB [ \-w ] .RB [ \-xa ] .RB [ \-xar ] .RB [ \-xarch=\fIisa ] .RB [ \-xcache=\fIc ] .RB [ \-xcg (\fB89\fR|\fB92\fR)] .RB [ \-xchip=\fIc ] .RB [ \-xcode=\fIv ] .RB [ \-xcrossfile=\fIn ] .RB [ \-xF ] .RB [ \-xhelp= (\fBflags\fR|\fBreadme\fR)] .RB [ \-xild (\fBoff\fR|\fBon\fR)] .RB [ \-xlibmieee ] ./" bg 4209359 .RB [ \-xlibmil ] .RB [ \-xlibmopt ] .RB [ \-xlic_lib=sunperf ] .RB [ \-xlicinfo ] .RB [ \-Xm ] .RB [ \-xM ] .RB [ \-xM1 ] .RB [ \-xMerge ] .RB [ \-xnolib ] .RB [ \-xnolibmil ] .RB [ \-xnolibmopt ] .RB [ \-xO\fIlevel] .RB [ \-xpg ] .RB [ \-xprefetch [ = \fBa\fR[,\fBa\fR]] .RB [ \-xprofile=\fIp ] .RB [ \-xregs=\fIrlst ] .RB [ \-xs ] .RB [ \-xsafe ] .RB [ \-xsb ] .RB [ \-xsbfast ] .RB [ \-xspace ] .RB [ \-xtarget=\fIt ] .RB [ \-xtime ] .RB [ \-xunroll=\fIn ] .RB [ \-xvector [ =\fR(\fByes\fR|\fBno )] .RB [ \-xwe ] .RB [ "\-z\ \fIarg" ] .RB [ \-ztext ] .RI [ file ] \&.\|.\|. .SH Sun WorkShop Release 6 Be sure to read the C++ README file by using the command: .sp .B \ \ \ \ \ % CC \-xhelp=readme .LP .B Note \(em In this document the term "IA" refers to the Intel 32-bit processor architecture, which includes the Pentium, Pentium Pro, Pentium II, Pentium II Xeon, Celeron, Pentium III, and Pentium III Xeon processors and compatible microprocessor chips made by AMD and Cyrix. .SH DESCRIPTION \f3CC\f1 converts C++ and assembly source files to object files, and links object files and libraries into executable programs. .PP Programs containing C++ objects must be linked with \f3CC\f1. .\" .\" .PP .B CC takes arguments ending in .B .c, .C, .cc, .cxx, .cpp, or .B .i to be C++ source programs. The .B .i files are presumed to be preprocessed files. Arguments ending in .B .s are presumed to be assembly source files. Arguments ending in .B .o are presumed to be object files. .PP Files whose names do not end with the above suffixes are treated as object programs or libraries and are handed over to the link editor. Unless .BR \-c\fR, .BR \-S\fR, .B \-E\fR, or .B \-P\fR is specified, these programs and libraries, together with the results of any specified compilations or assemblies, are linked in the order given to produce an output file named .BR a.out . You can specify a different name for the executable by using the .B \-o option. .LP If a single file is compiled and linked all at once, the intermediate files are deleted. .LP The Incremental Link Editor .RB ( ild ) is sometimes used in place of linker .B ld for incremental linking. See \f3\-xildon\f1 and \f3\-xildoff\f1 for more information. .LP Before you use the .B CC command, insert the name of the directory in which you have chosen to install the C++ compilation system at the .I beginning of your search path. For instructions on setting your search path, see the csh(1) or the sh(1) man page. .SH COMPILING FOR 64-BIT: Sun WorkShop Compilers C++ 6 can produce 64-bit object binaries on the Solaris 7 and Solaris 8 operating environments (SPARC Platform Edition) with a 64-bit kernel. The resulting executable will run only on a SPARC V9 (64-bit) processor under a Solaris 7 or Solaris 8 operating environment with a 64-bit kernel. .LP To create a 64-bit application, use the .BR \-xarch=v9 , .BR \-xarch=v9a , or .B \-xarch=v9b option. Note that one of these options must be specified even if .B \-xtarget or .B \-fast is also specified. In such a case, the .BR \-xarch=v9 , .BR \-xarch=v9a , or .B \-xarch=v9b option must appear AFTER .B \-xtarget ./" bg 4209359 or any other option that sets .B \-xtarget (such as .BR \-fast ). For example: .LP .B \ \ \ \ \-xtarget=ultra \-xarch=v9 .LP Note that .B \-xtarget=ultra and .B \-xtarget=ultra2 imply .B \-xarch=v8 and do not automatically signal .BR \-xarch=v9 , .BR \-xarch=v9a , or .BR \-xarch=v9b . .LP See also the .B \-xcode=abs32|abs44|abs64|pic13|pic32 option for specifying code address forms. .LP The 64-bit application development environment not only enables 64-bit integer and pointer data, but also supports large files and large arrays. .LP For more details, see: .LP \ \ \ \ \\fB\/SUNWspro\/READMEs\/64bit_Compilers\fR .LP Replace with the path to your Sun WorkShop installation directory. In a default installation, is .BR /opt . .LP For general information on 64-bit Solaris for software developers, see the "Solaris 64-bit Developer's Guide" in AnswerBook2. .LP .\" .\" ADD BACK IN WHEN TEA IS AVAILABLE! Also -Ztha .\" .\" .SH OPTIONS .PP In general, compiler options are processed from left to right (with the exception that the .B \-U options are processed after all .B \-D options), allowing selective overriding of macro options (options that include other options). This rule does not apply to linker options. .PP For a complete description of the C++ compiler options, including examples, see the .I C++ User's Guide. .PP .B CC accepts the following options: .TP 1i .B \-386 .I (IA platform) Use \f3\-xtarget=386\f1. .TP .B \-486 .I (IA platform) Use \f3\-xtarget=486\f1. .TP .B \-a Use .B \-xa. .RS .PP See also: .PP .BR tcov (1) man page .RE .TP .BI \-B binding Specifies whether a library binding for linking is .IR symbolic , .I dynamic (shared), or .I static (nonshared). .RS .PP .B \-Bdynamic is the default. You can use the .B \-B option to toggle several times on a command-line. .PP For more information on the .BI \-B binding option, see the .BR ld (1) man page and the Solaris documentation. .PP .B \-Bdynamic directs the link editor to look for .BI lib lib .so files. Use this option if you want shared library bindings for linking. If the .BI lib lib .so files are not found, it looks for .BI lib lib .a files. .PP .B \-Bstatic directs the link editor to look .I only for .BI lib lib .a files. The .B \&.a suffix indicates that the file is static, that is, nonshared. Use this option if you want nonshared library bindings for linking. .PP For an explanation of .BR \-Bsymbolic , See the .BR ld (1) man page. .PP This option and its arguments are passed to the linker, .BR ld . If you compile and link in separate steps and are using the .BI \-B binding option, you must include the option in the link step. .PP Warning: .PP When building a shared library in compatiblity mode .RB ( \-compat[=4] ")," do not use .B -Bsymbolic if the library has exceptions in it. Exceptions that should be caught might be missed. .RE .TP .B \-c Directs the .B CC driver to suppress linking with .B ld and, instead, produce a .B \&.o file for each source file. If you specify only one source file on the command-line, then you can explicitly name the object file with the .B \-o option. For example: .RS .TP o If you enter .B CC .B \-c .BR x\&.cc , the object file, .BR x.o , is generated. .TP o If you enter .B CC .B \-c .BR x\&.cc .B \-o .BR y\&.o , the object file, .BR y.o , is generated. .PP Warnings: .PP .\" bg 4069469 When the compiler produces object code for an input file .RB "(for example, " .cc ", " .c ", or" .BR .i ), the compiler always produces a .B .o file in the working directory. If you suppress the linking step, the .B .o files are not removed. .PP See also: .PP .B \-o .I filename\fR. .RE .TP .BR \-cg ( 89 | 92 ) Use .BR \-xcg ( 89 | 92 ). .sp See also: .sp .BR \-xtarget=native .sp .TP .BR \-compat [ = (\fB4\fR|\fB5\fR)] Sets the compiler to to be compatible with the Sun WorkShop C++ compiler versions 4.0.1, 4.1, and 4.2 or sets the compiler to standard mode (the default mode). This option controls the .BR \__cplusplus " and " \__SUNPRO_CC_COMPAT preprocessor symbols. .sp The C++ compiler has two principal modes. One accepts the semantics and language defined by the Annotated C++ Reference Manual (ARM) and used in the 4.2 compiler (the compatibility mode, .BR \-compat=4 ). The other accepts constructs according to the ANSI/ISO standard (standard mode, .BR \-compat=5 ). These two modes are incompatible with each other because the ANSI/ISO standard forces significant, incompatible changes in name mangling, vtable layout, and other ABI details. These two modes are differentiated by the .B \-compat option as shown in the following values. .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .B \-compat=4 Compile for compatibility with Sun WorkShop C++ compiler versions 4.0.1, 4.1, and 4.2 (Sets the .B __cplusplus macro to 1 and .B __SUNPRO_CC_COMPAT to 4). .TP 1.5i .B \-compat=5 Compile for standard mode. (Sets .B __cplusplus macro to .BR 199711L " and" .B __SUNPRO_CC_COMPAT to 5). .RE .RS .PP Defaults: .sp If the .B \-compat option is not specified, .B \-compat=5 is assumed. If only .B \-compat is specified, .B \-compat=4 is assumed. .PP Interactions: .sp The .BR \-xarch=v9 , .BR \-xarch=v9a , and .B \-xarch=v9b options are not supported when used with the .BR \-compat [ =4 ] option. .RE .TP .B \+d Prevents the compiler from expanding C++ inline functions. This option is turned on when you specify .BR \-g , the debugging option. .sp The debugging option, .BR \-g0 , does not turn on .BR +d . See .BR \-g0 . .\" warning removed per sc 2/00 .TP .BR \-D\fIname [ =\fIdef ] Defines a macro symbol .I name to the preprocessor. Doing so is equivalent to including a .B #define directive at the beginning of the source. You can use multiple .B \-D options. .RS .PP The following values are predefined: .PP .I SPARC and IA platforms: .sp .B "_\&_BUILTIN_VA_ARG_INCR" .br .B "_\&_cplusplus" .br .B "_\&_DATE__" .br .B "_\&_FILE__" .br .B "_\&_LINE__" .br .B "_\&_STDC__" .br .B "_\&_SVR4" .br .B "_\&_SUNPRO_CC" = 0x510 .br .B "_\&_SUNPRO_CC_COMPAT" = 4 or 5 .br .B "_\&_sun" .br .B sun .br .B "_\&_TIME__" .br .BR "_\&_\f2`uname -s`\f1_\f2`uname -r`\f1 (replacing invalid characters with underscores, for example: \-D__SunOS_5_7, \-D__SunOS_5_8) .br .B "_\&_unix" .br .B unix .br .B "_WCHAR_T" .br .B "__ARRAYNEW" if the "array" forms of operators new and delete are enabled .br (see "-features=[no%]arraynew") .br .B "_BOOL" if type bool is enabled .br (see "-features=[no%]bool") .br .sp .I SPARC only: .sp .B "_\&_sparc" .br .B sparc (32-bit compilation modes only) .sp .I SPARC V9 only: .sp .B __sparcv9 (64-bit compilation modes only) .sp .I IA platform only: .sp .B "_\&_i386" .br .B i386 .sp Defaults: .sp If you do not use \fR[\fB=\fIdef\fR], .I name is defined as 1. .sp Interactions: .sp If .B +p is used, .B sun, unix, sparc and .B i386 are not defined. .RE .TP .BR \-d ( y | n ) Allows or disallows dynamic libraries for the entire executable. .sp .B \-dy specifies dynamic linking, which is the default, in the link editor. .sp .B \-dn specifies static linking in the link editor. .sp This option and its arguments are passed to .BR ld . .TP .BR \-dalign .I (SPARC platform) Generates .B double-word load and .B store instructions whenever possible for improved performance. This option assumes that all .BR double "-typed" data are .BR double-word "-aligned." If you compile one unit with .BR \-dalign , compile all units of a program with .BR \-dalign , or you might get unexpected results. .TP .B \-dryrun Displays the options that the driver passes to the compiler. This option directs the driver .B CC to show, but not execute, the commands constructed by the compilation driver. .TP .B \-E Directs the .B CC driver to run only the preprocessor on C++ source files, and to send the result to .B stdout (standard output). No compilation is done; no .B .o files are generated. .sp This option causes preprocessor-type line number information to be included in the output. .sp Output from this option is not supported as input to the C++ compiler when templates are used. .TP .BR +e ( 0 | 1 ) Controls virtual table generation in compatibility mode .RB ( -compat [ =4 ]). This option is invalid and ignored in standard mode (the default mode). .sp Values: .RS .TP .2i o .B \+e0 suppresses the generation of virtual tables, and creates external references to those that are needed. .TP .2i o .B \+e1 creates virtual tables for all defined classes with virtual functions. .RE .TP .B \-fast .\" sc 10/1/99 Selects a combination of compilation options for optimum execution speed on the system upon which the code is being compiled. This option provides near maximum performance for most applications by expanding the following compilation options: .B \-dalign .I (SPARC only) .B \-fns .I (SPARC, IA) .\" fsimple=2 okd by Mukesh 10/25/99 .B \-fsimple=2 .I (SPARC only) .B \-ftrap=%none .I (SPARC, IA) .B \-xlibmil .I (SPARC, IA) .B \-nofstore .I (IA only) .B \-xO5 .I (SPARC, IA) .B \-xlibmopt .I (SPARC, IA) .B \-xtarget=native .I (SPARC, IA) .RS .PP Interactions: .PP The code generation option, the optimization level, and use of inline template files can be overridden by subsequent flags. For example, although the optimization level set by .B \-fast is .BR \-xO5 , if you specify .B \-fast .BR \-xO3 , the optimization level becomes .BR \-xO3 . The optimization level that you specify will override a previously set optimization level. .PP The .B \-fast macro expands into compilation options that may affect other specified options. For example, in the following command, the expansion of the .B \-fast macro includes .B \-xtarget=native which reverts .B \-xarch to one of the 32-bit architecture options. .PP Incorrect: .sp .B % CC -xarch=v9 -fast test.cc .PP Correct: .sp .B % CC -fast -xarch=v9 test.cc .PP See the description for each option to determine possible interactions. .PP Warnings: .PP Code compiled with the .B \-fast option is not portable. For example, compiling code using the following command on an UltraSPARC-III system will generate a binary that will not execute on an UltraSPARC-II system. .PP .B % CC -fast test.cc .PP Do not use this option for programs that depend on IEEE standard floating-point exception handling; different numerical results, premature program termination, or unexpected SIGFPE signals might occur. .PP The .B \-fast option includes .B \-fns .BR \-ftrap=%none ; that is, this option turns off all trapping. .PP In previous SPARC releases, the \fB\-fast\fR macro included \fB\-fnonstd\fR, now it does not. .PP In previous SPARC releases, the -fast macro expanded to .BR \-fsimple=1 . Now it expands to .BR \-fsimple=2 . .PP In previous releases, the .B \-fast macro expanded to .BR \-xO4 . Now it expands to .BR \-xO5 . .PP See also: .sp .I Numerical Computation Guide, .BR ieee_sun (3m). .RE .TP .BI \-features= a ./" bg 4209359 Enables/disables various C++ language features. .sp The following flags are valid for both standard mode (default) and compatibility mode (\fB-compat\fR) unless otherwise specified. .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .B %all All the .B \-feature options that are valid for the specified mode (compatibility mode or standard mode). .TP 1.5i .B %none Turn off all the features that can be turned off for the specified mode (compatiblity mode or standard mode). .TP 1.5i .RB \&[ no% ] altspell [Do not] Recognize alternative token spellings (for example, "and" for "&&"). .TP 1.5i .RB \&[ no% ] anachronisms [Do not] Allow anachronistic constructs. .TP 1.5i .RB \&[ no% ] arraynew (Compatibility mode only) .\" bg 4168851 [Do not] Recognize array forms of .B operator new and .B operator delete (for example, .B "operator new[] (void*)" ). When enabled, the macro .B \_\_ARRAYNEW = 1. When not enabled, the macro is not defined. For details on the use of this flag, see the .I C++ Migration Guide. .TP 1.5i .RB \&[ no% ] bool [Do not] Allow the bool type and literals. When enabled, the macro .B \_BOOL = 1. When disabled, the macro is not defined. .TP 1.5i .RB \&[ no% ] conststrings [Do not] Put literal strings in Read-Only memory. .TP 1.5i .RB \&[ no% ] except [Do not] Allow C++ exceptions. .TP 1.5i .RB \&[ no% ] explicit (Compatibility mode only) [Do not] Recognize the keyword .BR explicit . .TP 1.5i .RB \&[ no% ] export [Do not] Recognize the keyword .BR export . .TP 1.5i .RB \&[ no% ] iddollar [Do not] Allow \fB$\fR as a non-initial identifier character. .TP 1.5i .RB \&[ no% ] localfor [Do not] Use new local-scope rules for the .B for statement. .TP 1.5i .RB \&[ no% ] mutable [Do not] Recognize the keyword .BR mutable . .TP 1.5i .RB \&[ no% ] namespace (Compatibility mode only) [Do not] Recognize keywords .BR namespace , .BR using . .TP 1.5i .RB \&[ no% ] rtti (Compatibility mode only) [Do not] Allow runtime type identification (RTTI). RTTI must be enabled to use the .BR dynamic_cast<> " and " typeid operators. .TP 1.5i .RB \&[ no% ] strictdestrorder (Standard mode only) [Do not] Follow the requirements specified by the C++ standard regarding the order of the destruction of objects with static storage duration. .RE .RS .PP Defaults: .PP If .B \-features is not specified, the following is assumed for compatibility mode (\fB-compat\fR): .sp .B \-features=%none,anachronisms,except .sp If .B \-features is not specified, the following is assumed for standard mode (the default mode): .sp .B \-features=%all,no%iddollar .RE .TP .B \-flags Same as .BR \-xhelp=flags . .TP .B \-fnonstd .I (IA platform) Causes nonstandard initialization of floating-point arithmetic hardware. .RS .PP In addition, this option causes hardware traps to be enabled for floating-point overflow, division by zero, and invalid operations exceptions. .PP These results are converted into .B SIGFPE signals. If the program has no .B SIGFPE handler, it terminates with a memory dump (unless you limit the core dump size to 0). .PP Defaults: .PP If .B \-fnonstd is not specified, IEEE 754 floating-point arithmetic exceptions do not abort the program, and underflows are gradual. .PP See the .I Numerical Computation Guide for more information. .RE .TP .BR \-fns [ = (\fBno\fR|\fByes\fR)] .I (SPARC platform) Selects SPARC nonstandard floating-point mode. .RS .sp This flag causes the nonstandard floating-point mode to be enabled when a program begins execution. .sp On some SPARC platforms, the nonstandard floating-point mode disables "gradual underflow," causing tiny results to be flushed to zero rather than to produce subnormal numbers. It also causes subnormal operands to be silently replaced by zero. On those SPARC platforms that do not support gradual underflow and subnormal numbers in hardware, use of this option can significantly improve the performance of some programs. .sp Optional use of \f2=yes\f1 or \f2=no\f1 provides a way of toggling the \f3-fns\f1 flag following some other macro flag that includes \f3-fns\f1, such as \f3-fast\f1. .sp \f3-fns\f1 is the same as \f3-fns=yes\f1. .br \f3-fns=yes\f1 selects non-standard floating point. .br \f3-fns=no\f1 selects standard floating point. .PP Defaults: .sp If .B \-fns is not specified, the nonstandard floating-point mode is not enabled automatically. Standard IEEE 754 floating-point computation takes place, that is, underflows are gradual. .sp If only .B \-fns is specified .B \-fns=yes is assumed. .PP Warnings: .sp When nonstandard mode is enabled, floating-point arithmetic may produce results that do not conform to the requirements of the IEEE 754 standard. .sp This option is effective only on SPARC platforms and only if used when compiling the main program. On IA platforms, the option is ignored. .sp If you compile one routine with .BR \-fns , then compile all routines of the program with the .B \-fns option; otherwise you can get unexpected results. .RE .TP .BI \-fprecision= p .I (IA platform) Sets floating-point rounding precision mode. \fIp\fR must be one of: .BR single , .BR double , .BR extended . .sp The .B \-fprecision flag sets the rounding precision mode bits in the Floating Point Control Word. These bits control the precision to which the results of basic arithmetic operations (add, subtract, multiply, divide, and square root) are rounded. .sp The following table shows the meanings of the values of \fIp\fR: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&single Rounds to an IEEE single-precision value .TP 1i .B \&double Rounds to an IEEE double-precision value .TP 1i .B \&extended Rounds to the maximum precision available .RE .RS .PP When .I p is .B single or .B double, this flag causes the rounding precision mode to be set to .B single or .B double precision, respectively, when a program begins execution. When .I p is .B extended or the .B \-fprecision flag is not used, the rounding precision mode remains as the .BR extended precision. .PP The .B single precision rounding mode causes results to be rounded to 24 significant bits, and .B double precision rounding mode causes results to be rounded to 53 significant bits. In the default .B extended precision mode, results are rounded to 64 significant bits. This mode controls only the precision to which results in registers are rounded, and it does not affect the range. All results in register are rounded using the full range of the extended double format. Results that are stored in memory are rounded to both the range and precision of the destination format. .PP The nominal precision of the .B float type is .BR single . The nominal precision of the .B long double type is .BR extended . .PP Defaults: .sp When the .B \-fprecision flag is not specified, the rounding precision mode defaults to .BR extended . .PP Warnings: .sp This option is effective only on IA devices and only if used when compiling the main program. On SPARC devices, this option is ignored. .RE .TP .BI \-fround= r Sets the IEEE rounding mode in effect at startup. .sp .I r must be one of: .B nearest, tozero, negative, positive. .RS .TP 1i .B \&Value .B Meaning .TP 1i .B nearest Rounds towards the nearest number and breaking ties to even numbers. .TP 1i .B tozero Round-to-zero. .TP 1i .B negative Round-to-negative-infinity. .TP 1i .B positive Round-to-positive-infinity. .PP This option sets the IEEE 754 rounding mode that: .TP .2i o Can be used by the compiler in evaluating constant expressions. .TP .2i o Is established at runtime during the program initialization. .PP The meanings are the same as those for the \fBieee_flags\fR function, which may be used to change the mode at runtime. .PP Defaults: .PP When the .B \-fround option is not specified, the rounding mode defaults to .B \-fround=nearest. .PP Warnings: .PP If you compile one routine with .BI \-fround= r\fR, compile all routines of the program with the same .BI \-fround= r option; otherwise, you can get unexpected results. This option is effective only if used when compiling the main program. .RE .TP .BR \-fsimple [ =\fIn ] Selects floating-point optimization preferences. .RS .PP If \fIn\fR is present, it must be 0, 1 or 2. .RE .RS .sp The following table shows the \fB\-fsimple\fR values: .TP 1i .B \&Value .B Meaning .TP 1i .B \&0 Permits no simplifying assumptions. Preserves strict IEEE 754 conformance. .TP 1i .B \&1 Allows conservative simplification. The resulting code does not strictly conform to IEEE 754, but numeric results of most programs are unchanged. .TP 1i \& With .BR \-fsimple=1 , the optimizer is not allowed to optimize completely without regard to roundoff or exceptions. In particular, a floating point computation cannot be replaced by one that produces different results with rounding modes held constant at runtime. .TP 1i \& With .BR \-fsimple=1 , the optimizer can assume the following: .RS .TP .2i \&o IEEE 754 default rounding/trapping modes do not change after process initialization. .TP .2i \&o Computation producing no visible result other than potential floating point exceptions might be deleted. .TP .2i \&o Computation with infinities or NaNs as operands needs to propagate NaNs to their results; e.g., x*0 might be replaced by 0. .TP .2i \&o Computations do not depend on sign of zero. .RE .TP 1i .B \&2 Permits aggressive floating point optimization that may cause many programs to produce different numeric results due to changes in rounding. For example, permits the optimizer to replace all computations of \fBx/y\fR in a given loop with \fBx*z\fR, where \fBx/y\fR is guaranteed to be evaluated at least once in the loop, .B z=1\/y , and the values of y and z are known to have constant values during execution of the loop. .RE .RS .sp Defaults: .sp If .B \-fsimple is not designated, the compiler uses .B \-fsimple=0. .sp If .B \-fsimple is designated but no value is given for .IR n , the compiler uses .B \-fsimple=1. .sp Interactions: .sp .B \-fast implies .B \-fsimple=2. .sp Warnings: .sp This option can break IEEE 754 conformance. .RE .TP .B \-fstore .I (IA platform) Forces precision of floating-point expressions. .sp This option causes the compiler to convert the value of a floating-point expression or function to the type on the left side of an assignment - when that expression or function is assigned to a variable, or when that expression is cast to a shorter floating-point type rather than leaving the value in a register. .RS .PP To turn off this option, use the .B \-nofstore option. .RE .RS .PP Warnings: .sp Due to roundoffs and truncation, the results may be different from those that are generated from the register values. .RE .TP .BI \-ftrap= t Sets the IEEE trapping mode in effect at startup. .RS .sp This option sets the IEEE 754 trapping modes that are established at program initialization, but does not install a .B SIGFPE handler. You can use .B ieee_handler to simultaneously enable traps and install a .B SIGFPE handler. When more than one value is used, the list is processed sequentially from left to right. .PP \fIt\fR is a comma-separated list that consists of one or more of the following: .RE .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .RB \&[ no% ] division [Do not] Trap on division by zero. .TP 1.5i .RB \&[ no% ] inexact [Do not] Trap on inexact result. .TP 1.5i .RB \&[ no% ] invalid [Do not] Trap on invalid operation. .TP 1.5i .RB \&[ no% ] overflow [Do not] Trap on overflow. .TP 1.5i .RB \&[ no% ] underflow [Do not] Trap on underflow. .TP 1.5i .B %all Trap on all the above. .TP 1.5i .B %none Trap on none of the above. .TP 1.5i .B common Trap on invalid, division by zero, and overflow. .RE .RS .PP Note that the .RB [ no% ] form of the option is used only to modify the meanings of the .B %all or .B common value and and must be used with one of these values, as shown in the example. The .RB [ no% ] form of the option by itself does not explicitly cause a particular trap to be disabled. .sp If you wish to enable the IEEE traps, .B \-ftrap=common is the recommended setting. .sp Defaults: .sp If .B \-ftrap is not specified, the .B \-ftrap=%none value is assumed. (Traps will not be enabled automatically.) .sp Examples: .sp When one or more terms is given, the list is processed sequentially from left to right, thus .B \-ftrap=%all,no%inexact means to set all traps except .BR inexact . .sp Interactions: .sp The mode may be changed at runtime with .BR ieee_handler (3M) . .sp Warnings: .sp If you compile one routine with \fB\-ftrap=\fIt\fR, compile all routines of the program with the same .br .BI \-ftrap= t option; otherwise, you can get unexpected results. .sp Use the .B \-ftrap=inexact trap with caution, as it will result in the trap being issued whenever a floating-point value cannot be represented exactly. For example, the following statement may generate this condition: .sp .B x = 1.0 / 3.0; .sp This option is effective only if used when compiling the main program. .RE .TP .B \-G Instructs the linker to build a dynamic shared library instead of an executable file; see the .BR ld (1) man page and the .I C++ Library Reference. All source files specified in the command line are compiled with .BR \-Kpic " by default." .sp When building a shared library that uses templates, it is necessary in most cases to include in the shared library those template functions that are instantiated in the template database. Using this option automatically adds those templates to the shared library as needed. .sp The following options are passed to .B ld if .B \-c is not specified: .RS .TP .2i o .B \-dy .TP .2i o .B \-G .RE .TP .B \-g Instructs both the compiler and the linker to prepare the file or program for debugging. The tasks include: .sp .RS .TP .2i o Producing more detailed information, known as stabs, in the symbol table of the object files and the executable .TP .2i o Producing some "helper functions," which the Debugger can call to implement some of its features .TP .2i o Disabling the inline generation of functions; that is, using this option implies the .B \+d option .TP .2i o Disabling certain levels of optimization .RE .RS .sp Interactions: .sp If you use this option with .BR \-xO [\fIlevel\fR] (or its equivalent options, such as .BR \-O ), you will get limited debugging information. For more information, see the entry for .BR \-xO . .sp This option makes .B \-xildon the default incremental linker option in order to speed up the compile-edit-debug cycle. See the description for .BR \-xildon and .BR \-xildoff . This option invokes .B ild in place of .B ld unless any of the following are true: .TP .2i o The .B \-G option is present .TP .2i o The .B \-xildoff option is present .TP .2i o Any source files are named on the command line. .PP See also: .PP For more information, see the explanations for .B \-g0 and .BR \+d , as well as the .BR ld (1) man page. The .I Debugging a Program with .B dbx guide provides details about dbx stabs and "lazy stabs." .RE .TP .B \-g0 Instructs the compiler to prepare the file or program for debugging, but not to disable inlining. This option is the same as .BR \-g , except that .B \+d is disabled. .sp See also: .sp .B \+d .TP .B \-H On the standard error output .BR (stderr) , prints, one per line, the path name of each .B #include file contained in the current compilation. .TP .BI \-h lname Assigns the name .I lname to the generated shared dynamic library. .sp This is a loader option that is passed to .BR ld . In general, the name after .B \-h should be exactly the same as the one after .BR \-o . A space between the .B \-h and .I lname is optional. .sp The compile-time loader assigns the specified name to the shared dynamic library you are creating. It records the name in the library file as the intrinsic name of the library. If there is no .br .BI \-h lname option, then no intrinsic name is recorded in the library file. .sp Every executable file has a list of needed shared library files. When the runtime linker links the library into an executable file, the linker copies the intrinsic name from the library into that list of needed shared library files. If there is no intrinsic name of a shared library, then the linker copies the path of the shared library file instead. This command-line is an example: .sp .B % .B CC .B \-G .B \-o .B libx.so.1 .B \-h .B libx.so.1 .B a\&.o .B b\&.o .B c\&.o .TP .B \-help Same as .BR \-xhelp=flags . .TP .BI \-i Tells the linker, .BR ld (1), to ignore any .B LD_LIBRARY_PATH setting. .TP .BI \-I pathname Adds .I pathname to the list of directories that are searched for .B \#include files with relative file names \(em those that do not begin with a slash. The preprocessor searches for .B #include files in this order: .RS .TP 1. For includes in the form ./" bg 4209359 \fB#include "foo.h" \fR(where quotation marks are used), the directory containing the source .TP 2. For includes in the form .B \ (where angle brackets are used), the directory containing the source file is .I not searched .TP 3. In the directories named with .B \-I options, if any .TP 4. In the .B include directories for compiler-provided C++ header files, ANSI C header files, and special-purpose files .TP 5. In .B \/usr\/include .PP .B Note \(em The standard headers are treated differently. For more information, see "Standard Header Implementation" in the .IR "C++ User's Guide" . .PP Interactions: .PP If .B \-library=no%Cstd is specified, then the compiler-provided .B Cstd header files are not searched. .PP .B Note \(em If .BI \-pti path is not used, the compiler looks for template files in .BI \-I pathname. It is recommended that you use .BI \-I pathname instead of .BI \-pti path. .RE .TP .BI \-instances= a Controls the placement and linkage of template instances. .tp The following table shows the meanings of the values of \fIa\fR: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&extern Places all needed instances into the template repository and gives them global linkage. (If an instance in the repository is out of date, it will be reinstantiated.) .TP 1i .B \&explicit Places explicitly instantiated instances into the current object file and gives them global linkage. Does not generate any other needed instances. .TP 1i .B \&global Places all needed instances into the current object file and gives them global linkage. .TP 1i .B \&semiexplicit Places explicitly instantiated instances into the current object file and gives them global linkage. Places all instances needed by the explicit instances into the current object file and gives them static linkage. Does not generate any other needed instances. .TP 1i .B \&static Places all needed instances into the current object file and gives them static linkage. .RE .RS .PP Defaults: .PP If .B instances is not specified, .B \-instances=extern is assumed. .PP Warnings: .PP .B static and .B semiexplicit values may produce invalid results. See .I C++ User's Guide for more information. .RE .TP .B \-keeptmp Retains the temporary files that are created during compilation. Along with .BR \-verbose=diags , this option is useful for debugging. .TP .B \-KPIC .I (SPARC platform) Same as .BR \-xcode=pic32 . .sp .I (IA platform) Same as .BR \-Kpic . .TP .B \-Kpic .I (SPARC platform) Same as .BR \-xcode=pic13 . .sp .I (IA platform) Produces position-independent code. Use this option to compile source files when building a shared library. Each reference to a global datum is generated as a dereference of a pointer in the global offset table. Each function call is generated in pc-relative addressing mode through a procedure linkage table. .TP .BI \-L dir Adds .I dir to the list of directories to be searched for libraries. .sp This option is passed to .BR ld . The directory, .IR dir , is searched before compiler-provided directories. .TP .BI \-l lib Add library .BI lib lib .a or .BI lib lib .so to linker's list of search libraries. .sp This option is passed to .BR ld . Normal libraries have names such as .BI lib lib .a or .BI lib lib .so where the .B lib and .B .a or .B .so parts are required. You can specify the .I lib part with this option. Put as many libraries as you want on a single command line; they are searched in the order specified with .BI \-L dir. .sp Use this option after your object file names. .sp Warnings: .sp .\" bg 4230327 If you are building a multithreaded application or linking your application to a multithreaded library, you must compile and link your program with the .B -mt option instead of linking your application directly with .B -lthread. .sp If you are using POSIX threads, you must link with the options .B \-mt .BR \-lpthread . The .B -mt option is necessary because .B libC (compatibility mode) and .B libCrun (standard mode) need .B libthread for a multithreaded application. .sp See also: .sp .B \-mt .TP .B \-libmieee Use .BR \-xlibmieee . .TP .B \-libmil Use .BR \-xlibmil . .TP .BI \-library= l ./" bg 4209359 Incorporates specified CC-provided libraries into compilation and linking. .sp When the .B \-library option is used to specify a CC-provided library, the proper .B \-I paths are set during compilation and the proper .B \-L, \-Y .BR P , and .B \-R paths and .B \-l options are set during linking. .sp Values: .sp .I l is a comma-separated list of library specifiers. .sp The following table shows the meanings of the values for .I l: .sp For compatibility mode (\fB-compat\fR): .RS .TP 1i .B \&Value .B Meaning .TP 1i .RB \&[ no% ] rwtools7 [Do not] Use Tools.h++ v7 .TP 1i .RB \&[ no% ] rwtools7_dbg [Do not] Use debug-enabled Tools.h++ v7 .TP 1i .RB \&[ no% ] complex [Do not] Use .BR libcomplex , complex arithmetic .TP 1i .RB \&[ no% ] libC [Do not] Use .BR libC , C++ support .TP 1i .RB \&[ no% ] gc [Do not] Use .BR libgc , garbage collection .TP 1i .RB \&[ no% ] gc_dbg [Do not] Use debug-enabled .BR libgc , garbage collection .TP 1i .B \&%all The same as .br .B %none,rwtools7 complex gc,libC .TP 1i .B \&%none Use none of the above .P For standard mode (the default mode): .TP 1i .B \&Value .B Meaning .TP 1i .RB \&[ no% ] rwtools7 [Do not] Use Tools.h++ v7 .TP 1i .RB \&[ no% ] rwtools7_dbg [Do not] Use debug-enabled Tools.h++ v7 .TP 1i .RB \&[ no% ] iostream [Do not] Use .BR libiostream , the classic iostreams library. .TP 1i .RB \&[ no% ] Cstd [Do not] Use .BR libCstd , C++ standard library. [Do not] include the compiler-provided Cstd header files. .TP 1i .RB \&[ no% ] Crun [Do not] Use .BR libCrun , C++ runtime library .TP 1i .RB \&[ no% ] gc [Do not] Use .BR libgc , garbage collection. .TP 1i .RB \&[ no% ] gc_dbg [Do not] Use debug-enabled .BR libgc , garbage collection. .TP 1i .B \&%all The same as .B %none,rwtools7,gc,iostream,Cstd,Crun .TP 1i .B \&%none Do not use .BR librwtool , .BR librwtool_dbg , .BR iostream , .BR libCstd , .BR libgc , .BR libgc_dbg . .RE .RS .PP Defaults: .sp For compability mode (\fB-compat\fR), if .B \-library is not specified, .sp .B \-library=%none,libC .sp For standard mode (the default mode), if .B \-library is not specified, .sp .B \-library=%none,Cstd,Crun .sp Examples: .sp To link in standard mode (compat=5) without any C++ libraries (except libCrun), use: .sp .B CC \-library=%none .sp To include the Rogue Wave .B tools.h++ V7 and .B iostream libraries in standard mode, use: .sp .B CC \-library=rwtools7,iostream .sp Interactions: .sp Only one rwtool library can be used at a time. .sp Use of the \fB\-library\fR option ensures that the \fB\-l\fR options for the specified libraries are emitted in the right order. For example, the \fB\-l\fR options are passed to \fBld\fR in the order \fB\-lrwtool \-liostream\fR for both .B \-library=rwtools7,iostream and .BR \-library=iostream,rwtools7 . .sp Programs linking neither .B libC nor .B Crun will not be able to use all the features of the C++ language. .sp The specified libraries are linked after user-specified libraries, and before system support libraries. .sp Warnings: .sp The set of CC-provided libraries is not stable and might change from release to release. .sp See also: .sp .BR \-I , \-l , \-R , .BR \-staticlib , \-xnolib , .br .IR "C++ Migration Guide" , .br .IR "C++ Library Reference" , .br .IR "Tools.h++ User's Guide", .br .IR "Tools.h++ Class Library Reference", .br .I C++ Standard Reference Library .RE .TP .B \-migration Displays a pointer to the .I C++ Migration Guide, which contains information about incompatibilities between versions 4.0.1, 4.1, and 4.2 of the C++ compiler and the later versions; C++ compiler 5.0 and the Sun WorkShop 6 C++ compiler. .sp .B Note \(em This option might cease to exist in the next release. .TP .B \-misalign ./" bg 4230331 .I (SPARC platform) Permits misaligned data, which would otherwise generate an error, in memory. .sp This option informs the compiler that some data in your program is not properly aligned. Thus, very conservative loads and stores must be used for any data that might be misaligned, that is, one byte at a time. Using this option may cause significant degradation in runtime peformance. The amount of degradation is application dependent. .sp If you compile and link in separate steps and are using the .B \-misalign option, you must include the option in both steps. .sp If possible, do not link aligned and misaligned parts of the program. .sp Interactions: .RS .TP .2i o When using .B #pragma pack on a SPARC platform to pack denser than the type's default alignment, the .B \-misalign option must be specified for both the compilation and the linking of the application. .TP .2i o .\" bg 4158270 Misaligned data is handled by a trap mechanism that is provided by .BR ld (1) at run-time. If an optimization flag .RB ( \-x0[1|2|3|4|5] or an equivalent flag) is used with the .B \-misalign option, the additional instructions required for alignment of misaligned data are inserted into the resulting object file and will not generate runtime misalignment traps. .RE .TP .B \-mt Compile and link for multithreaded code. ./" bg 4230327 .sp This option: .RS .TP .2i o Passes .B \-D_REENTRANT to the preprocessor .TP .2i o Passes .B \-lthread ."\ bg 4209359 remove mention of C_mtstubs in the correct order to .B ld .TP .2i o Ensures that, for standard mode (the default mode), \fBlibthread\fR is linked before .B libCrun .TP .2i o Ensures that, for compability mode (\fB-compat\fR), .B libthread is linked before .B libC .RE .RS .sp The .B \-mt option is required if the application or libraries are multithreaded. .sp Warnings: .sp You must use this option, rather than .BR \-lthread . .sp If you are using POSIX threads, you must link with the options .B \-mt .BR \-lpthread . The .B \-mt option is necessary because .B libC (compatibility mode) and .B libCrun (standard mode) need .B libthread for a multithreaded application. .sp See also: .sp .B \-xnolib .RE .TP .B \-native Use .BR \-xtarget=native . .TP .B \-noex Use .BR \-features=no%except . .TP .B \-nofstore .I (IA platform) Disables forced precision of expression. .sp This option does not force the value of a floating-point expression or function to the type on the left side of an assignment but leaves the value in a register when that expression or function is assigned to a variable or when it is cast to a shorter floating-point type. .sp See also: .sp .B \-fstore .TP .B \-nolib Use .BR \-xnolib . .TP .B \-nolibmil Use .BR \-xnolibmil . .TP .B \-noqueue Disables license queueing. If no license is available, this option returns without queueing your request and without compiling. A nonzero status is returned for testing makefiles. .TP .B \-norunpath Does not build the path for shared libraries into the executable. .sp If an executable file uses shared libraries, then the compiler normally builds in a path that points the runtime linker to those shared libraries. To do so, the compiler passes the .B \-R option to .BR ld . The path depends on the directory where you have installed the compiler. .RS .PP This option is helpful if you have installed the compiler in some nonstandard location, and you ship an executable file to your customers, who need not work with that nonstandard location. .PP Interactions: .sp If you use any shared libraries under the compiler installed area (default location .BR \/opt\/SUNWspro\/lib ) and you also use .BR \-norunpath , then you should either use the .B \-R option at link time or set the environment variable .B LD_LIBRARY_PATH at run time to specify the location of the shared libraries. This will allow the runtime linker to find the shared libraries. .RE .TP .B \-O Same as .B \-xO2 .TP .BR \-O [ \fIlevel ] Use .BI \-xO level\fR. .TP .BI \-o " filename" Sets the name of the output file (with the suffix, .BR \&.o ) or the executable file to .IR filename . .sp .B Note \(em If the compiler must store template instances, it stores them in the template repository in the output file's directory. .\" Following removed because -ptr is obsolete 10/6/99 .\" unless you use .\" .B \-ptr .\" to specify a different repository location. .sp Warning: .sp .I filename must have the appropriate suffix for the type of file to be produced by the compilation (see .SM FILES\s0\fR). It cannot be the same file as the source file, since the .B CC driver does not overwrite the source file. .TP .B \+p ./" bg 4209359 Ignore non-standard preprocessor asserts. .sp Interactions: .sp If .B +p is used, the .BR sun , .BR unix , .BR sparc , and .B i386 macros are not defined. .TP .B \-P Only preprocesses source: does not compile. (Outputs a file with a .B \&.i suffix.) .sp This option does not include preprocessor-type line number information in the output. .TP .B \-p Prepares the object code to collect data for profiling with .BR prof . This option invokes a runtime recording mechanism that produces a .B mon.out file at normal termination. .RS .PP You can also perform this task with the Analyzer. Refer to the .BR analyzer (1) man page. .RE .TP .B \-pentium .I (IA platform) Use .BR \-xtarget=pentium . .TP .B \-pg Use .BR \-xpg . .TP .B \-PIC Use .BR \-KPIC . .TP .B \-pic Use .BR \-Kpic . .TP .B \-pta Use .B \-template=wholeclass. .TP .BI \-pti path Specifies an additional search directory for template source. .RS .PP This option is an alternative to the normal search path set by .BI \-I pathname . If the .BI \-pti path flag is used, the compiler looks for template definition files on this path and ignores the .BI \-I pathname flag. .sp Using the .BI \-I pathname flag instead of .BI \-pti path produces less confusion. .RE .TP .B \-pto Use \fB\-instances=static\fR. .TP .BI \-ptr path .\" obsolete per BV, VJ 10/9/99 This option is obsolete and is ignored by the compiler. .TP .B \-ptv Use \fB\-verbose=template\fR. ./".B \-Qcomponent \fIcomponent path\fP ./"Insert directory \fIpath\fP in search path for \fIcomponent\fP. ./".I path ./"is the path you want searched. ./".I component ./"is any component invoked by the \fBCC\fP driver, for example \fBccfe\fP, ./"or it can be all. ./"The compile stops with a fatal error if ./".I component ./"is not found in the specified path. .TP .B \-Qoption \fIphase optionlist\fP ./" bg 4209359 Passes .I optionlist to the compilation .IR phase . .sp To pass more than one option, specify them in order as a comma-separated list. .sp The following table shows the possible values for .IR phase : .RS .TP 1.8i .I "SPARC platforms" .I "IA platforms" .TP 1.8i .B ccfe .B ccfe .TP 1.8i .B iropt .B cg386 .TP 1.8i .B cg .B codegen .TP 1.8i .B CClink .B CClink .TP 1.8i .B ld .B ld .RE .RS .PP Examples: .PP In the following command, when .B ld is invoked by the .B CC driver, .B \-Qoption passes the option, .B \-i to .BR ld : .PP .B "% CC \-Qoption ld \-i test.c" .PP Warnings: .PP Be careful to avoid unintended effects. For example .sp .B \-Qoption ccfe \-features=bool,castop .sp is interpreted as .sp .B \-Qoption ccfe \-features=bool \-Qoption ccfe castop .sp The correct usage is .sp .B \-Qoption ccfe \-features=bool,\-features=castop .RE .TP .B \-qoption \fIphase option\fP Use .BR \-Qoption . .TP .B \-qp Same as .BR \-p . .TP .B \-Qproduce \fIsourcetype\fP Causes the .B CC driver to produce source code of the type .IR sourcetype . Source code types are shown in the following table: .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .RB \&.i Preprocessed C++ source from .B ccfe .TP 1.5i .RB \&.o Object file from .B cg, the code generator .TP 1.5i .RB \&.s Assembler source from .B cg .RE .TP .B \-qproduce \fIsourcetype\fP Use .BR \-Qproduce . .TP .BI \-R pathname ./" bg 4209359 Builds dynamic library search paths into the executable file. .sp Multiple instances of .BI \-R pathname are concatenated, with each .I pathname separated by a colon. Without this option specified, the compiler passes one of the following default search paths to the linker: .sp For .BR \-xarch=v9 , .BR \-xarch=v9a , or .BR \-xarch=v9b : .sp \ \ \ \ \fB/SUNWspro/lib/v9\fR .sp For any other \fB\-xarch\fR value: .sp \ \ \ \ \fB/SUNWspro/lib\fR .sp In a default installation, is .BR /opt . .sp If both the .B LD_RUN_PATH and the .B \-R option are specified, then the path from .B \-R is scanned, and the path from .B LD_RUN_PATH is ignored. .sp This option is passed to .BR ld . .TP .B \-readme Same as .BR -xhelp=readme . .TP .B \-S Compiles and generates only assembly code. This option causes the .B CC driver to compile the program and output an assembly source file, but not assemble the program. The assembly source file is named with a .B \&.s suffix. .TP .B \-s Strip the symbol table from the executable file. This option removes all symbol information from output executable files. This option is passed to .BR ld . .TP .B \-sb Use .BR \-xsb . .TP .B \-sbfast Use .BR \-xsbfast . .TP .BI \-staticlib= llst ./" bg 4209359 Indicates which of the C++ libraries that are specified by the .B \-library option (including its defaults) are to be linked statically. .sp Values: .sp .I llst is a comma-separated list that consists of one or more of the following values: .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .RB \&[ no% ] \fIlibrary\fR See .B \-library for the specific libraries. .TP .B \&%all Link all libraries specified in the .B \-library option statically. .TP .B \&%none Do not link statically any of the libraries that are implicitly or explicitly specified by the .B \-library option. .RE .RS .PP Defaults: .sp If .B \-staticlib is not specified, .B \-staticlib=%none is assumed. .sp Interactions: .sp The .B \-staticlib option only works for C++ libraries that are selected explicitly with the \fB\-library\fR option or that are selected implicitly by default. In compatibility mode .RB ( compat= [ 4 ]), .B libC is selected by default. In standard mode (the default mode), .BR Cstd " and " Crun are selected by default. .sp If a library specified with \fB\-staticlib\fR is not selected with the \fB\-library\fR option or its defaults, the .B \-staticlib option has no effect. .sp Examples: .sp The following command links .B libCrun statically because .B Crun is a default value for .BR \-library . .sp .B % CC \-staticlib=Crun test.cc <- correct .sp However, the following command does not link .B libgc because .B libgc is not linked unless explicitly specified with the .B -library option. .sp .B % CC -staticlib=gc test.cc <- incorrect .sp With the following command, the .B librwtool library is linked dynamically. Because .B librwtool is not a default library and is not selected using the .B \-library option, .B \-staticlib has no effect. .sp .B % CC -lrwtool -library=iostream \e .br .B -staticlib=rwtools7 <- incorrect .sp This command links the Tools.h++ library statically. .sp .B % CC -library=rwtools7,iostream \e .br .B -staticlib=rwtools7 <- correct .sp Warnings: .sp The set of allowable values for libraries is not stable and might change from release to release. ./" bg 4077936 .sp When using .BR \-xarch=v9 , .BR \-xarch=v9a , or .BR \-xarch=v9b , some C++ libraries are not available as static libraries. .RE .TP .BI \-temp= dir Defines the directory for temporary files. .sp This option sets .I dir as the directory for the temporary files generated during the compilation process. .sp See also: .sp .B \-keeptmp .TP .BI \-template= wlst Enables/disables various template options. .sp .I wlist is a comma-separated list of specifiers. The following table shows the meaning of the \fIwlst\fR values: .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .RB \&[ no% ] wholeclass Directs the compiler [not] to instantiate a whole template class, rather than only those functions that are used. This option creates a \fB.o\fR file for each member of a class. You must reference at least one member of the class; otherwise, the compiler does not instantiate any members for the class. .TP 1.5i .RB \&[ no% ] extdef Directs the compiler to [not] search for template definitions in separate source files. .PP Defaults: .PP .B \-template=no%wholeclass,extdef .RE .TP .B \-time Use .BR \-xtime . .TP .BI \-U name Deletes the command-line definition of the preprocessor symbol .I name. .sp This option affects only .B \-D options on the command line, including those implicitly placed there by the CC driver. It has no effect on other predefined macros or on macro definitions in source files. The .B \-U option is: .RS .TP .2i o Equivalent to putting .BR #undef on the first line of the first file seen by the compiler .TP .2i o The inverse of the .B \-D option .RE .RS .PP You can specify multiple .B \-U options on the command line. .sp Interactions: .sp All .B \-U options are processed after any .B \-D options that are present. .RE .TP .BI \-unroll= n Same as .BI \-xunroll= n. .sp .TP .B \-V Same as .B \-verbose=version. .TP .B \-v Same as .B \-verbose=diags. .TP .B \-vdelx This is an obsolete flag that will be removed in future releases. This flag is available only for compatibility mode (\fB-compat\fR). Don't use this flag unless you have bought some software from a third-party vendor and the vendor recommends using this flag. .sp For expressions using .BR delete[] , this option generates a call to the runtime library function .B \_vector_deletex_ instead of generating a call to .BR \ _vector_delete_ . .sp The function .B \_vector_delete_ takes two arguments: the pointer to be deleted and the size of each array element. .sp The function .B \_vector_deletex_ behaves the same as .B \ _vector_delete_ except that it takes an additional third argument: the address of the destructor for the class. This third argument is not used by the function but is provided to be used by third-party vendors. .sp Defaults: .sp When .B \-vdelx is not specified, the compiler generates a call to .B \_vector_delete_ for expressions using .BR delete[] . .TP .BI \-verbose= vlst Controls compiler verbosity. .sp .I vlst is a comma-separated list consisting of one or more of the following: .RS .TP 1i .B \&Value .B Meaning .TP 1i .RB \&[ no% ] template [Do not] Turn on the verbose mode, sometimes called the verify mode. The verbose mode displays each phase of instantiation as it occurs during compilation. .TP 1i .RB \&[ no% ] diags [Do not] Print the command line for each compilation pass. .TP 1i .RB \&[ no% ] version [Do not) Direct the CC driver to print the names and version numbers of the programs it invokes. .TP 1i .B %all Invokes all the above. .TP 1i .B %none Invokes none of the above. .RE .TP .B \+w Prints extra warnings where necessary. .sp Generates additional warnings about questionable constructs that are: .RS .TP o Nonportable .PP o Likely to be mistakes .PP o Inefficient .RE .RS .sp Defaults: .sp If .B +w is not specified, the compiler warns about constructs that are almost certainly problems. .RE .TP .B \+w2 Emits the same warnings as .B \-w as well as warnings about technical violations that are probably harmless, but that might reduce the maximum portability of your program. .sp Interactions: .sp Some Solaris and C++ standard header files result in warnings when compiled with .BR +w2 . .TP .B \-w Suppresses warning messages. .sp This option causes the compiler .I not to print warning messages. Some warnings, particularly warnings regarding serious anachronisms, cannot be suppressed. .TP .B \-xa Generates code for profiling. .sp If set at compiler time, the .B TCOVDIR environment variable specifies the directory where the coverage .RB ( .d ) files are located. If .B TCOVDIR is not set, then the coverage .RB ( .d ) files remain in the same directory as the .B source files. .sp Use this option only for backward compatibility with old coverage files. See .B \-xprofile=tcov for information on the new style of profiling, and the .B tcov (1) man page, and .I Profiling Tools for more details. .sp Interactions: .sp The .B \-xprofile=tcov and the .B \-a options are compatible in a single executable. That is, you can link a program that contains some files that have been compiled with .BR \-xprofile=tcov , and others that have been compiled with .BR \-a . You cannot compile a single file with both options. .sp .B \-xa is incompatible with .BR \-g . .sp Warnings: .sp If you compile and link in separate steps, and you compile with .BR \-xa , then be sure to link with .BR \-xa , or you might get unexpected results. .TP .B \-xar Creates archive libraries. .sp When building a C++ archive that uses templates, it is necessary in most cases to include in the archive those template functions which are instantiated in the template database. Using this option automatically adds those templates to the archive as needed. .sp Examples: .sp The following command archives the template functions contained in the library and object files. .sp .B "% CC \-xar \-o libmain.a a.o b.o c.o" .sp Warnings: .sp Do not add .B .o files from the template data base on the command line. .sp Do not use the .B ar command directly for building archives. Use .B CC \-xar to ensure that template instantiations are automatically included in the archive. .TP .BI \-xarch= isa Specifies the target architecture instruction set (ISA). .sp This option limits the code generated by the compiler to the instructions of the specified instruction set architecture by allowing only the specified set of instructions. This option does not guarantee use of any target-specific instructions. .sp Values: .sp .I For SPARC platforms: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&generic Compile for good performance on most systems. .sp This is the default. This option uses the best instruction set for good performance on most processors without major performance degradation on any of them. With each new release, the definition of "best" instruction set may be adjusted, if appropriate. .TP 1i .B \&generic64 Set the parameters for the best performance over most 64-bit platform architectures. .sp This option uses the best instruction set for good performance on most processors without major performance degradation on any of them. With each new release, the definition of "best" instruction set may be adjusted, if appropriate. .TP 1i .B \&native Compile for good performance on this system. .sp This is the default for the -fast option. The compiler chooses the appropriate setting for the current system processor it is running on. .TP 1i .B \&native64 Set the parameters for the best performance on the host environment (assumes a 64-bit architecture). .TP 1i .B \&v7 Compile for the SPARC-V7 ISA. .sp Enables the compiler to generate code for good performance on the V7 ISA. This is equivalent to using the best instruction set for good performance on the V8 ISA, but with- out integer .B mul and .B div instructions, and the .B fsmuld instruction. .sp Examples: SPARCstation 1, SPARCstation 2 .TP 1i .B \&v8a Compile for the V8a version of the SPARC-V8 ISA. .sp By definition, V8a means the V8 ISA, but without the fsmuld instruction. This option enables the compiler to generate code for good performance on the V8a ISA. .sp Example: Any system based on the microSPARC I chip architecture .TP 1i .B \&v8 Compile for the SPARC-V8 ISA. .sp Enables the compiler to generate code for good performance on the V8 architecture. .sp Example: SPARCstation 10 .TP 1i .B \&v8plus Compile for the V8plus version of the SPARC-V9 ISA. .sp By definition, V8plus means the V9 ISA, but limited to the 32-bit subset defined by the V8plus ISA specification, without the Visual Instruction Set (VIS), and without other implementation- specific ISA extensions. This option enables the compiler to generate code for good performance on the V8plus ISA. The resulting object code is in SPARC-V8+ ELF32 format and only executes in a Solaris UltraSPARC environment -- it does not run on a V7 or V8 processor. .sp Example: Any system based on the UltraSPARC chip architecture .TP 1i .B v8plusa Compile for the V8plusa version of the SPARC-V9 ISA. .sp By definition, V8plusa means the V8plus architecture, plus the Visual Instruction Set (VIS) version 1.0, and with UltraSPARC extensions. This option enables the compiler to generate code for good performance on the UltraSPARC architecture, but limited to the 32-bit subset defined by the V8plus specification. The resulting object code is in SPARC-V8+ ELF32 format and only executes in a Solaris UltraSPARC environment -- it does not run on a V7 or V8 processor. .sp Example: Any system based on the UltraSPARC chip architecture .TP 1i .B \&v8plusb Compile for the V8plusb version of the SPARC-V8plus ISA with UltraSPARC-III extensions. .sp Enables the compiler to generate object code for the UltraSPARC architecture, plus the Visual Instruction Set (VIS) version 2.0, and with UltraSPARC-III extensions. The resulting object code is in SPARC-V8+ ELF32 format and executes only in a Solaris UltraSPARC-III environment. Compiling with this option uses the best instruction set for good performance on the UltraSPARC-III architecture. .TP 1i .B \&v9 Compile for the SPARC-V9 ISA. .sp Enables the compiler to generate code for good performance on the V9 SPARC architecture. The resulting .o object files are in ELF64 format and can only be linked with other SPARC-V9 object files in the same format. The resulting executable can only be run on an UltraSPARC processor running a 64-bit enabled Solaris operating environment with the 64-bit kernel. .sp .B \-xarch=v9 is only available when compiling in a 64-bit enabled Solaris environment. .TP 1i .B \&v9a Compile for the SPARC-V9 ISA with UltraSPARC extensions. .sp Adds to the SPARC-V9 ISA the Visual Instruction Set (VIS) and extensions specific to UltraSPARC processors, and enables the compiler to generate code for good performance on the V9 SPARC architecture. The resulting .o object files are in ELF64 format and can only be linked with other SPARC-V9 object files in the same format. The resulting executable can only be run on an UltraSPARC processor running a 64-bit enabled Solaris operating environment with the 64-bit kernel. .sp .B \-xarch=v9a is only available when compiling in a 64-bit enabled Solaris operating environment. .TP 1i .B \&v9b Compile for the SPARC-V9 ISA with UltraSPARC-III extensions. .sp Adds UltraSPARC-III extensions and VIS version 2.0 to the V9a version of the SPARC-V9 ISA. Compiling with this option uses the best instruction set for good performance in a Solaris UltraSPARC-III environment. The resulting object code is in SPARC-V9 ELF64 format and can only be linked with other SPARC-V9 object files in the same format. The resulting executable can only be run on an UltraSPARC-III processor running a 64-bit enabled Solaris operating environment with the 64-bit kernel. .sp .B \-xarch=v9b is only available when compiling in a 64-bit enabled Solaris operating environment. .PP Also note the following: .TP .2i o SPARC instruction set architectures V7, V8, and V8a are all binary compatible. .TP .2i o Object binary files (\fB.o\fR) compiled with .B v8plus and .B v8plusa can be linked and can execute together, but only on a SPARC V8plusa compatible platform. .TP .2i o Object binary files (\fB.o\fR) compiled with .BR v8plus , .BR v8plusa , .RB "and " v8plusb can be linked and can execute together, but only on a SPARC V8plusb compatible platform. .TP .2i o .B \-xarch values .BR v9 , .BR v9a , .RB "and " v9b are only available on UltraSPARC 64-bit Solaris environments. .TP .2i o Object binary files (\fB.o\fR) compiled with .BR v9 " and " v9a can be linked and can execute together, but will run only on a SPARC V9a compatible platform. .TP .2i o Object binary files (\fB.o\fR) compiled with .BR v9 , .BR v9a , .RB "and " v9b can be linked and can execute together, but will run only on a SPARC V9b compatible platform. .PP For any particular choice, the generated executable may run much more slowly on earlier architectures. Also, although quad-precision .RB ( "REAL*16" " and " "long double" ) floating-point instructions are available in many of these instruction set architectures, the compiler does not use these instructions in the code it generates. .PP .I For IA platforms: .TP 1i .B \&Value .B Meaning .TP 1i .B \&generic Compile for good performance on most systems. .sp This is the default. This option uses the best instruction set for good performance on most proces- sors without major performance degradation on any of them. With each new release, the definition of "best" instruction set may be adjusted, if appropriate. .TP 1i .B \&386 generic and 386 are equivalent in this release. .TP 1i .B \&486 Compile for the Intel PentiumPro chip. .TP 1i .B \&pentium 486 and pentium are equivalent in this release. .TP 1i .B \&pentium_pro 486 and pentium_pro are equivalent in this release. .PP Defaults: .PP If .B \-xarch=isa is not specified, .B \-xarch=generic is assumed. .PP Interactions: .PP Although this option can be used alone, it is part of the expansion of the .B \-xtarget option and may be used to override the -xarch value that is set by a specific .B \-xtarget option. For example, .B \-xtarget=ultra2 expands to .B \-xarch=v8 \-xchip=ultra2 \-xcache=15/32/1:512/64/1. In the following command .B \-xarch=v8plusb overrides the .B \-xarch=v8 that is set by the expansion of .BR \-xtarget=ultra2 . .PP example% CC -xtarget=ultra2 -xarch=v8plusb ... .PP Use of .BR \-compat [ =4 ] with .BR \-xarch=v9 , .BR \-xarch=v9a , .RB "or" -xarch=v9b is not supported. .PP Warnings: .PP If this option is used with optimization, the appropriate choice can provide good performance of the executable on the specified architecture. An inappropriate choice, however, might result in serious degradation of performance or in in a binary program that is not executable on the intended target platform. .RE .TP .BI \-xcache= c .I (SPARC platforms) Defines the cache properties for use by the optimizer. .sp This option specifies the cache properties that the optimizer can use. It does not guarantee that any particular cache property is used. .sp Although this option can be used alone, it is part of the expansion of the .B \-xtarget option; its primary use is to override a value supplied by the .B \-xtarget option. .sp .RS .PP \fIc\fR must be one of the following: .RE .RS .TP o \fBgeneric\fR .PP o \fBnative\fR .PP o \fIs1/l1/a1\fR .PP o \fIs1/l1/a1:s2/l2/a2\fR .PP o \fIs1/l1/a1:s2/l2/a2:s3/l3/a3\fR .PP That is, \fB\-xcache={generic \fR| \fIs1/l1/a1[:s2/l2/a2[:s3/l3/a3]]}\fR, where the \fIsi/li/ai\fR are defined as follows: .RE .RS .TP .5i .I \&si The size of the data cache at level \fIi\fR, in kilobytes .TP .5i .I \&li The line size of the data cache at level \fIi\fR, in bytes .TP .5i .I \&ai The associativity of the data cache at level \fIi\fR .RE .RS .PP For example, .IB i =1 designates level 1 cache properties, .IR s1\/l1\/a1 . .sp The following table shows the .B \-xcache values: .RE .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .B \&generic Defines the cache properties for good performance on most SPARC processors. .TP 1.5i \& This is the default value which directs the compiler to use cache properties for good performance on most SPARC processors, without major performance degradation on any of them. .sp .TP 1.5i .B native Set the parameters for the best performance on the host environment (assumes a 32-bit architecture). e .TP 1.5i .I \&s1/l1/a1 \& Defines level 1 cache properties. .TP 1.5i .I \&s1/l1/a1:s2/l2/a2 \& Defines levels 1 and 2 cache properties. .TP 1.5i .I \&s1/l1/a1:s2/l2/a2:s3/l3/a3 \& Defines levels 1, 2, and 3 cache properties. .RE .RS .sp Example: .sp \fB\-xcache=16/32/4:1024/32/1\fR specifies the following: .RE .RS .TP 2.5i \&Level 1 cache has: \& Level 2 cache has: .TP 2.5i \&16K bytes \& 1024K bytes .TP 2.5i \&32-byte line size \& 32-byte line size .TP 2.5i \&4-way associativity \& Direct mapping .RE .TP .B \-xcg89 Same as .BR \-xtarget=ss2 . .\" ARC TCR #4 .TP .B \-xcg92 Same as .BR \-xtarget=ss1000 . .TP .BI \-xchip= c Specifies the target processor for use by the optimizer. .sp Although this option can be used alone, it is part of the expansion of the .B \-xtarget option; its primary use is to override a value supplied by the \fB\-xtarget\fR option. .sp This option specifies timing properties by specifying the target processor. .sp This option affects: .RS .TP .2i o The ordering of instructions, that is, scheduling .TP .2i o The way the compiler uses branches .TP .2i o The instructions to use in cases where semantically equivalent alternatives are available .RE .RS .sp The .B \-xchip values for SPARC platforms are: .sp .RE .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&generic Uses timing properties for good performance on most SPARC processors. .TP 1i \& This is the default value that directs the compiler to use the best timing properties for good performance on most SPARC processors, without major performance degradation on any of them. .TP 1i .B generic64 Set the parameters for the best performance over most 64-bit platform architectures. .TP 1i .B native Set the parameters for the best performance on the host environment (assumes a 32-bit architecture). .TP 1i .B native64 Set the parameters for the best performance on the host environment (assumes a 64-bit architecture). .TP 1i .B \&old Uses timing properties of pre-SuperSPARC TM processors. .TP 1i .B \&super Uses timing properties of the SuperSPARC chip. .TP 1i .B \&super2 Uses timing properties of the SuperSPARC II chip. .TP 1i .B \µ Uses timing properties of the MicroSPARC TM chip. .TP 1i .B \µ2 Uses timing properties of the MicroSPARC II chip. .TP 1i .B \&hyper Uses timing properties of the HyperSPARC TM chip. .TP 1i .B \&hyper2 Uses timing properties of the HyperSPARC II chip. .TP 1i .B \&powerup Uses timing properties of the Weitek PowerUp chip. .TP 1i .B \&ultra Uses timing properties of the UltraSPARC I chip. .TP 1i .B \&ultra2 Uses timing properties of the UltraSPARC II chip. .TP 1i .B \&ultra2i Uses timing properties of the UltraSPARC IIi chip. .TP 1i .B \&ultra3 Uses timing properties of the UltraSPARC III chip. .PP The .B \-xchip values for IA platforms are: .RE .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&generic Uses timing properties for good performance on most IA processors. .TP 1i .B \&386 Uses timing properties of the Intel 386 chip. .TP 1i .B \&486 Uses timing properties of the Intel 486 chip. .TP 1i .B \&pentium Uses timing properties of the Intel Pentium chip. .TP 1i .B \&pentium_pro Uses timing properties of the Intel Pentium Pro chip. .RE .TP .BI \-xcode= a .I (SPARC platform) Specifies code address space. .sp The following table shows the .B \-xcode values: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&abs32 Generate 32-bit absolute addresses. Code + data + bss size is limited to 2**32 bytes. .TP 1i .B \&abs44 Generate 44-bit absolute addresses. Code + data + bss size is limited to 2**44 bytes. Available only on 64-bit architectures: \fB\-xarch=\fR(\fBv9\fR|\fBv9a\fR|\fBv9b\fR). .TP 1i .B \&abs64 Generate 64-bit absolute addresses. Available only on 64-bit architectures: \fB\-xarch=\fR(\fBv9\fR|\fBv9a\fR|\fBv9b\fR). .TP 1i .B \&pic13 Generate position-independent code (small model). Equivalent to .B \-Kpic. Permits references to at most 2**11 unique external symbols on 32-bit architectures, 2**10 on 64-bit. .TP 1i .B \&pic32 Generate position-independent code (large model). Equivalent to .B \-KPIC. Permits references to at most 2**30 unique external symbols on 32-bit architectures, 2**29 on 64-bit. .PP Defaults: .sp The default is .B \-xcode=abs32 for SPARC V8 and V7 processors. .LP The default is .B \-xcode=abs64 for SPARC and UltraSPARC V9 processors (with .BR \-xarch= [\fBv9\fR|\fBv9a\fR|\fBv9b\fR]). .RE .TP .BR \-xcrossfile [=\fIn\fR] .RI ( "SPARC Platform" ) Enables optimization and inlining across source files. .sp Values: .sp .I n must be one of the following: .sp .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .B 0 Do not perform cross-file optimizations or cross-file inlining. .TP 1.5i .B 1 Perform optimization and inlining across source files. .RE .RS .sp Normally the scope of the compiler's analysis is limited to each separate file on the command line. For example, when the .B \-xO4 option is passed, automatic inlining is limited to subprograms defined and referenced within the same source file. With .BR \-xcrossfile " or " \-xcrossfile=1 , the compiler analyzes all the files named on the command line as if they had been concatenated into a single source file. .sp Defaults: .sp If .B \-xcrossfile is not specified, .B \-xcrossfile=0 is assumed and no cross-file optimizations or inlining are performed. .BR -xcrossfile " is the same as " \-xcrossfile=1 . .sp Interactions: .sp The .B \-xcrossfile option is effective only when it is used with .BR \-xO4 " or " \-xO5 . .sp Warnings: .sp The files produced from this compilation are interdependent due to possible inlining, and must be used as a unit when they are linked into a program. If any one routine is changed and the files recompiled, they must all be recompiled. As a result, using this option affects the construction of makefiles. .RE .TP .B \-xF With .BR \-features=no%except , enables reordering of functions by the linker. .sp If you compile with the .B \-xF option, and then run the Analyzer, you generate a map file that shows an optimized order for the functions. The subsequent link to build the executable file can be directed to use that map by using the linker .BI \-M mapfile option. It places each function from the executable file into a separate section. .sp Reordering the subprograms in memory is useful only when the application text page fault time is consuming a large percentage of the application time. Otherwise, reordering may not improve the overall performance of the application. .sp .B Note \(em When you use .BR \-xF , your program will not work unless you also specify .BR \-features=no%except . .sp The .BR analyzer (1), .BR debugger (1), and .BR ld (1) man pages provide further details on this option. .TP .B \-xhelp=flags Displays a brief description of each compiler flag. Also displays phone numbers to call to obtain additional information on Sun products and for technical support. .TP .B \-xhelp=readme Displays the contents of the .B README file. The .B README file is paged by the command specified by the environment variable, .BR PAGER . If .B PAGER is not set, the default paging command is .BR more . .TP .B \-xildoff Turns off the Incremental Linker. .sp This option is assumed if you do .I not use the .B \-g option. It is also assumed if you do use the .B \-G option, or name any source file on the command line. Override this default by using the .br .B \-xildon option. .TP .B \-xildon Turns on the Incremental Linker. This option is assumed if you use the .B \-g option and not .B \-G, and do not name any source file on the command line. Override this default by using the .B \-xildoff option. .\" .TP .B \-xlibmieee Causes .B libm to return IEEE 754 values for math routines in exceptional cases. The default behavior of .B libm is XPG-compliant. .TP .B \-xlibmil Inlines selected library routines for optimization. .sp There are inline templates for some of the .B libm library routines. This option selects those inline templates that produce the fastest executables for the floating-point option and platform currently being used. .sp 1 .B Note \(em This option does not affect C++ inline functions. .TP .B \-xlibmopt Uses a library of optimized math routines. .sp This option uses a math routine library optimized for performance, and usually generates faster code. The results may be slightly different from those produced by the normal math library. If so, they usually differ in the last bit. .sp The order on the command line for this library option is not significant. .sp Interactions: .sp This option is implied by the .B \-fast option. .sp See also: .sp .B \-fast .br .B \-xnolibmopt .TP .B \-xlic_lib=sunperf Links with the Sun-supplied performance libraries. .sp .TP .B \-xlicinfo Shows license server information. .sp This option returns the license-server name and the user ID for each user who has a license checked out. When you use this option, the compiler is .I not invoked, and a license is .I not checked out. .sp Generally, with this option, no compilation is done, and a license is not checked out. If a conflicting option is used, then the latest one on the command line takes precedence, and a warning is issued. .sp Examples: .sp Do not compile; report license information. .br .B "\ \ \ % CC \-c \-xlicinfo any.cc" .sp Compile; do not report license information. .br .B "\ \ \ % CC \-xlicinfo \-c any.cc" .TP .BR \-Xm Use .B \-features=iddollar. .TP .B \-xM Outputs makefile dependency information. .sp Examples: .sp The program .B foo.cc contains the following statement: .sp \fB \ \ \ \ #include "foo.h"\fR .sp When .B foo.cc is compiled with the .B \-xM option, the output includes the following line: .sp .B foo.o : foo.h .sp See also: .sp .B \-xM1 .sp See .BR make (1) for details about makefiles and dependencies. .TP .B \-xM1 Generates dependency information, but excludes .BR /usr/include . This is the same as .BR \-xM , except that this option does not report dependencies for the .B /usr/include header files. .TP .B \-xMerge .I (SPARC platform) Merges the data segment with the text segment. .sp The data in the object file is read-only, and is shared between processes, unless you link with .BR "ld \-N" . .TP .B \-xnolib .\" bg 4209359 Disables linking with default system libraries. .sp Normally, the C++ compiler links with several system libraries to support C++ programs. With this option, the .BI \-l lib options to link the default system support libraries are .I not passed to .BR ld . .sp Normally, the compiler links with the following system support libraries in the order shown: .\" bg 4209359 remove mention of C_mtstubs .RS .TP .2i o Compatibility mode (\fB-compat\fR): .sp .B \-lC \-lm \-lw \-lcx \-lc .TP .2i o Standard mode (default mode): .sp .B "\-lCstd \-lCrun \-lm \-lw \-lcx \-lc" .PP .B Note \(em If the \fB\-mt\fR option is specified, \fB\-lthread\fR is passed in front of \fB\-lm\fR. .PP You must pass all .B \-l options explicitly. .sp The order of the .B \-l options is significant. The .BR \-lm , \-lw , and .B \-lcx options must appear before .BR \-lc . .PP Examples: .PP For minimal compilation to meet the C application binary interface, that is, a C++ program with only C support required, use: .TP .2i o Standard mode: .sp .B example% CC \-xnolib test.cc \-lc .TP .2i o Compatibility mode: .sp .B example% CC \-compat \-xnolib test.cc \-lc .PP ./" bg 4077936 To link .B libm statically into a single-threaded application with the generic architecture instruction set, use: .TP .2i o Standard mode: .sp \fBexample% CC \-xnolib test.cc \-lCstd \-lCrun \\ .br \-Bstatic \-lm \-Bdynamic \-lw \-lcx \-lc\fR .TP .2i o Compatibility mode: .sp \fBexample% CC \-compat \-xnolib test.cc \-lC \\ .br \-Bstatic \-lm \-Bdynamic \-lw \-lcx \-lc\fR .PP Interactions: .PP If you specify .BR \-xnolib , you must manually link all required system support libraries in the given order. You must link the system support libraries last. .PP If .B \-xnolib is specified, .B -library is ignored. .PP Warnings: .PP Many C++ language features require the use of .B libC (compatibility mode) or .B libCrun (standard mode). .\" bg 4077936 .PP Many static system libraries, such as \fBlibm.a\fR and \fBlibc.a\fR, are not available when linking with .BR \-xarch=v9 , .BR \-xarch=v9a , or .B \-xarch=v9b in the Solaris 7 or Solaris 8 environment. .sp The set of system support libraries is not stable and might change from release to release. .sp .B \-lcx is not present in 64-bit compilation mode. .RE .TP .B \-xnolibmil Cancels .B \-xlibmil on the command line. .sp Use this option with .B \-fast to override linking with the optimized math library. .TP .B \-xnolibmopt Does .I not use the math routine library. .sp Interactions: .sp Use this option .I after the .B \-fast ./" bg 4209359 option on the command-line, as in: .br .B "% CC \-fast \-xnolibmopt ..." .\" 4309521 .HP .BI \-xO level Specifies optimization level. .sp If .BI \-xO level is not specified, only a very basic level of optimization, limited to local common subexpression elimination and dead code analysis, is performed. Compiling with an optimization level can improve a program's performance significantly. .sp Use of .B \-xO2 or .B \-fast (which implies .BR \-xO5 ) is recommended for most programs. .sp Generally, the higher the level of optimization with which a program is compiled, the better runtime performance obtained. However, higher optimization levels may result in increased compilation time and larger executable files. .sp There are five levels that you can use with .BR \-xO . The following sections describe how each level differs for SPARC platforms, for IA platforms, and for all platforms. .sp Values: .sp .I On SPARC Platforms: .sp If the optimizer runs out of memory, it attempts to proceed over again at a lower level of optimization, resuming compilation of subsequent routines at the original level. .sp .RS .PP .B \-xO1 \(em Does only the minimum amount of optimization (peephole), which is postpass assembly-level optimization. Do not use .B \-xO1 unless using .B \-xO2 or .B \-xO3 results in excessive compilation time, or if you are running out of swap space. .PP .B \-xO2 \(em Does basic local and global optimization, which includes: .TP .2i o Induction-variable elimination .TP .2i o Local and global common subexpression elimination .TP .2i o Algebraic simplification .TP .2i o Copy propagation .TP .2i o Constant propagation .TP .2i o Loop-invariant optimization .TP .2i o Register allocation .TP .2i o Basic block merging .TP .2i o Tail recursion elimination .TP .2i o Dead-code elimination .TP .2i o Tail-call elimination .TP .2i o Complex-expression expansion .PP This level does not optimize references or definitions for external or indirect variables. In general, this level results in minimum code size. .sp .BR \-O " and " \-xO2 " are equivalent." .PP .B \-xO3 \(em In addition to optimizations performed at the .B \-xO2 level, also optimizes references and definitions for external variables. This level does not trace the effects of pointer assignments. When compiling either device drivers that are not properly protected by .BR volatile , or programs that modify external variables from within signal handlers, use .BR \-xO2 . In general, .B \-xO3 results in increased code size. If you are running out of swap space, use .BR \-xO2 . .PP .B \-xO4 \(em Does automatic inlining of functions contained in the same file in addition to performing .B \-xO3 optimizations. This automatic inlining usually improves execution speed, but sometimes makes it worse. In general, this level results in increased code size. .PP .B \-xO5 \(em Does the highest level of optimization, suitable only for the small fraction of a program that uses the largest fraction of computer time. Uses optimization algorithms that take more compilation time or that do not have as high a certainty of improving execution time. Optimization at this level is more likely to improve performance if it is done with profile feedback. See \fB\-xprofile\fR. .sp .I On IA platforms: .PP .B \-xO1 \(em Preloads arguments from memory; causes cross jumping (tail merging), as well as the single pass of the default optimization. .PP .B \-xO2 \(em Schedules both high- and low-level instructions, and performs improved spill analysis, loop memory-reference elimination, register lifetime analysis, enhanced register allocation, global common subexpression elimination, and optimizations done by level 1. .PP .B \-xO3 \(em Performs loop strength reduction, inlining, as well as optimization done by level 2. .PP .B \-xO4 \(em Performs architecture-specific optimization, as well as optimization done by level 3. .PP .B \-xO5 \(em Generates the highest level of optimization. Uses optimization algorithms that take more compilation time or that do not have as high a certainty of improving execution time. .sp .I On SPARC and IA platforms: .sp In general, program execution speed depends on level of optimization. The higher the level of optimization, the faster the speed. .RE .RS .sp In a few cases, .B \-xO2 may perform better than the others, and .B \-xO3 may outperform .BR \-xO4 . Try compiling with each level to see if you have one of these rare cases. .PP If the optimizer runs out of memory, it tries to recover by retrying the current procedure at a lower level of optimization, and resumes subsequent procedures at the original level specified in the .B \-xO option. .PP If you optimize at .B \-xO3 or .B \-xO4 with very large procedures, such as thousands of lines of code in a single procedure, the optimizer might require an unreasonably large amount of memory. In such cases, performance of the machine might be degraded. .PP To prevent this degradation from taking place, use the .B limit command to limit the amount of virtual memory available to a single process; see the .BR csh (1) man page. For example, on a machine with 32 megabytes, the following command limits virtual memory to 16 megabytes. .sp .B % limit datasize 16M .sp This command causes the optimizer to recover if it reaches 16 megabytes of data space. .PP This limit cannot be greater than the total available swap space of the machine, and the limit should be small enough to permit normal use of the machine while a large compilation is in progress. .PP The best setting of data size depends on the degree of optimization requested, the amount of real memory, and virtual memory available. .PP o To find the actual swap space, type: .sp \ \ \ \ \ \ \ .B swap .B \-1 .PP o To find the actual real memory, type: .sp \ \ \ \ \ \ \ .B dmesg .B | .B grep mem .PP Interactions: .sp If you use .B \-g or .B \-g0 and the optimization level is .B \-xO3 or lower, the compiler provides best-effort symbolic information with almost full optimization. Tail-call optimization and back-end inlining are disabled. .sp If you use .B \-g or .B \-g0 and the optimization level is .B \-xO4 or higher, the compiler provides best-effort symbolic information with full optimization. .sp Debugging with .B \-g does not suppress .BI \-xO level\fR, but .BI \-xO level limits .B \-g in certain ways. For example, the .BI \-xO level options reduce the utility of debugging so that you cannot display variables from .BR dbx , but you can still use the .B dbx .B where command to get a symbolic traceback. For more information, see .I Debugging a Program With .BR dbx . .sp The .B \-xcrossfile option is effective only if it is used with .B \-xO4 or .BR \-xO5 . .PP See also: .sp .B \-fast, .BI \-xprofile= p, .B csh(1) man page .sp .I Analyzing Program Performance .I With Sun WorkShop discusses the effects of the different levels of optimization on the Analyzer's data. .RE .TP .B \-xpg Compiles for profiling with the .B gprof profiler. .sp The .B \-xpg option compiles self-profiling code to collect data for profiling with .BR gprof . This option invokes a runtime recording mechanism that produces a .B gmon.out file when the program normally terminates. .sp You can also perform this task with the Analyzer. Refer to the .BR analyzer (1) man page. .sp Warnings: .sp If you compile and link separately, and you compile with .BR \-xpg , then be sure to link with .BR \-xpg . .TP \fB\-xprefetch\fR[=\fIa\fR[,\fIa\fR]] .I (SPARC platform) Enable prefetch instructions on those architectures that support prefetch, such as UltraSPARC II .RB ( -xarch=v8plus ", " v8plusa ", " .BR v8plusb ", " v9 ", " .BR v9a ", or " v9b ) .sp .I a must be one of the following: .sp .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .B auto Enable automatic generation of prefetch instructions .TP 1.5i .B no%auto Disable automatic generation .TP 1.5i .B explicit Enable explicit prefetch macros .TP 1.5i .B no%explicit Disable explicit prefectch macros .TP 1.5i .B yes Same as .B \-xprefetch=auto,explicit .TP 1.5i .B no Same as .B \-xprefetch=no%auto,no%explicit .RE .RS .sp Defaults: .sp If .B \-xprefetch is not specified, .B \-xprefetch=no%auto,explicit is assumed .sp If only .B \-xprefetch is specified, .B \-xprefetch=auto,explicit is assumed. The default of .B no%auto is assumed unless explicitly overridden with the use of .B \-xprefetch without any arguments or with an argument of .BR auto " or " yes . For example, .B \-xprefetch=explicit is the same as .BR \-xprefetch=explicit,no%auto. The default of .B explicit is assumed unless explicitly overriden with .BR no%explicit " or " no . For example, .B \-xprefetch=auto is the same as .BR \-xprefetch=auto,explicit . .sp Interactions: .sp The .B sun_prefetch.h header file provides the macros for specifying explicit prefetch instructions. The prefetches will be approximately at the place in the executable that corresponds to where the macros appear. .sp To use the explicit prefetch instructions, you must be on the correct architecture, include .B sun_prefetch.h, and either exclude .B -xprefetch from the compiler command or use .BR \-xprefetch=explicit " or " \-xprefetch=yes . .sp If you call the macros and include the .B sun_prefetch.h header file, but pass .BR \-xprefetch=no%explicit " or " \-xprefetch=no , the explicit prefetches will not appear in your executable. With .BR \-xprefetch ", " \-xprefetch=auto ", and " .BR \-xprefetch=yes , the compiler is free to insert prefetch instructions into the code it generates. This may result in a performance improvement on architectures that support prefetch. .sp Warning: .sp Explicit prefetching should only be used under special circumstances that are supported by measurements. .RE .TP .BI "\-xprofile=" p Collects or optimizes with runtime profiling data. .IP .I p must be .BR collect [ :\fIname ], .BR use [ :\fIname ], or .BR tcov . .IP This option causes execution frequency data to be collected and saved during execution, then the data can be used in subsequent runs to improve performance. This option is only valid when a level of optimization is specified. .IP If compilation and linking are performed in separate steps, the same .B \-xprofile option must appear on the compile step as well as the link step. .RS .TP .5i Values: .sp .TP .5i .BR collect [ :\fIname ] Collects and saves execution frequency for later use by the optimizer with .br \f3\-xprofile=use\f1. The compiler generates code to measure statement execution frequency. .sp The \f2name\f1 is the name of the program that is being analyzed. This name is optional. If \f2name\f1 is not specified, \f3a.out\f1 is assumed to be the name of the executable. .sp At runtime, a program compiled with .br \f3\-xprofile=collect:\f2name\f1 will create the subdirectory \f2name\f3.profile\f1 to hold the runtime feedback information. Data is written to the file \f3feedback\f1 in this subdirectory. If you run the program several times, the execution frequency data accumulates in the \f3feedback\f1 file; that is, output from prior runs is not lost. .TP .5i .BR use [ :\fIname ] Uses execution frequency data to optimize strategically. The \f2name\f1 is the name of the executable that is being analyzed. This name is optional. If \f2name\f1 is not specified, a.out is assumed to be the name of the executable. .sp The program is optimized by using the execution frequency data previously generated and saved in the \f3feedback\f1 files written by a previous execution of the program compiled with .B \-xprofile=collect\f1. .sp The source files and other compiler options must be exactly the same as those used for the compilation that created the compiled program that generated the \f3feedback\f1 file. If compiled with .B \-xprofile=collect:\f2name\f1, the same program name \f2name\f1 must appear in the optimizing compilation: \f3\-xprofile=use:\f2name\f1. .TP .5i .B tcov Basic block coverage analysis using "new" style \f3tcov\f1. .sp The \f3\-xprofile=tcov\f1 option is the new style of basic block profiling for \f3tcov\f1. It has similar functionality to the \f3\-xa\f1 option, but correctly collects data for programs that have source code in header files or make use of C++ templates. See also .B \-xa for information on the old style of prfiling, the \f3tcov\f1(1) man page, and the \f2Performance Profiling Tools\f1 manual for more details. .sp Code instrumentation is performed similarly to that of the \f3\-xa\f1 option, but \f3.d\f1 files are no longer generated. Instead, a single file is generated, the name of which is based on the final executable. For example, if the program is run out of .B /foo/bar/myprog.profile\f1, the data file is stored in .B /foo/bar/myprog.profile/myprog.tcovd. .sp The \f3\-xprofile=tcov\f1 and the \f3\-xa\f1 options are compatible in a single executable, that is, you can link a program that contains some files that have been compiled with \f3\-xprofile=tcov\f1, and others with \f3\-xa\f1. You cannot compile a single file with both options. .sp When running \f3tcov\f1, you must pass it the \f3\-x\f1 option to make it use the new style of data. If not, \f3tcov\f1 uses the old \f3.d\f1 files, if any, by default for data, and produces unexpected output. .sp Unlike the \f3\-xa\f1 option, the \f3TCOVDIR\f1 environment variable has no effect at compile-time. However, its value is used at program runtime. See \f3tcov\f1(1) and the \f2Performance Profiling Tools\f1 manual for more details. .sp .\" bg 4065712 4228084 .B Note \(em The code coverage report produced by .B \-xprofile=tcov can be unreliable if there is inlining of functions due to use of .BR \-xO4 . .RE .TP .BI "\-xregs=" rlst .I (SPARC platform) Specify usage of registers in generated code. .sp .I rlst is a comma-separated list of one or more of the following: .\" bg 4261349 .RS .TP .9i .B appl Allow use of specific registers depending upon the specified .BR \-xarch " value." .sp .B "v8, v8a" \-\- Allow use of registers .BR g2 , .BR g3 , and .BR g4 . .sp .B "v8plus, v8plusa, v8plusb" \-\- Allow use of registers .BR g2 , .BR g3 , and .BR g4 . .sp .B "v9, v9a, v9b" \-\- Allow use of registers .BR g2 " and" .BR g3 . .sp See .B \-xarch for more information about the meaning of each .B \-xarch value. .TP .B no%appl Do not use .B appl registers. .TP .B float Allow using floating-point registers as specified in the SPARC ABI. .TP .B no%float Do not use floating-point registers. .RE .RS .PP Defaults: .PP If .B \-xregs is not specified, then .BR "\-xregs=appl,float" " is assumed." .RE .TP .BR \-xs Allows debugging by .B dbx without object ( .BR .o ) files. .sp This option disables Auto-Read for .BR dbx . Use this option when you cannot keep the .B .o files around. This option passes .B \-s to the assembler. .sp "No Auto-Read" is the older way of loading symbol tables. It places all symbol tables for .B dbx in the executable file. The linker links more slowly, and .B dbx initializes more slowly. .sp Auto-Read is the newer and default way of loading symbol tables. With Auto-Read, the information is distributed in the .B .o files, so that .B dbx loads the symbol table information only when it is needed. Hence, the linker links faster, and dbx initializes faster. .sp With .BR \-xs , if you move executables to another directory, you do not have to move the object files in order to use .BR dbx . .sp Without .BR \-xs , if you move the executables, then you must move both the source files and the object ( .B .o ) files in order to use .BR dbx . .TP .B \-xsafe=mem .I (SPARC platform) Allows no memory-based traps to occur. .sp This option grants permission to use the speculative load instruction on V9 machines. It is only effective when used with .B \-x05 optimization, and .br .BR \-xarch=v8plus ", " v8plusa , .BR v8plusb , .BR v9 , .BR v9a ", or " v9b is specified. .sp Warnings: .sp You should only use this option if you can safely assert that no memory-based traps occur in your program. For most programs, this assertion is appropriate and can be made safely. For a program that explicitly forces memory-based traps to handle exceptional conditions, this assertion is not safe. .TP .B \-xsb Produces information for the WorkShop source code browser. .sp This option causes the .B CC driver to generate extra symbol table information in the .B SunWS_cache subdirectory for the source browser. .sp See also: .sp .B \-xsbfast .TP .B \-xsbfast Produces only source browser information, no compilation. .sp This option runs only the .B ccfe phase to generate extra symbol table information in the .B SunWS_cache subdirectory for the source browser. No object file is generated. .TP .B \-xspace .I (SPARC platform) Does not allow optimizations that increase code size. .TP .BI \-xtarget= t Specifies the target system for instruction set and optimization. .sp This option is a macro. Each specific value for .B \-xtarget expands into a specific set of values for the .B \-xarch, \-xchip, and \fB\-xcache\fR options. Refer to the entry for .B \-xtarget in the .I C++ User's Guide for the list of expanded values. .sp The \fB\-xtarget\fR option permits a quick and easy specification of the .B \-xarch, \-xchip, and \fB\-xcache\fR combinations that occur on real systems. The only meaning of \fB\-xtarget\fR is in its expansion. .sp \f3\-xtarget=native\f1 is equivalent to \f3\-xarch=native\f1, \f3\-xchip=native\f1, \f3\-xcache=native\f1. .sp \f3\-xtarget=native64\f1 is equivalent to \f3\-xarch=native64\f1, \f3\-xchip=native64\f1, \f3\-xcache=native\f1 . .sp \f3\-xtarget=generic\f1 is equivalent to \f3\-xarch=generic\f1, \f3\-xchip=generic\f1, \f3\-xcache=generic\f1. .sp \f3\-xtarget=generic64\f1 is equivalent to \f3\-xarch=generic64\f1, \f3\-xchip=generic64\f1, \f3\-xcache=generi c\f1. .sp Values: .sp .I On SPARC platforms: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&native Gets the best performance on the host system. .TP 1i \& The compiler generates code for the best performance on the host system. It determines the available architecture, chip, and cache properties of the machine on which the compiler is running. .TP 1i .B native64 Set the parameters for the best performance on the host environment (assumes a 64-bit architecture). .TP 1i .B \&generic Gets the best performance for generic architecture, chip and cache. .TP 1i \& The compiler expands \fB\-xtarget=generic\fR to: .TP 1.2i \& .B \-xarch=generic \-xchip=generic .br .B \ \ \ \-xcache=generic .TP 1i \& This is the default value. .TP 1i .B generic64 Set the parameters for the best performance over most 64-bit platform architectu res. .TP 1i .I \&platform-name Gets the best performance for the specified platform. .TP 1i \& Valid \fIplatform-name\fR values are: .sp sun4/15, sun4/20, sun4/25, sun4/30, sun4/40, sun4/50, sun4/60, sun4/65, sun4/75, sun4/110, sun4/150, sun4/260, sun4/280, sun4/330, sun4/370, sun4/390, sun4/470, sun4/490, sun4/630, sun4/670, sun4/690, sselc, ssipc, ssipx, sslc, sslt, sslx, sslx2, ssslc, ss1, ss1plus, ss2, ss2p, ss4, ss4/85, ss4/110, ss5, ss5/85, ss5/110, ssvyger, ss10, ss10/hs11, ss10/hs12, ss10/hs14, ss10/20, ss10/hs21, ss10/hs22, ss10/30, ss10/40, ss10/41, ss10/50, ss10/51, ss10/61, ss10/71, ss10/402, ss10/412, ss10/512, ss10/514, ss10/612, ss10/712, ss20, ss20/hs11, ss20/hs12, ss20/hs14, ss20/hs21, ss20/hs22, ss20/50, ss20/51, ss20/61, ss20/71, ss20/151, ss20/152, ss20/502, ss20/512, ss20/514, ss20/612, ss20/712, ss600/41, ss600/51, ss600/61, ss600/120, ss600/140, ss600/412, ss600/512, ss600/514, ss600/612, ss1000, sc2000, cs6400, solb5, solb6, ultra, ultra2, ultra2i, ultra1/140, ultra1/170, ultra1/200, ultra2/1170, ultra2/1200, ultra2/1300, ultra2/2170, ultra2/2200, ultra2/2300, ultra3, entr2, entr2/1170, entr2/2170, entr2/1200, entr2/2200, entr150, entr3000, entr4000, entr5000, entr6000. .sp For more information about platform names, see the entry for .B \-xtarget in the .I C++ User's Guide .RE .RS .PP .I On IA platforms: .RS .TP .2i o .B native or .B generic .TP .2i o .B 386 (Directs the compiler to generate code for the best performance on the Intel 80386 microprocessor.) .TP .2i o .B 486 (Directs the compiler to generate code for the best performance on the Intel 80486 microprocessor.) .TP .2i o .B pentium (Directs (Directs the compiler to generate code for the best performance on the Pentium or Pentium Pro microprocessor.) .RE .PP Interactions: .PP Compiling for 64-bit Solaris 7 or Solaris 8 software on SPARC or UltraSPARC V9 is indicated by the .BR \-xarch=v9 , .BR \-xarch=v9a , or .B \-xarch=v9b flag. Setting .BR \-xtarget=ultra , .BR ultra2 , or .B ultra3 is not necessary or sufficient. If .B \-xtarget is specified, then .BR \-xarch=v9 , .BR \-xarch=v9a , or .B \-xarch=v9b must appear AFTER .BR \-xtarget , as in: .TP 1i .B \ \ \ \-xtarget=ultra2 ... \-xarch=v9 .LP Otherwise the .B \-xtarget setting will revert the .B \-xarch value to .BR v8. .RE .TP .B \-xtime Causes the .B CC driver to report execution times for the various compilation passes. .TP .BI \-xunroll= n Enables unrolling of loops where possible. .sp This option specifies whether or not the compiler optimizes (unrolls) loops. .sp When .I n is 1, it is a suggestion to the compiler not to unroll loops. .sp When .I n is an integer greater than 1, \fB\-xunroll=\fIn\fR causes the compiler to unroll loops .I n times. .\" -xvector added per Vijay and removed per LC 11/19/99 and added per V 3/00 .TP .BR \-xvector [ =\fR(\fByes\fR|\fBno )] .I (SPARC platform) Enable automatic calls to the SPARC vector library functions. .sp Defaults: .sp The compiler defaults to .BR \-xvector=no . Specifying .B \-xvector by itself defaults to .BR \-xvector=yes . .sp Warnings: .sp If you compile and link in separate steps, you must use the same .B \-xvector settings in each step. .TP .B \-xwe Converts all warnings to errors by returning non-zero exit status. .TP .BI \-z " arg" Link editor option. .sp For more information see the .BR ld (1) man page and the Solaris .I Linker and Libraries Guide. .TP .B \-ztext Forces a fatal error if any relocations remain against non-writable, allocatable sections. This option is passed to the linker. .\" .\" .SH NOTES The C++ compiler includes the static libraries .B libC.a and .BR libCrun.a . However, the corresponding bundled shared libraries, .B libC.so.5 and .BR libCrun.so.1 , are out of sync with the Sun WorkShop C++ compiler 5.0 and the Sun WorkShop 6 C++ compiler on versions 2.6, 7, and 8 of the Solaris operating enviroment. For the compiler to work correctly with the shared library on Solaris OS versions 2.6, 7, and 8 you must install the appropriate OS patch; see the README. .sp Type .B CC \-xhelp=readme for details. .PP .SH FILES .P .PD 0 .TP 30 .B file.a Static library .sp .2 .TP .B file.C Input file .sp .2 .TP .B file.cc Input file .sp .2 .TP .B file.cpp Input file .sp .2 .TP .B file.cxx Input file .sp .2 .TP .B file.o Object file .sp .2 .TP .B file.so Dynamic (shared) library .sp .2 .TP .B a.out Linked output .sp .2 .SH SEE ALSO .BR analyzer (1), .BR as (1), .BR c++filt (1), .BR cc (1), .BR csh (1), .BR dbx (1), .BR debugger (1), .BR gprof (1), .BR ild (1), .BR ld (1), .BR more (1), .BR nm (1) , .BR prof (1), .BR tcov (1) .br .sp .I C++ User's Guide, .br .I C++ Programming Guide, .br .I C++ Migration Guide, .br .I C++ Library Reference .br .I The C++ Programming Language, Third Edition, Bjarne Stroustrup, Addison-Wesley 1997 .br .I The C Programming Language, B. W. Kernighan and D. M. Ritchie, Prentice-Hall 1988 .br .I Solaris Linker and Libraries Guide .br International Standard (ISO/IEC FDIS 14882), .I Programming Languages \(em C++ .sp .\".SH DIAGNOSTICS .\"The diagnostics produced by .\".I CC .\"itself are intended to be .\"self-explanatory. .\"Occasional messages may be produced by the assembler or loader. .\"No messages should be produced by .\".IR cc (1) . .\"SH BUGS .\"PP .\"Some ``used before set'' warnings are wrong. .\".SH NOTES .\"You can use shell variables to tell the C++ translator .\"script .\".B CC .\"that various passes are located in unusual places .\"or have unusual names. For example, if you have your .\"own version of the C compiler called .\".B myC , .\"you can set and export the shell variable .\".L ccC .\"with a line like this: .\".PP .\" \fIccC+/usr/bin/myC;export ccC\fP .\".PP .\"Note that you have to export the variable. If you .\"are using the c-shell: .\".PP .\" \fIsetenv ccC /usr/bin/myC\fP .\".PP .\"The variables used by .\".B CC .\"are: .\".PP .\".\"==========begin troff version of table========== .\".if n .ig IG .\".TS .\"box tab (;) ; .\"c | c | c .\"l | lw(20) | l . .\"Variable; Default; Function .\"_ .\"\fBCCROOTDIR;/usr/CC/`arch`;\fRC++ for this architecture .\"\fBCCLIBDIR;$CCROOTDIR;\fRC++ for this architecture .\"\fBI;$CCROOTDIR/incl;\fRDirectory for include files .\"\fBLIBRARY;$CCROOTDIR/libC.a;\fRStandard C++ library-full path .\"\fBcfrontC;cfront;\fRThe translator itself .\"\fBLIB_ID;C;T{ .\"\fRIf LIBRARY not set, .\"used to build name .\"of C++ library by .\"replacing \fIx\fR in .\"\fLlib\fIx\fP.a\fR .\"T} .\"\fBccC;cc;\fRC compiler .\"\fBcppC;/lib/cpp;\fRC preprocessor .\"\fBSYS;bsd4.3;\fRSystem type .\"\fBCPLUS;-Dc_plusplus=1.3;\fR1.2 \f7cpp\fR C++ constant for .\";;backward compatibility .\"\fBcPLUS;-D_\|_cplusplus=1;\fR2.0 \f7cpp\fR C++ constant for .\";;ANSI C conformance .\"\fBcplusfiltC;$CCROOTDIR/c++filt;T{ .\"\fRC++ link error message filter .\"T} .\".TE .\".IG .\".\"==========end troff version of table========== .\".\"==========begin nroff version of table========== .\".if t .ig IG .\".TS .\"tab (;) ; .\"c c c .\"l lw(20) l . .\"Variable; Default; Function .\" .\"\fBCCROOTDIR;/usr/CC/`arch`;\fRC++ for this architecture .\"\fBCCLIBDIR;$CCROOTDIR;\fRC++ for this architecture .\"\fBI;$CCROOTDIR/incl;\fRDirectory for include files .\"\fBLIBRARY;$CCROOTDIR/libC.a;\fRStandard C++ library-full path .\"\fBcfrontC;cfront;\fRThe translator itself .\"\fBLIB_ID;C;T{ .\"\fRIf LIBRARY not set, .\"used to build name .\"of C++ library by .\"replacing \fIx\fR in .\"\fLlib\fIx\fP.a\fR .\"T} .\"\fBccC;cc;\fRC compiler .\"\fBcppC;/lib/cpp;\fRC preprocessor .\"\fBSYS;bsd4.3;\fRSystem type .\"\fBCPLUS;-Dc_plusplus=1.3;\fR1.2 \f7cpp\fR C++ constant for .\";;backward compatibility .\"\fBcPLUS;-D_\|_cplusplus=1;\fR2.0 \f7cpp\fR C++ constant for .\";;ANSI C conformance .\"\fBcplusfiltC;$CCROOTDIR/c++filt;T{ .\"\fRC++ link error message filter .\"T} .\".TE .\".IG .\".\"===========end nroff version of table========== .\".PP .\"These variables are maintained by .\".BR CC . .\"The only variable you can change is .\".BR $CCROOTDIR . .\"If C++ is installed in a different path than .\".BR /usr/CC/'arch' , .\"you can indicate this to .\".BR CC .\"by: .\".PP .\" \fIsetenv CCROOTDIR /myCC\fP