Re: Compiler ABI changes and XPCOM components

Pierre Phaneuf <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpcom
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Doug Turner wrote:

> > There is nothing XPCOM can do about this. Different C++
> > Compilers mangle function names differently, so that a
> > gcc3-compiled Plugin will expect a different function name
> > from what actually exists on a gcc2-compiled Mozilla.
> 
> exactly!

Almost, but not quite exactly. Mangling has very little effect for XPCOM
interfaces, but virtual method table layout has. Specifically, the few
places where mangling could have any effect are probably ordinary
functions rather than methods and could be protected with a "C" linkage.

A number of compilers have options to make virtual method tables follow
the Microsoft COM layout (which is documented in the COM Specification),
so I suppose that Mozilla should use these options as much as possible
(it is usually an attribute that you give to a parent-less class and
which is inherited).

-- 
Pierre Phaneuf
http://advogato.org/person/pphaneuf/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.