-X (-W)

Pragma equivalent

None.

Purpose

Passes one or more options to a component that is executed during compilation.

Syntax

Read syntax diagramSkip visual syntax diagram
                         (1)           
>>- -X--+-assembler----+------option---------------------------><
        +-preprocessor-+               
        +-linker-------+               
        +-partitioner--+               
        +-wc2llvm------+               
        +-llvm2ptx-----+               
        +-ptxas--------+               
        '-nvcc---------'               

Notes:
  1. You must insert at least one space before option.
Read syntax diagramSkip visual syntax diagram
        .-------.  .-----------.   
        V       |  V           |   
>>- -W----+-@-+-+----,--option-+-------------------------------><
          +-a-+                    
          +-b-+                    
          +-c-+                    
          +-C-+                    
          +-d-+                    
          +-I-+                    
          +-L-+                    
          +-l-+                    
          +-n-+                    
          +-p-+                    
          +-s-+                    
          +-w-+                    
          '-x-'                    

Parameters

option
Any option that is valid for the component to which it is being passed.
Notes: GPU begins GPU ends

For -X, for details about the options for linking and assembling, see the GNU Compiler Collection online documentation at http://gcc.gnu.org/onlinedocs/.

The following table shows the correspondence between -X or -W parameters and the component names:

Parameter of -W Parameter of -X Description Component name
GPU begins @ ptxas The PTX assembler ptxas
a assembler The assembler as
b   The low-level optimizer xlCcode
c, C   The C and C++ compiler front end xlCentry
d   The disassembler dis
I (uppercase i)   The high-level optimizer, compile step ipa
L   The high-level optimizer, link step ipa
l (lowercase L) linker The linker ld
GPU begins n nvcc The NVIDIA C compiler, which is used as a device linker nvcc
p preprocessor The preprocessor xlCentry
GPU begins s partitioner The XL intermediate language (W-Code) splitter partitioner
GPU begins w wc2llvm The XL intermediate language (W-Code) to NVVM-IR translator wc2llvm
GPU begins x llvm2ptx The NVVM-IR to PTX translator llvm2ptx

Usage

In the string following the -W option, use a comma as the separator for each option, and do not include any spaces. For the -X option, one space is needed before the option. If you need to include a character that is special to the shell in the option string, precede the character with a backslash. For example, if you use the -X or -W option in the configuration file, you can use the escape sequence backslash comma (\,) to represent a comma in the parameter string.

You do not need the -X or -W option to pass most options to the linker ld; unrecognized command-line options, except -q options, are passed to it automatically. Only linker options with the same letters as compiler options, such as -v or -S, strictly require -X or -W.

GPU begins To use -W@, -Wn, -Ws, -Ww, -Wx, or their respective -X equivalents, you must specify the -qoffload option. GPU ends

Predefined macros

None.

Examples

To compile the file file.c and pass the linker option -symbolic to the linker, enter the following command:
xlc -Xlinker -symbolic file.c
To compile the file uses_many_symbols.c and the assembly file produces_warnings.s so that produces_warnings.s is assembled with the assembler option -alh, and the object files are linked with the option -s (write list of object files and strip final executable file), issue either of the following commands:
xlc -Xassembler -alh produces_warnings.s -Xlinker -s uses_many_symbols.c 
xlc -Wa,-alh produces_warnings.s -Wl,-s uses_many_symbols.c

Related information



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us