| Option | Meaning |
|---|---|
| -# | Turns on verbose modes, showing how command options expand. Shows each component as it is invoked. |
| -### | Shows each component as it would be invoked, but does not actually execute it. Also shows how command options would expand. |
| -A | Associate a predicate with the specified tokens as if by a #assert preprocessing directive. |
| -B | Specifies whether a library binding for linking is symbolic, dynamic (shared), or static (nonshared). |
| -C | Prevents the C preprocessor from removing comments, other than those on preprocessing directive lines. |
| -c | Suppresses linking with the linker and, instead, produces a .o file for each source file. |
| -Dname | Defines a macro symbol name to the preprocessor. |
| -d | Allows or disallows dynamic libraries for the entire executable. |
| -dalign | Use -xmemalign instead. |
| -E | Directs the CC driver to only preprocess the C++ source files, and to send the result to stdout (standard output). |
| -errfmt | Adds the string "error:" to the beginning of error messages so they are more easily distinguishable from warning messages. |
| -errhdr | Limits warnings from header files to a group of header files as indicated by the option's flags. |
| -erroff | Suppresses compiler warning messages but has no effect on error messages. |
| -errshort | Controls how much detail is in the error message produced by the compiler when it discovers a type mismatch. |
| -errtags | Displays the message tag for each warning message of the compiler front-end that can be suppressed with the -erroffoption or made a fatal error with the -errwarn option. |
| -errwarn | Causes the compiler to exit with a failure status for the given warning messages. |
| -fast | This option is a macro that you can effectively use as a starting point for tuning an executable for maximum run-time performance. |
| -fd | Reports K&R style function declarations and definitions. |
| -features | Controls the compiler's treatment of extern inline functions to support code compiled by versions 5.5, or older, of the C and C++ compilers. |
| -flags | Prints a one-line summary of available options. |
| -flteval | Controls how floating point expressions are evaluated. |
| -fma | Enables automatic generation of floating-point, fused, multiply-add instructions. |
| -fnonstd | This option is a macro for -fns and -ftrap=common. |
| -fns | Enables the nonstandard floating-point mode on SPARC and selects SSE flush-to-zero mode and, where available, denormals-are-zero mode for x86. |
| -fprecision | Sets floating-point rounding precision mode. |
| -fround | Sets the IEEE rounding mode in effect at startup. |
| -fsimple | Selects floating-point optimization preferences. |
| -fsingle | (-Xt and -Xs modes only) Causes the compiler to evaluate float expressions as single precision, rather than double precision. |
| -fstore | Forces precision of floating-point expressions. |
| -ftrap | Sets the IEEE trapping mode in effect at startup but does not install a SIGFPE handler. |
| -G | Build a dynamic shared library instead of an executable file. |
| -g | Instructs both the compiler and the linker to prepare the file or program for debugging. |
| -H | Prints the path name of each include file contained in the current compilation to the standard error output. |
| -h | Assign a name to the generated shared dynamic library. |
| -I | Adds a pathname to the list of directories that are searched for #include files with relative file paths. |
| -I- | Change the include-file search rules. |
| -i | Tells the linker, ld(1), to ignore any LD_LIBRARY_PATH setting. |
| -KPIC | Use -xcode=pic32 instead. |
| -Kpic | Use -xcode=pic13 instead. |
| -keeptmp | Retains the temporary files that are created during compilation. |
| -L | Adds a path to the library search paths. |
| -l | Adds dynamic or static library to linker's list of search libraries. |
| -m32|64 | Specifies the memory model for the compiled binary object. |
| -mc | Removes duplicate strings from the .comment section of the object file. |
| -misalign | This option is deprecated in the C compiler so use the -xmemalign=1i option instead. However, this option is allowed in the C++ compiler where it permits misaligned data in memory which would otherwise generate an error. |
| -misalign2 | Use -xmemalign=2i instead. |
| -mr | Removes all strings from the .comment section of the object file and, if a substitute string is supplied, places the substitute in that section. |
| -mt | Indicates compilation and linking for multithreaded code. |
| -native | Use -xtarget=native instead. |
| -nofstore | Disables forced precision of expression. |
| -O | Macro for -x03. Note: use the capital letter o for this option, not zero. |
| -o | Sets the name of the output file (with the suffix .o) or the executable file. |
| -P | Only preprocesses source; does not compile. |
| -p | Use -xpg instead. |
| -Q | Emits identification information to the output file. |
| -qp | Same as -p. |
| -R | Builds dynamic library search paths into the executable file. |
| -S | Compiles and generates only assembly code. |
| -s | Strips the symbol table from the executable file. |
| -Uname | Removes any initial definition of the named macro symbol that was created by -D on the same command line, including those implicitly placed there by the command-line driver. |
| -V | Causes each invoked tool to print its version information on the standard error output. |
| -v | Performs more and stricter semantic checks, and enables certain lint-like checks on the named C files. |
| -W | Passes arguments to specific components of the compilation system. |
| -w | Suppresses warning messages. |
| -X | Specifies the degree of conformance to the ISO C standard. |
| -x386 | Use -xchip=generic instead. |
| -x486 | Use -xchip=generic instead. |
| -xa | Generates code for profiling. |
| -xalias_level | Allows the compiler to perform type-based alias-analysis. |
| -xarch | Specifies the target architecture instruction set (ISA). |
| -xautopar | Turns on automatic parallelization for multiple processors. |
| -xbinopt | Instructs the compiler to prepare the binary for later optimizations, transformations and analysis (see binopt(1)). |
| -xbuiltin | Enables or disables better optimization of standard library calls. |
| -xCC | The compiler accepts C++-style comments when you specify both -xc99=none and -xCC. |
| -xc99 | Controls compiler recognition of the implemented features from the C99 standard (ISO/IEC 9899:1999, Programming Language - C). |
| -xcache | Defines the cache properties for use by the optimizer. |
| -xcg | Do not use this option, the current Solaris operating systems no longer support the SPARC V7 architecture. |
| -xchar | Eases the migration of code from systems where the char type is defined as unsigned. |
| -xchar_byte_order | Produces an integer constant by placing the characters of a multi-character character-constant in the specified byte order. |
| -xcheck | Enables a runtime check for stack overflow. |
| -xchip | Specifies the target processor for use by the optimizer. |
| -xcode | Specifies code address space. |
| -xcrossfile | Enables optimization and inlining across source files. |
| -xcsi | Allows the C compiler to accept source code written in locales that do not conform to the ISO C source character code requirements. |
| -xdebugformat | Identifies the format of debugger information |
| -xdepend | Analyzes loops for inter-iteration data dependencies and performs loop restructuring. |
| -xdryrun | Shows each component as it would be invoked, but does not actually execute it. Also shows how command options would expand. |
| -xe | Checks only for syntax and semantic errors. |
| -xexplicitpar | Parallelizes the loops that are specified. |
| -xF | Enables the optimal reordering of functions and variables by the linker. |
| -xhelp | Displays online help for compiler options or latest readme. |
| -xhwcprof | Enables compiler support for hardware counter-based profiling. |
| -xinline | Specifies which user-written routines can be inlined by the optimizer at -xO3 or higher. |
| -xinstrument | Compiles and instruments your program for analysis by the Thread Analyzer. |
| -xipo | Performs interprocedural optimizations. |
| -xipo_archive | Enables the compiler to optimize object files that are passed to the linker with object files that were compiled with -xipo and that reside in the archive library (.a) before producing an executable. |
| -xjobs | Sets compilation for multiple processors. |
| -xldscope | Changes the default linker scoping for the definition of extern symbols. |
| -xlibmieee | Causes libm to return IEEE 754 values for math routines in exceptional cases. |
| -xlibmil | Inlines selected library routines for optimization. |
| -xlibmopt | Uses a library of optimized math routines. |
| -xlic_lib | Use -library=sunperf instead. |
| -xlicinfo | Obsolete: This option is silently ignored by the compiler. |
| -xlinkopt | Performs link-time optimizations on relocatable object files. |
| -xloopinfo | Shows which loops are parallelized and which are not. |
| -xM1 | Same as -xM, except that this option does not report dependencies for the /usr/include header files and it does not report dependencies for compiler-supplied header files. |
| -xM | Runs only the preprocessor on the named C++ programs, requesting that it generate makefile dependencies and send the result to the standard outputx |
| -xMD | Generates makefile dependencies, including compilation. |
| -xMF | Specifies a filename for makefile-dependency output. |
| -xMMD | Generates makefile dependencies excluding system headers and including compilation. |
| -xMerge | Merges the data segment of the object files with the text segment. |
| -xmaxopt | Limits the level of the opt pragma. |
| -xmemalign | Specifies the maximum assumed memory alignment and the behavior of misaligned data accesses. |
| -xmodel | Enables the compiler to modify the form of 64-bit objects for the Solaris x86 platforms and should only be specified for the compilation of such objects. |
| -xnativeconnect | Includes interface information inside object file and subsequent shared libraries so that the shared library can interface with Java. |
| -xnolib | Disables linking with default system libraries. |
| -xnolibmil | Cancels -xlibmil on the command line. |
| -xnolibmopt | Does not use the math routine library by turning off any previously specified -xlibmopt options. |
| -xnorunpath | Prevents inclusion of a run-time search-path for shared libraries in the executable. |
| -xO | Specifies optimization level. |
| -xopenmp | Enable explicit parallelization with OpenMP directives. |
| -xP | Performs only syntax and semantic checking on the source file in order to print prototypes for all K&R C functions. |
| -xpagesize | Set the preferred page size for the stack and the heap. |
| -xpagesize_heap | Set the preferred page size for the heap. |
| -xpagesize_stack | Set the preferred page size for the stack. |
| -xparallel | Parallelizes loops both automatically (by the compiler) and explicitly (as specified by the programmer). |
| -xpch | Activates the precompiled-header feature. |
| -xpchstop | Identifies the last include file to be considered in creating a precompiled-header file. |
| -xpentium | Generates code for the Pentium processor. |
| -xpg | Compiles for profiling with the gprof profiler. |
| -xprefetch | Enables and adjusts prefetch instructions on those architectures that support prefetch. |
| -xprefetch_auto_type | Determines whether or not the compiler generates indirect prefetches for the loops indicated by the -xprefetch_level option in the same fashion that the prefetches for direct memory accesses are generated. |
| -xprefetch_level | Controls the aggressiveness of automatic insertion of prefetch instructions as determined with -xprefetch=auto. |
| -xprofile | Collects or optimizes with runtime profiling data. |
| -xprofile_ircache | Improves compilation time during the use phase of -xprofile by reusing compilation data saved from the collect phase of -xprofile. |
| -xprofile_pathmap | For use in conjunction with the -xprofile=use option. |
| -xreduction | Analyzes loops for reduction in automatic parallelization. |
| -xregs | Makes available additional scratch registers for use during compilation. |
| -xrestrict | Treats pointer-valued function parameters as restricted pointers. |
| -xs | Allows debugging by dbx without object files. |
| -xsafe | Allows the compiler to assume that no memory protection violations occur. |
| -xsb | Generates extra symbol table information for the Source Browser. |
| -xsbfast | Creates the database for the Source Browser, but does not actually compile. |
| -xsfpconst | Represents unsuffixed floating-point constants as single precision, instead of the default mode of double precision. |
| -xspace | Does not allow optimizations that increase code size. |
| -xstrconst | Inserts string literals into the read-only data section of the text segment instead of the default data segment. |
| -xtarget | Specifies the target system for instruction set and optimization. |
| -xtemp | Sets the directory the compiler uses for temporary files. |
| -xthreadvar | Works in conjunction with the __thread declaration specifier to take advantage of the compiler's thread-local storage facility. |
| -xtime | Causes the CC driver to report execution times for the various compilation passes. |
| -xtransition | Issues warnings for differences between K&R C and ISO C. |
| -xtrigraphs | Enables or disables recognition of trigraph sequences as defined by the ISO/ANSI C standard. |
| -xunroll | Enables unrolling of loops where possible. |
| -xustr | Enables compiler recognition of UTF-16 character strings and literals. |
| -xvector | Enables automatic generation of calls to the vector library and/or the generation of the SIMD (Single Instruction Multiple Data) instructions. |
| -xvis | Declares the use of the assembly-language templates defined in the VIS[tm] instruction set Software Developers Kit (VSDK). |
| -xvpara | Show parallelization warning messages. |
| -Y | Specifies a new path for the location of compilation components. |
| -YA | Specifies a directory dir to search for all compiler components. |
| -YI | Changes default directory searched for include files. |
| -YP | Changes default directory for finding library files. |
| -YS | Changes default directory for startup object files. |
| -Zll | Creates the program database for lock_lint, but does not generate executable code. |