Section C.1. HP-UX and Linux C Compiler Options Table


C.1. HP-UX and Linux C Compiler Options Table

Table C-1. HP-UX ANSI cc and gcc Compiler Switches Comparison Table

HP cc Option[1]

GNU gcc Option[2]

Description

-A[a|c|e]

-ansi

 
 

-std=standard

Specifies the degree of ANSI compliance.

-Bextern

None

Performs the same operation as +Oextern=sym1,sym2,sym3... except that symbols are loaded from an existing file, instead of specified on the command line.

-Bhidden

None

Hides all the symbols including references except for those prefixed with__declspec(dllexport), __declspec(dllimport).

-Bhidden_def

None

Hides all the symbols defined in the module except for those prefixed with__declspec(dllexport).

-c

-c

Compiles only; does not link.

-C

-C

Prevents the preprocessor from stripping comments.

-D_POSIX_C_SOURCE=199506L

  

-D_REENTRANT-lpthread

  

or use lcma (for user threads)

-D_REENTRANT -lpthread

Compiling with threads.

-Dname

-Dname

Defines the preprocessor variable name with a value of 1.

-Dname=def

-Dname=def

Defines the preprocessor variable name with a value of def.

-dynamic

-Wl,-Bdynamic

Enables linking of PIC objects.

-E

-E

Performs preprocessing only with output to stdout.

-fast

None

Expands into a set of compiler options, which results in improved application runtime. Options included are +O3, +Onolooptransform, +Olibcalls, +FPD, +Oentryschedule, and +Ofastaccess. Any of these options can be overridden by placing a subsequent option after -fast on the command line.

-g

-g

Inserts information for the symbolic debugger in the object file.

-G

-pg

Inserts information required by the gprof profiler in the object file.

-Idir

-Idir

Inserts dir in the include file search path.

-lx

-lx

Links with the libx.a depending on default library paths.

-Ldir

-Ldir

Links the libraries in dir before the libraries in the default search path. Adds default linker paths to one specified in the L option before searching the default system library directories.

-Wl,-Lsearchdir

-Wl,-Lsearchdir

-Wl specifies a flag to pass on to the linker. In this case, the L flag is passed on. This has the same effect as the L option.

-n

-shared

Generates shareable code.

 

-Bshareable

 

-N

None

Generates unshareable code.

-noshared

-static

Creates statically bound executables.

 

-Bstatic

 
 

-dn

 
 

-non_shared

 

-o outfile

-o outfile

Places object modules in file outfile.

-O

-O2

Optimizes at level 2.

-p

-p

Inserts information required by the prof profiler in the object file.

-P

None

Performs preprocessing only with output to the corresponding .i file.

-q

None

Marks the executable as demand-loadable.

-Q

None

Marks the executable as not being demand-loadable.

-s

-s

Strips the symbol table from the executable file.

-S

-S

Generates an assembly language source file.

-t x,name

None

Substitutes or inserts subprocess x with name.

-Uname

-Uname

Undefines name in the preprocessor.

-v

-v

Enables verbose mode.

None

-###

Shows each invoked component; does not execute.

-V -version

--version

Causes subprocesses to print version information to stderr.

-w

-w

Suppresses warning messages.

-Wd,-a or +a

None

Omits HP-provided prefix files required by the linker.

-Wx, arg1 [,arg2,..,argn]

-Wx,option

Passes the arguments to subprocess x.

-y

None

Generates information used by the HP SoftBench static analysis tool.

-Y

None

Enables Native Language Support (NLS).

-z

Default (also see -fno-delete-null-pointer-checks-fdelete-null-pointer-checks)

Disallows runtime dereferencing of null pointers.

-Z

None

Allows dereferencing of null pointers at runtime.

+DAmodel

-b machine moptions (if GCC is set up as a cross-compiler)

Generates object code for a specific version of the PA-RISC architecture. In the case of GCC, whichever platform it is is set up for cross-compiling.

+DCapptype

None

Generates code for portable or embedded applications.

+DD32

-mpa-risc-1-1

Generates 32-bit code for PA1.1 architecture.

+DD64 (64-bit)

-mpa-risc-2-0 (32-bit)

Generates x-bit code for PA2.0 architecture.

+dfname

None

Specifies the profile database to use with profile-based optimization.

+DSmodel

None

Performs instruction scheduling for a specific implementation of PA-RISC.

+DOosname

None

Sets the target operating system for the compiler.

+e

None

Enables the following HP value-added features while compiling in ANSI C mode: sized enum, long long, long pointers, compiler-supplied defaults for missing arguments to intrinsic calls, and $ in identifier HP C extensions.

+ESconstlit

None

Introduces new default behavior. HP C now stores constant-qualified (const) objects and literals in read-only memory.

+ESfic

None

Compiles with inline fast indirect calls.

+ESlit

Default

Places string literals and constants into read-only data storage.

+ESnolit

None

Disables +ESconstlit, causing HP C to no longer store literals in read-only memory.

+ESnoparmreloc

None

Disables parameter relocation for function calls.

+ESsfc

None

Replaces function pointer comparison millicode calls with inline code.

+f

None

Inhibits the promotion of float to double, except for function calls and returns.

+FPflags Example: +FPVZO

None

Controls floating-point traps.

+help

None

Launches a Web browser displaying an HTML version of the HP C/HP-UX online help.

+hugesize

None

Lowers the threshold for huge data.

+I

-pg

Prepares the object code for profile-based optimization data collection.

+k

None

Generates long-displacement code sequences so a program can reference large amounts of global data physically located in shared libraries.

+L

None

Enables any #pragma listing directives and the listing facility.

+m

None

Prints identifier maps in the source code listing.

+o

None

Prints hexadecimal code offsets in the source code listing.

+[no]objdebug

None

When used with -g, +objdebug leaves debug information in the object files.

+O[0|1|2|3|4]

-O[0|1|2|3|s]

Invokes optimization level.

+P

-fprofile-generate-fprofile-use

Performs profile-based optimization.

+pgmname

None

Specifies the execution profile data set to be used by the optimizer.

+r

None

Inhibits the automatic promotion of float to double.

+sb

-fsigned-bitfields-fno-unsigned- bitfields

Makes bit-fields signed by default in both 32- and 64-bit modes.

+ubytes

-falign-labels=n (align branch targets to a power of 2 boundary)

Controls pointer alignment where bytes is 1, 2, or 4.

+uc

-funsigned-char

Makes unqualified char data types unsigned.

+wn

-Woptions (close equivalent) -Wall (turns on all warning messages)

Specifies the level of the warning messages where n is 13 (HP-UX).

+W n1[,n2,...nN]

-Wnooptions (close equivalent)

Suppresses the specified warnings.

+Wen1[,n2,...nN]

-Werror (all warnings, close equivalent)

Changes the specified warnings to errors.

 

-pendantic

 

+Wwn1[,n2,...nN]

-Woptions (close equivalent)

Enables the specified warnings, assuming all other warnings are suppressed with -w or +w3.

+z

-fpic

Generates shared library object code (same as +Z in 64-bit mode).

+Z

-fPIC

Generates shared library object code with a large data linkage table (long-form PIC).


[1] HP C/HP-UX Online Help for HP-UX 11i (HP-UX 11.0, HP-UX 11i v1, HP-UX 11i v2). http://docs.hp.com/hpux/onlinedocs/dev/C/B3901BA/c_index.html.

[2] GNU Compiler Collections version 3.4.2 (last updated May 23, 2004)




UNIX to Linux Porting. A Comprehensive Reference
UNIX to Linux Porting: A Comprehensive Reference
ISBN: 0131871099
EAN: 2147483647
Year: 2004
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net