You should be able to link them while they use the same object file format and are aimed at the same set of machine instructions. For example, let's say you have two C compilers, each of which has its own language extensions. You will compile two different files, one with compiler A, the other with compiler B. Each source file uses the language extensions of the corresponding compiler. As long as both compilers are targeted to the same platform and architecture, for example, the i386 instruction installed on Linux, you should be able to link files to one executable file.
See this list of object file formats on the wiki .
It may also interest you:
UNIX tools for learning object files
EDIT
According to this article, C ++ Standard Library ABI , there is an industry standard C ++ ABI, and you should be able to link file objects of any compiler that complies with this standard. Here you can see this standard:
Itanium C ++ ABI
This document was developed jointly by an informal industry coalition consisting of (in alphabetical order) CodeSourcery, Compaq, EDG, HP, IBM, Intel, Red Hat and SGI ...
In this document, we indicate the Binary application interface for C ++ programs, that is, object code interfaces between the C ++ user code and the embedded system and the library. This includes a memory layout for C ++ data objects, including both predefined and user-defined data types, as well as an internal compiler-generated objects, such as virtual tables. It also includes the function calling interfaces, exception handling interfaces, global naming, and various object code conventions.
As long as you target the same set of commands, the object file format, and use the standard C ++ ABI (which is the default in gcc / g ++), you should be fine, assuming, of course, that standard C ++ ABIs are actually standard and properly implemented by most modern C ++ compilers that run on Linux (which seems to be platform targeting).
EDIT 2
You should take a look at this SO post:
GCC vs. MS C ++ compiler for supporting binary binary API compatibility
It seems that Microsoft does not adhere to any standard standard (Itanium or otherwise) regarding its C ++ ABI, so if you compile gcc for Windows, this is likely to be a problem.
You probably also want to look at these two articles:
Policies / issues with binary compatibility with C ++
Some thoughts on binary compatibility
You can limit your users to compilers that support Itanium ABI, but it depends on your target audience.