IBM Metal C
Compiler
Compiler Options
The list of compiler options presented here are ones that affect the code produced by the Metal C option. There are other options that affect code generation/optimization that are not listed here. Compiler options can be found in z/OS XL C/C++ User’s Guide© Chapter 4. Compiler options.
- ARCH(n)
- Specifies the machine architecture for which the executable program instructions are to be generated. When ARCHITECTURE is in effect, the compiler selects the instruction set available during the code generation of your program based on the specified machine architecture.Your application will not run on a lower architecture processor than what you specified using the ARCH option. Use the ARCH level that matches the lowest machine architecture where your program will run.
- Default: ARCH(8) for 2097-xxx (IBM System z10® EC) and 2098-xxx (IBM System z10 BC)
- GOFF | NOGOFF
- Instructs the compiler to produce an object file in the Generalized Object File Format (GOFF). When the GOFF and OBJECT options are in effect, the compiler produces an object file in GOFF format. When the NOGOFF and OBJECT options are in effect, the compiler produces an object file in XOBJ format. GOFF removes various limitations of the previous object code format (for example, 16 MB section size) and provides a number of useful extensions, including native z/OS support for long names and attributes.
- Default: NOGOFF
- HGPR | NOHGPR
- Enables the compiler to exploit 64-bit General Purpose Registers (GPRs) in 32-bit programs targeting z/Architecture hardware. When the HGPR compiler option is in effect, the compiler can exploit 64-bit GPRs in the generated code. The compiler will take advantage of this permission when the code generation condition is appropriate. When the NOHGPR and ILP32 compiler options are in effect, the compiler cannot exploit 64-bit GPRs in the generated code.
- Default: For METAL is HGPR(PRESERVE).
- LONGNAME | NOLONGNAME
- Provides support for external names of mixed case and up to 1024 characters long.
When the LONGNAME compiler option is in effect, the compiler generates
untruncated and mixed case external names in the object module produced by the
compiler for functions with non-C++ linkage.
When the NOLONGNAME compiler option is in effect:
- The compiler generates truncated and uppercase names in the object module.
- Only those functions that do not have C++ linkage are given truncated and uppercase names.
- The XL C compiler truncates all the external names to 8 characters whereas the XL C++ compiler only truncates the external functions to 8 characters.
- Default: NOLONGNAME.
- LP64 | ILP32
- Selects either AMODE 64 or AMODE 31 mode. When the LP64 compiler option is in effect, the compiler generates AMODE 64 code utilizing the z/Architecture 64-bit instructions. When the ILP32 compiler option is in effect, the compiler generates AMODE 31 code.
- Default: ILP32
- METAL | NOMETAL
- Generates HLASM code that has no Language Environment run-time dependencies and follows the MVS linkage conventions for passing parameters, returning values, and setting up function save areas.
- Default: NOMETAL
- OPTIMIZE(n) | NOOPTIMIZE
- Specifies whether to optimize code during compilation and, if so, at which level.
- level can have the following values:
- 0 - Indicates that no optimization is to be done; this is equivalent to NOOPTIMIZE. You should use this option in the early stages of your application development since the compilation is efficient but the execution is not. This option also allows you to take full advantage of the debugger.
- 1 - OPTIMIZE(1) is an obsolete artifact of the OS/390 Version 2 Release 4 compiler. We suggest that you use OPTIMIZE(2), which may help avoid compatibility issues.
- 2 - Indicates that global optimizations are to be performed. You should be aware that the size of your functions, the complexity of your code, the coding style, and support of the ISO standard may affect the global optimization of your program. You may need significant additional memory to compile at this optimization level.
- 3 -Performs additional optimizations to those performed with OPTIMIZE(2). OPTIMIZE(3) is recommended when the need for runtime improvement outweighs the concern for minimizing compilation resources. Increasing the level of optimization may or may not result in additional performance improvements, depending on whether additional analysis detects further opportunities for optimization.
- Default: NOOPTIMIZE.
- RENT | NORENT
- Generates reentrant code. When the RENT compiler option is in effect, the compiler takes code that is not naturally reentrant and make it reentrant. When the NORENT compiler option is in effect, the compiler does not generate reentrant code from non-reentrant code. Any naturally reentrant code remains reentrant.
- Default: NORENT.
RENT Mode Support
The RENT option can be enabled under the METAL option to support constructed
reentrancy for C programs with writable static and external variables. The writable
static area (WSA) can be managed by user provided initialization and termination
functions. FOr further information see: z/OS: Metal C Programming Guide and Reference
References:
- z/OS Metal C Programming Guide and Reference
- z/OS V2R2 XL C/C++ User's Guide
All references copyright© IBM Corporation.