Is this ABI thing important?

Discussion in 'C++' started by Steven T. Hatton, Jun 3, 2004.

  1. 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

    --
    STH
    Hatton's Law: "There is only One inviolable Law"
    KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
    Mozilla: http://www.mozilla.org
     
    Steven T. Hatton, Jun 3, 2004
    #1
    1. Advertising

  2. Steven T. Hatton wrote:
    > 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
     
    Victor Bazarov, Jun 3, 2004
    #2
    1. Advertising

  3. Off Topic: Is this ABI thing important?

    Steven T. Hatton wrote:

    > 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.
     
    E. Robert Tisdale, Jun 3, 2004
    #3
  4. E. Robert Tisdale wrote:

    > Steven T. Hatton wrote:


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

    >
    > 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...."


    --
    STH
    Hatton's Law: "There is only One inviolable Law"
    KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
    Mozilla: http://www.mozilla.org
     
    Steven T. Hatton, Jun 4, 2004
    #4
  5. Steven T. Hatton wrote:

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

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

    >>
    >>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...."


    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.
     
    E. Robert Tisdale, Jun 4, 2004
    #5
  6. Steven T. Hatton wrote:

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

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

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

    >
    >
    > 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
     
    Mark A. Gibbs, Jun 4, 2004
    #6
  7. Mark A. Gibbs wrote:

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

    >>
    >>
    >>>> http://www.armdevzone.com/EABI/CppABI.html
    >>>
    >>>This has nothing to do with the C++ computer programming language.

    >>
    >>
    >> 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


    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.

    --
    STH
    Hatton's Law: "There is only One inviolable Law"
    KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
    Mozilla: http://www.mozilla.org
     
    Steven T. Hatton, Jun 4, 2004
    #7
  8. [OT] Re: Is this ABI thing important?

    Steven T. Hatton wrote:

    > 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
     
    Mark A. Gibbs, Jun 4, 2004
    #8
  9. "Steven T. Hatton" <> wrote in message news:<>...
    > E. Robert Tisdale wrote:
    >
    > > Steven T. Hatton wrote:

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

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

    >
    > 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
     
    Michiel Salters, Jun 4, 2004
    #9
  10. Michiel Salters wrote:

    > "Steven T. Hatton" <> wrote in message
    > news:<>...
    >> E. Robert Tisdale wrote:
    >>
    >> > Steven T. Hatton wrote:

    >>
    >> >> http://www.armdevzone.com/EABI/CppABI.html
    >> >
    >> > This has nothing to do with the C++ computer programming language.

    >>
    >> That is an incorrect statement.

    >
    > 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.


    --
    STH
    Hatton's Law: "There is only One inviolable Law"
    KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
    Mozilla: http://www.mozilla.org
     
    Steven T. Hatton, Jun 4, 2004
    #10
  11. Steven T. Hatton

    Mike Smith Guest

    Victor Bazarov wrote:
    >
    > 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.

    --
    Mike Smith
     
    Mike Smith, Jun 4, 2004
    #11
  12. Steven T. Hatton

    tom_usenet Guest

    On Fri, 04 Jun 2004 12:54:14 -0400, Mike Smith
    <> wrote:

    >Victor Bazarov wrote:
    >>
    >> 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.


    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
    --
    C++ FAQ: http://www.parashift.com/c -faq-lite/
    C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
     
    tom_usenet, Jun 4, 2004
    #12
  13. Steven T. Hatton

    tom_usenet Guest

    On Fri, 04 Jun 2004 12:38:24 -0400, "Steven T. Hatton"
    <> wrote:

    >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
    --
    C++ FAQ: http://www.parashift.com/c -faq-lite/
    C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
     
    tom_usenet, Jun 4, 2004
    #13
  14. Steven T. Hatton

    Mike Smith Guest

    tom_usenet wrote:

    > On Fri, 04 Jun 2004 12:54:14 -0400, Mike Smith
    > <> wrote:
    >
    >
    >>Victor Bazarov wrote:
    >>
    >>>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.

    >
    >
    > 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. ;-)

    --
    Mike Smith
     
    Mike Smith, Jun 5, 2004
    #14
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. uto
    Replies:
    2
    Views:
    297
  2. Brett E.
    Replies:
    0
    Views:
    675
    Brett E.
    Jul 25, 2003
  3. Vijai

    ABI related question

    Vijai, Sep 22, 2004, in forum: C++
    Replies:
    2
    Views:
    477
    Greg Comeau
    Sep 22, 2004
  4. Gabriel Mejía
    Replies:
    0
    Views:
    115
    Gabriel Mejía
    Feb 22, 2005
  5. Zam
    Replies:
    1
    Views:
    257
    Mark Schupp
    Mar 14, 2005
Loading...

Share This Page