Specifications

Red Hat Enterprise Linux to Oracle Solaris Porting Guide
107
Appendix B GCC to Oracle Solaris Studio Compiler
Flag Mapping
The compiler flags shown in Table B-1 remain the same for both GCC and Oracle Solaris Studio.
TABLE B-1. COMPILER FLAGS THAT REMAIN THE SAME
GCC OPTION ORACLE SOLARIS STUDIO 12.3 OPTION DESCRIPTION
-###
-###
Similar to
-#
, but the stages are not actually executed.
-A name=token -Aname[ (token)] Associate name as a predicate with the specified token
as if by the #assert preprocessing directive.
-C -C Prevents the preprocessor from removing comments.
-c -c Directs the compiler to compile, but not to link.
-Dname[ =val] -Dname[ =val] Defines a preprocessor macro.
-E -E Runs only the preprocessor on source files.
-Wc, arg -Wc, arg Tells the compiler to pass arg as an argument to the tool
named by c.
-w -w Suppresses warnings.
-S -S Directs the compiler to produce an assembly source file.
-s -s Removes all symbolic debugging information from the
output file.
For Intel, use the Linux strip utility on the executable.
-
U
name -
U
name Undefines the preprocessor symbol name.
-lname -lname Links with library libname.a (or .so).
-O -O Turns on the default optimization level (-xO2 for Oracle
Solaris, -O1 for GCC, -O2 for Intel).
-o file -o file Specifies the output file.
-p -p Prepares object code to collect data for profiling with
prof (1).
-Ldir -Ldir Adds dir to the library search directory.
-g -g Generates debugging information.
-H -H Prints the path name of each of the header files being
compiled.
-I[
dir]
-I[
dir] Adds an include search directory.
-I- -I- Any directories you specify with I options before the
-I- option are searched only for the case of #include
"
file"; they are not searched for
#include <
file
>
.