Is this ABI thing important?

  • Thread starter Steven T. Hatton
  • Start date
S

Steven T. Hatton

I was skimming through the GCC documentation and came across the use of the
TLA "ABI". They were using the expression as if I should know what it is.
I therefore ran a google search and found the link below. It's an
'abstract binary interface', which sounds like a fancy way of saying
abstraction layer. I haven't had a chance to read much of the literature,
but it looked important enough to mention. It looks as though there are
different ABIs for different hardware platforms, and these are the concern
of the hardware manufacturers. There also is something called a generic
ABI which seems to be directed toward establishing a close relationship
with the C++ Standard.

http://www.armdevzone.com/EABI/CppABI.html
 
V

Victor Bazarov

Steven said:
I was skimming through the GCC documentation and came across the use of the
TLA "ABI". They were using the expression as if I should know what it is.

Application Binary Interface.
I therefore ran a google search and found the link below. It's an
'abstract binary interface', which sounds like a fancy way of saying
abstraction layer. I haven't had a chance to read much of the literature,
but it looked important enough to mention. It looks as though there are
different ABIs for different hardware platforms, and these are the concern
of the hardware manufacturers. There also is something called a generic
ABI which seems to be directed toward establishing a close relationship
with the C++ Standard.

http://www.armdevzone.com/EABI/CppABI.html

To answer the question you put in the subject line, yes, it is important
if you want to write a compiler or a debugger or a driver that other ppl
could dynamically link to and control. That's what I've understood from
reading some of the pages.

V
 
E

E. Robert Tisdale

Steven said:
I was skimming through the GCC documentation and came across the use of the
TLA "ABI". They were using the expression as if I should know what it is.
I therefore ran a google search and found the link below.
It's an 'abstract binary interface', which sounds like a fancy way of saying
abstraction layer. I haven't had a chance to read much of the literature,
but it looked important enough to mention. It looks as though
there are different ABIs for different hardware platforms,

and operating systems.
and these are the concern of the hardware manufacturers.
There also is something called a generic ABI which seems to be directed
toward establishing a close relationship with the C++ Standard.


http://www.armdevzone.com/EABI/CppABI.html

This has nothing to do with the C++ computer programming language.
But compiler developers need guidance to write compilers
that will emit code which is "interoperable" with the operating system
(running on a particular computer architecture).
The compiler must be able to build executable programs
that can be run by the operating system
and linked into existing [system] libraries.

There is no guarantee that libraries compiled by one C++ compiler
can be linked into programs compiled by another C++ compiler
on the same platform (computer architecture + operating system).
There is no guarantee that functions compiled by a C compiler
can be successfully called from a program compiled by a C++ compiler
even if they are declared extern "C" and linked without complaint.
But C++ compilers can produce object files that can be linked
into libraries compiled by other compilers and call functions
from those libraries successfully
partly because they conform to the ABI.
 
S

Steven T. Hatton

E. Robert Tisdale said:
Steven T. Hatton wrote:

This has nothing to do with the C++ computer programming language.

That is an incorrect statement.

"Chapter 1: Introduction"

"In this document, we specify the Application Binary Interface for C++
programs, that is, the object code interfaces between user C++ code and the
implementation-provided system and libraries. This includes the memory
layout for C++ data objects, including both predefined and user-defined
data types, as well as internal compiler generated objects such as virtual
tables. It also includes function calling interfaces, exception handling
interfaces, global naming, and various object code conventions."

"In general, this document is written as a generic specification, to be
usable by C++ implementations on a variety of architectures...."
 
E

E. Robert Tisdale

Steven said:
That is an incorrect statement.

"Chapter 1: Introduction"

"In this document, we specify the Application Binary Interface for C++
programs, that is, the object code interfaces between user C++ code and the
implementation-provided system and libraries. This includes the memory
layout for C++ data objects, including both predefined and user-defined
data types, as well as internal compiler generated objects such as virtual
tables. It also includes function calling interfaces, exception handling
interfaces, global naming, and various object code conventions."

"In general, this document is written as a generic specification, to be
usable by C++ implementations on a variety of architectures...."

You are confused. Read the passage that you quoted again carefully.
Although the ABI has a lot to do with the implementation of compilers,
it has *nothing* to do with the C++ programming language itself.
C++ programmers needn't know anything about the ABI
to write standard C++ programs.
 
M

Mark A. Gibbs

Steven said:
E. Robert Tisdale wrote:




That is an incorrect statement.

no, he is correct.

the c or c++ standards say nothing about what gets generated from your
c++ code. they only specify how a program should behave, not how any
operating system should make that happen.

mark
 
S

Steven T. Hatton

Mark said:
no, he is correct.

the c or c++ standards say nothing about what gets generated from your
c++ code. they only specify how a program should behave, not how any
operating system should make that happen.

mark

All that says is that the gABI is not synonymous with the C++ Standard.
Robert's statement is as absurd as a statement along the lines of 'England
has nothing to do with the English language.' I really don't see a need to
attempt to defend my position. Some things are selfevident.
 
M

Mark A. Gibbs

Steven said:
All that says is that the gABI is not synonymous with the C++ Standard.
Robert's statement is as absurd as a statement along the lines of 'England
has nothing to do with the English language.' I really don't see a need to
attempt to defend my position. Some things are selfevident.

personally, i've never been to england and have no intention of going.
but i use the english language every day to communicate with people
within canada, from my home country of barbados, and tons of other
english-speaking countries - not to mention dozens of coutries where
english is not the national language, hundreds of people for whom it is
not the first language and one place in particular where it has been
shamefully butchered for over a century just south of here.

your analogy is flawed anyway. english is to england as c++ is to bell
labs (and while i think the history of c++ is interesting, it has little
bearing on my day-to-day use of it).

a more appropriate analogy for the relationship of the abi to the c++
language would probably be that c++ is to abi as english is to braille.
braille could be used to exchange information oringally generated in
english between people who agree on a common system of braille, and who
find braille a more natural way to store and share that information.

you seem to be relatively capable and comfortable with english. can you
read braille?

on top of all that, there is no law that says that braille must be
generated from english. it is similarly possible to generate
abi-compatible binaries from java, vb and the random favourable
alignment of bytes.

mark
 
M

Michiel Salters

Steven T. Hatton said:
That is an incorrect statement.

True, but one particluar implementation is still off-topic. This group
discusses the common subset dfined by the standard. While it may be
useful to refer to such an ABI for explanatory reasons, it's not a
proper subject itself.

Regards,
Michiel Salters
 
S

Steven T. Hatton

Michiel said:
True, but one particluar implementation is still off-topic.

That really depends if the discussion is related to the Standard, or
specifically unrelated. If I post for example that
http://www.research.att.com/~bs/matrix.c does not compile on gcc-3.4.0
without passing -fpermissive, that is on topic because it demonstrates that
the code does not conform correctly to the ISO/IEC 14882.
This group
discusses the common subset dfined by the standard. While it may be
useful to refer to such an ABI for explanatory reasons, it's not a
proper subject itself.

Again, it really depends on what aspect is being discussed. The document I
pointed to represents an effort to establish an industry standard C++ ABI.
To discuss the consequences on the C++ programming language, or its
relationship to the C++ Standard is not off topic.
 
M

Mike Smith

Victor said:
To answer the question you put in the subject line, yes, it is important
if you want to write a compiler or a debugger or a driver that other ppl
could dynamically link to and control. That's what I've understood from
reading some of the pages.

It would be *great* if all compiler vendors would agree to common ABIs
for the various platforms; e.g. if you could write a Windows DLL using
MSVC exposing a C++ class, which could be directly linked to by a
Borland C++ program. This would greatly reduce the need for things like
COM, CORBA, .Net, etc.
 
T

tom_usenet

It would be *great* if all compiler vendors would agree to common ABIs
for the various platforms; e.g. if you could write a Windows DLL using
MSVC exposing a C++ class, which could be directly linked to by a
Borland C++ program. This would greatly reduce the need for things like
COM, CORBA, .Net, etc.

IA64 (Linux and Win64 versions) are your dream platforms then, since I
think all compilers, etc. use the IA64 ABI. You won't get C++ standard
library compatibility (so no std::string in your interfaces), but
everything else should work.

Tom
 
T

tom_usenet

Again, it really depends on what aspect is being discussed. The document I
pointed to represents an effort to establish an industry standard C++ ABI.

AFAIK this can't be done unless you force all compilers to use the
same standard library implementation, which isn't going to happen.

There is a standard C++ ABI for IA64 though, barring the library (I
believe), and IA64 may eventually become the most common platform.

Tom
 
M

Mike Smith

tom_usenet said:
IA64 (Linux and Win64 versions) are your dream platforms then, since I
think all compilers, etc. use the IA64 ABI. You won't get C++ standard
library compatibility (so no std::string in your interfaces), but
everything else should work.

Great. Now all I need is for there to be at least one Itanium machine
within five miles of my office. ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top