Contents Debugging and Tuning: Migrating to 64-bit x86 Solaris 10 PlatformsPorting to a 64-bit x86 Platform
If you are moving an application to a Solaris 10 OS on x86 based system for the first time (in 32-bit mode), use the Sun Studio 9 compilers to compile and develop on systems running the Solaris 8, 9, or 10 OS. Do the final build with Sun Studio 10 compilers. You might see a substantial performance improvement with Sun Studio 10 compilers, both for 32-bit and 64-bit code. If you are moving from 64-bit SPARC V9 architectures, it's a straight recompile (with some of the caveats listed here). Programs that are already LP64 clean for the most part can just be
compiled Why passing an Prototypes should match function signature: With wrong prototype With correct prototype On SPARC V9 the call to Read Chapter 8 Converting Applications for a 64-Bit Environment in the Sun Studio 10 C User's Guide. Also, see the Solaris 10 64-bit Developer's Guide What Needs to be Recompiled and What Does Not
Although 32-bit applications compiled on x86 systems do not need to be recompiled to run on a 64-bit x86 Solaris 10 platform, recompilation often leads to performance improvements. Code compiled to run on SPARC platforms does need to be recompiled to run on a 64-bit x86 Solaris 10 platform; the AMD Opteron 64-bit x86 instruction set is very different than the SPARC instruction set. Compiling 64-bit Code on x86 Platforms
Use For the latest Sun Studio 10 compiler option information, see the compiler man pages. x86 Code Linking Restrictions
Code compiled on Linux platforms cannot be linked with with 32-bit code compiled on Solaris x86 platforms. However, 64-bit code compiled on Linux systems can be linked with 64-bit code compiled on x86 Solaris 10 platforms. Note, however, that binary compatibility has limitations when files appear in different places within the file system. Furthermore, the Solaris OS is POSIX compliant and Linux is not. So, binary compatibility will only be effective if programmers code to the common subset of Linux and Solaris OS. Compiling 64-bit Code When Using the -fast Option
Compiling with The Comparing the -fast Option Expansion on x86 Platforms and SPARC Platforms
The Note that to compile a 64-bit x86 object with
Debugging and Tuning on the AMD64 PlatformThe dbx Command-Line Debugger
Sun Studio software on SPARC based platforms includes two dbx binaries: a 32-bit dbx that can debug 32-bit programs only, and a 64-bit dbx that can debug both 32-bit and 64-bit binaries. When dbx starts, it determines which of its binaries to execute. On an x86 Solaris system running the 64-bit kernel, the 64-bit dbx is the default. For details about the limitations of dbx, see the dbx readme. Tools
for Tuning 64-bit Code on x86 Solaris 10 Platforms
The Sun Studio Performance Tools can help find bottlenecks in C, C++, Fortran, and Java applications. In many ways, these tools are more flexible and detailed than prof and gprof. They can help answer the following kinds of questions:
For more information about the performance tools in Sun Studio, see the Developer Portal. How to Use the Performance Tools
First, record an application's run with the Collector, then view and analyze the results with Analyzer. More details can be found at the Performance Analyzer resources page. Limitations of the Performance Tools on 64-bit x86 Platforms
For more details, see the performance analyzer readme. When Code Needs to be Recompiled for the Performance Tools
In general, you do not need to recompile your application to use the debugging and performance tools. However, the ability to show full call stacks depends on the use of frame pointers. With i386 and AMD64 processors, frame pointers are used in C++, but they are disabled for C when compiled with -fast. -fast is a macro option whose expansion includes -xregs=frameptr. -xregs=frameptr allows the compiler to perform optimizations that reuse the register containing the frameptr. By following -fast with -xregs=no%frameptr on the command line, this optimization is disabled, thus ensuring use of frame pointers. See the explanation for -xregs in the cc(1) man page for more information. | ||||||||||||||||||||||||||||||||
|
| ||||||||||||