Go to main content
Oracle® Developer Studio 12.5: GCC Compatibility Guide

Exit Print View

Updated: June 2017
 
 

General Compatibility Concepts

This section discusses basic concepts affecting the compatibility between Oracle Developer Studio and GCC compilers.

Platforms and ABIs

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.

Compatibility Summary

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.

ABI References

The binary code generated by the Oracle Developer Studio compilers is described in a variety of documents: