Sun Studio 12: C++ User's Guide

1.1.1 Compiling for 64–Bit Platforms

The way to specify compilation of a 32-bit or 64-bit binary has changed in this release. The A.2.107 –xarch=isaoption no longer carries an implicit memory model, 32-bit ILP32 or 64-bit LP64, with each definition, and is now used only to specify the instruction set of the target processor.

Use the new A.2.50 -m32|-m64 options to specify the memory model of the target compilation.

The ILP32 model specifies that C-language int, long, and pointer data types are all 32-bits wide. The LP64 model specifies that long and pointer data types are all 64-bits wide. The Solaris and Linux OS also support large files and large arrays under the LP64 memory model.

When you compile with -m64, the resulting executable works only on 64-bit UltraSPARC(R) or x86 processors under Solaris OS or Linux OS running a 64-bit kernel. Compilation, linking, and execution of 64-bit objects can only take place in a Solaris or Linux OS that supports 64-bit execution.