This section discusses basic concepts affecting the compatibility between Oracle Developer Studio and GCC compilers.
The C or the C++ language standards do not define any formal ABI (Application Binary Interface); however, within a specific platform and pointer size, a de facto ABI allows compatibility between modules written with C-level exported interfaces.
In this context a platform is a combination of two items:
Operating system (for example, Oracle Linux or Oracle Solaris)
Chip family (SPARC or x86)
The pointer size refers to whether the binaries are built with the 32-bit ABI or the 64-bit ABI. Some platforms might support only one pointer size, but currently most platforms supported by the Oracle Developer Studio product support both 32-bit and 64-bit programs.
Oracle Developer Studio and gcc support the –m32 and –m64 options for selecting the 32-bit and 64-bit ABIs respectively. On Solaris 10 and Oracle Solaris 11, the default mode is 32-bit. On Oracle Linux, the default mode is 64-bit.
To implement many features of the C++ language, the compiler must generate ELF symbols and other binary data that are specific to the compiler implementation and not covered by a multi-vendor platform-wide ABI document.
Some features of the compiler that are selected by compile-time or link-time options can result in extra external symbol references or other changes in the binary output of the compiler that is beyond the usual C level interfaces defined in the ABIs. For these features, you might have to link your program with the same compiler used to create the object files. Some features might also prevent linking with object files from other compilers.
You can generally compile C source files with Oracle Developer Studio or gcc and freely mix their object files to link either an executable or a shared library. This section describes some exceptions.
For C++, you can choose a g++ compatible mode of the Oracle Developer Studio C++ compiler and mix shared libraries and executables built with different compilers, but you cannot mix object files from different compilers. Details are described below.
The Oracle Developer Studio 12.5 release has a specific issue with g++ compatibility between the 4.x library and the 5.x library ABIs. For more information, see GNU ABI Compatibility.
The binary code generated by the Oracle Developer Studio compilers is described in a variety of documents:
SPARC ABI: http://sparc.org/technical-documents
SPARC Assembly Language Reference Manual : Chapter 6. Writing Functions http://docs.oracle.com/cd/E53394_01/html/E54833/index.html
Oracle Solaris 64-bit Developer's Guide
AMD64 ABI Features: https://docs.oracle.com/cd/E53394_01/html/E61689/fcowb.html
SPARC V9 ABI Features: https://docs.oracle.com/cd/E53394_01/html/E61689/advanced-2.html