| Sun WorkShop(TM) 6: 64-Bit Compilers README |
Contents
Introduction This release of the Sun WorkShop(TM) compilers (C, C++, FORTRAN 77, Fortran 95) supports the 64-bit SPARC(TM) Platform Editions of the Solaris(TM) 7 and Solaris 8 Operating Environments. This means that the cc, CC, f77, and f95 compilers can generate 64-bit object binaries to run in a 64-bit enabled Solaris Operating Environment. Compilation, linking, and execution of these programs must all take place in a Solaris 7 or 8 environment. The compilers (with the exception of C++) can also produce 64-bit applications when compiling on a 32-bit system, but compilation still must take place under Solaris 7 or 8. In all cases, the flag -xarch=v9,-xarch=v9a, or -xarch=v9b must be specified. This is what is meant by "compiling for a 64-bit environment". This README provides basic information for developers of 64-bit C, C++, FORTRAN 77, and Fortran 95 applications under a 64-bit Solaris environment, and pointers to more detailed sources.
For More Information For more information, consult:
cc -xhelp=readme or CC -readme or f77 -xhelp=readme or f95 -xhelp=readme Compiling For 64-Bit Solaris Environments The compilers in this release can produce 64-bit objects on either 32-bit or 64-bit architectures running a 64-bit enabled Solaris operating environment (the Solaris 7 or 8 SPARC Platform Edition). The resulting executable will run only on 64-bit UltraSPARC processors with the Solaris 64-bit kernel. Compilation, linking, and execution of 64-bit objects can only take place in a 64-bit Solaris environment. Compiling for a 64-bit environment is indicated by the -xarch=v9 (or v9a or v9b) options. Note that one of these options must be specified even if -xtarget or -fast are also specified. In such a case, the -xarch=v9 (or v9a, v9b) option must appear AFTER -xtarget or -fast or any other option that sets -xarch. For example: -xtarget=ultra -xarch=v9Note that -xtarget=ultra, ultra2, or ultra2i, imply -xarch=v8 and do not automatically signal -xarch=v9 or v9a. Also, -fast implies -xarch=native (which in turn implies -xarch=v8). What's So Special About 64-Bit Solaris Operating Environments The 64-bit Solaris operating environment is a complete 32-bit and 64-bit application and development environment supported by a 64-bit operating system. The 64-bit Solaris operating environment overcomes the limitations of the 32-bit system by supporting a 64-bit virtual address space as well as removing other existing 32-bit system limitations. For C, C++, and Fortran software developers, this means the following
when compiling with -xarch=v9 or v9a in a Solaris 7 environment:
Be aware however that even though a program is compiled to run in a 64-bit environment, default data sizes for INTEGER, REAL, COMPLEX, and DOUBLE PRECISION do not change. That is, even though a program is compiled with -xarch=v9, default INTEGER and REAL are still INTEGER*4 and REAL*4, etc. To use the full features of the 64-bit environment, some explicit typing of variables as INTEGER*8 and REAL*8 may be required. Also, some 64-bit specific library routines (such as QSORT64(3F) and MALLOC64() ) may have to be used. For details, see the FORTRAN 77 or Fortran 95 READMEs (viewable with the f77 or f95 compiler option: -xhelp=readme).
General Considerations: The following items are general issues regarding compiling for 64-bit
Solaris environments. For specific issues, see the individual compiler
man pages and READMEs.
% isainfo -v 64-bit sparcv9 applications 32-bit sparc applicationsindicates that the system will accept both 64-bit and 32-bit applications. See isainfo(1) on Solaris 7 or 8 for more details. ("isa" by the way stands for "Instruction Set Architectures.)
The SPARC Assembler The SPARC-V9 architecture differs from SPARC-V8 architecture in the following areas: registers, alternate space access, byte order, and instruction set. The SPARC Assembler has been expanded to accommodate these new features. The SPARC Assembly Language Reference Manual can be viewed at http://docs.sun.com and appears under the Solaris 7 Software Developer Collection. There is one undocumented pseudo instruction that is important for those porting assembly language code to SPARC-V9: .register %g{2|3|6|7}, {#scratch|symbol_name}With SPARC-V9, the four registers %g2, %g3, %g6, %g7, should not be used unless explicitly declared on a .register pseudo-op. Under -xarch=v9, the SPARC assembler will issue an error message if it detects the use of %g2 or %g3 registers without a .register declaration. A .register declaration is not required for %g6 or %g7, but its appearance does invoke checking for proper use of these registers. Specify the #scratch option when the register is used as a scratch register: .register %g3, #scratchOr, declare the global register with a symbolic name, as in: .register %g2, xyzA .register declaration must appear before the first use of the register. Linking objects containing conflicting register will cause the linker to issue error messages. Frequently Asked Questions These questions appear in the Solaris 64-bit Developer's Guide, and refer to running on 32-bit and 64-bit versions of Solaris 7 or 8: Q: Can I run the 64-bit version of the Solaris 7 operating environment
on 32-bit hardware?
Q: Do I need to change my 32-bit application if I plan to run that
application on a system with a 32-bit operating environment?
Q: Do I need to change my 32-bit application if I plan to run that
application on a system with the 64-bit operating environment?
Q: What program do I need to invoke in order to get the 64-bit capabilities?
Q: Can I build a 32-bit application on a system running the 64-bit
Solaris 7 operating environment?
Q: Can I build a 64-bit application on a system running the 32-bit
operating environment?
Q: Can I combine 32-bit libraries and 64-bit libraries when building
and linking applications?
Copyright
2000 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303,
U.S.A. All rights reserved.
|