Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C++ ABI

262 views
Skip to first unread message

Sabyasachi Basu

unread,
Jan 20, 2004, 6:29:22 AM1/20/04
to
Is there a standard C++ ABI?
Also, where can I get a copy of the ABI for Sun C++ and GNU C++? I am
particularly interested in the layout of structs.

Thanks in advance.
Sabyasachi

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Ron Natalie

unread,
Jan 20, 2004, 5:48:20 PM1/20/04
to

"Sabyasachi Basu" <saby...@yahoo.com> wrote in message news:d2d5b7e3.04012...@posting.google.com...

> Is there a standard C++ ABI?

No. C++ is allowed to be targeted to such a wide range of platforms that it
would be impossible to make such.

> Also, where can I get a copy of the ABI for Sun C++ and GNU C++? I am
> particularly interested in the layout of structs.

Try a newsgroup for the Sun compiler or GCC. Again GCC is targeted to a
large number of platforms (and in some cases attempts compatibility with existing
platform ABI's, that again you're not going to find one unless you make it clear
which GCC target you're talking about).

Hyman Rosen

unread,
Jan 21, 2004, 4:01:46 AM1/21/04
to
Sabyasachi Basu wrote:
> Is there a standard C++ ABI?

No, since that would require standard Bs, but that's impossible
since that's dictated by machine, operating system, and vendor.

> Also, where can I get a copy of the ABI for Sun C++ and GNU C++? I am
> particularly interested in the layout of structs.

The new GNU C++ ABI is in <http://www.codesourcery.com/cxx-abi/abi.html>.

Dylan Nicholson

unread,
Jan 23, 2004, 10:54:44 AM1/23/04
to
"Ron Natalie" <r...@sensor.com> wrote in message news:<400d5aa4$0$58195$9a6e...@news.newshosting.com>...

> "Sabyasachi Basu" <saby...@yahoo.com> wrote in message news:d2d5b7e3.04012...@posting.google.com...
> > Is there a standard C++ ABI?
>
> No. C++ is allowed to be targeted to such a wide range of platforms that it
> would be impossible to make such.
>
I'm not sure an 'official standard ABI' across all possible platforms
is what is being asked for, but there's no reason why object code from
various C++ compilers on a single platform (say POSIX) should not be
as binary-compatible as 'C' is.
Microsoft have basically forced all Win32 C/C++ compilers to conform
to their own ABIs* (or at least support it), a fact I know I've been
grateful for a number of times. For POSIX platforms it's still quite
a restriction to insist on a particular ABI, whether it be GCC's or
another. For libraries that you are only supplying binaries for, it's
(just) workable to supply a number of versions for the most popular
compilers, but if you have a plugin architecture that relies on shared
objects using C++ interfaces, you have little choice in the matter.

Out of curiosity, does anyone know if the C ABI that is used across
the board, as far as I know, on POSIX platforms is actually part of a
particular standard?

Dylan


* __stdcall, __cdecl & __fastcall. At least the vtable layout rules
are always the same!

0 new messages