tool to check for binary compatibility - Linux

This is a discussion on tool to check for binary compatibility - Linux ; Can someone tell me which tool can be used to check for binary compatibility between two dynamic libraries? (I have two versions of the same library, and I want to know if the newer version is binary compatible with the ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: tool to check for binary compatibility

  1. tool to check for binary compatibility

    Can someone tell me which tool can be used to check for binary
    compatibility between two dynamic libraries? (I have two versions of
    the same library, and I want to know if the newer version is binary
    compatible with the older version)

    Thanks

  2. Re: tool to check for binary compatibility

    On Jan 11, 11:25 pm, Bob Doe wrote:

    > Can someone tell me which tool can be used to check for binary
    > compatibility between two dynamic libraries? (I have two versions of
    > the same library, and I want to know if the newer version is binary
    > compatible with the older version)


    I can think of no way, even in principle, such a tool could work.

    DS

  3. Re: tool to check for binary compatibility

    On 12 Jan., 16:18, David Schwartz wrote:
    > On Jan 11, 11:25 pm, Bob Doe wrote:
    >
    > > Can someone tell me which tool can be used to check for binary
    > > compatibility between two dynamic libraries? (I have two versions of
    > > the same library, and I want to know if the newer version is binary
    > > compatible with the older version)

    >
    > I can think of no way, even in principle, such a tool could work.
    >


    On Windows there is are tools to provide hints if only valid API
    calls
    for a special Windows version is called. But this is for a very
    limited
    system libraries subset and keeping in mind that MS best asset is
    backward binary compatibility of API functions.

    If he is looking for a general tool, then it is obivious that the guy
    has absolute no idea about programming.

  4. Re: tool to check for binary compatibility

    Bob Doe wrote:

    > Can someone tell me which tool can be used to check for binary
    > compatibility between two dynamic libraries? (I have two
    > versions of the same library, and I want to know if the newer
    > version is binary compatible with the older version)


    The problem is, that usually such libraries don't expose any
    information about calling convention and function prototypes.

    They would contain it, if they were compiled with debug
    information inclusion. Then you can do a comparision of the
    DWARF entries, which contain these entries.

    Wolfgang Draxinger
    --
    E-Mail address works, Jabber: hexarith@jabber.org, ICQ: 134682867


  5. Re: tool to check for binary compatibility

    "Wolfgang Draxinger" wrote in message
    news:1elm55-hob.ln1@darkstargames.dnsalias.net...
    > Bob Doe wrote:
    >> Can someone tell me which tool can be used to check for binary
    >> compatibility between two dynamic libraries? (I have two

    > They would contain it, if they were compiled with debug
    > information inclusion. Then you can do a comparision of the
    > DWARF entries, which contain these entries.

    If you take binary compatibility to mean: "I do not have to recompile my
    application", then comparing debug information could only be used to
    disprove binary compatibility, but not to prove it.

    If version 1 of the library had a foo() and a bar() function and allowed
    them to be called in any order, but version 2 now requires you to invoke
    foo() before using bar(), they would not be compatible, even though the
    debug information about foo() and bar() might not have changed. (They may
    still be source compatible, if version 2 added macros/inline functions/etc
    to take care of calling foo in its headers)



  6. Re: tool to check for binary compatibility

    Arnold Hendriks wrote:

    > If you take binary compatibility to mean: "I do not have to
    > recompile my application", then comparing debug information
    > could only be used to disprove binary compatibility, but not to
    > prove it.


    Yes, that's normally what binary compatibility is about, that the
    parameters functions are called with remain the same e.g. not a
    change from signed to unsigned (or vice versa), or int64 instead
    of int32.

    > If version 1 of the library had a foo() and a bar() function
    > and allowed them to be called in any order, but version 2 now
    > requires you to invoke foo() before using bar(), they would not
    > be compatible, even though the debug information about foo()
    > and bar() might not have changed. (They may still be source
    > compatible, if version 2 added macros/inline functions/etc to
    > take care of calling foo in its headers)


    This is normally called semantical compatibility. And yes, that
    can't be tested using debug information. OTOH if the semantics
    of a library changes, you normally reflect this with a change in
    function naming. Usually one has to initialize a library anyway,
    and this is a perfect place to test for semantic compatibility.

    However, if the function names didn't change, one could simply
    recompile, again gaining binary comaptibilty, but the semantics
    still don't match.

    Wolfgang Draxinger
    --
    E-Mail address works, Jabber: hexarith@jabber.org, ICQ: 134682867


  7. Re: tool to check for binary compatibility

    On Jan 12, 4:09 am, "Arnold Hendriks" wrote:

    > If you take binary compatibility to mean: "I do not have to recompile my
    > application", then comparing debug information could only be used to
    > disprove binary compatibility, but not to prove it.


    How could that disprove binary compatability? Suppose one library has
    'foo' and the other does not. How could you know if 'foo' was part of
    the publically-defined interface or not?

    Perhaps that could disprove binary compatability in conjunction with
    other information with a human weighing the information against the
    documented API. But the OP is looking for an automated tool, I think.

    DS

  8. Re: tool to check for binary compatibility

    Yeah, I take binary compatibility to mean: "I do not have to recompile
    my
    application."

    These are libraries written in C++ (with symbols); I'm looking for a
    tool that will check:
    1. no new virtual functions have been added
    2. no change the order of virtual functions in the class declaration
    3. no change in the signature of a function
    4. no change in the access rights to some functions or data members
    5. no added new data members to a class or change order of data
    members in a class
    6. no change in the class hierarchy apart from adding new classes


    On Jan 12, 4:09 am, "Arnold Hendriks" wrote:
    > "Wolfgang Draxinger" wrote in message
    >
    > news:1elm55-hob.ln1@darkstargames.dnsalias.net...> Bob Doe wrote:
    > >> Can someone tell me whichtoolcan be used tocheckforbinary
    > >>compatibilitybetween two dynamic libraries? (I have two

    > > They would contain it, if they were compiled with debug
    > > information inclusion. Then you can do a comparision of the
    > > DWARF entries, which contain these entries.

    >
    > If you takebinarycompatibilityto mean: "I do not have to recompile my
    > application", then comparing debug information could only be used to
    > disprovebinarycompatibility, but not to prove it.
    >
    > If version 1 of the library had a foo() and a bar() function and allowed
    > them to be called in any order, but version 2 now requires you to invoke
    > foo() before using bar(), they would not be compatible, even though the
    > debug information about foo() and bar() might not have changed. (They may
    > still be source compatible, if version 2 added macros/inline functions/etc
    > to take care of calling foo in its headers)



  9. Re: tool to check for binary compatibility

    > These are libraries written in C++ (with symbols); I'm looking for a
    > tool that will check:
    > 1. no new virtual functions have been added
    > 2. no change the order of virtual functions in the class declaration
    > 3. no change in the signature of a function
    > 4. no change in the access rights to some functions or data members
    > 5. no added new data members to a class or change order of data
    > members in a class
    > 6. no change in the class hierarchy apart from adding new classes


    Okay now this is a perfect question.

    And the answer is i don't know of any available.
    But i heard that BeOS had a home grown checker program for this to
    make
    there C++ API stable.

    By the way: Why will (4) break binary compatibility?

  10. Re: tool to check for binary compatibility

    > These are libraries written in C++ (with symbols); I'm looking for a
    > tool that will check:
    > 1. no new virtual functions have been added
    > 2. no change the order of virtual functions in the class declaration
    > 3. no change in the signature of a function
    > 4. no change in the access rights to some functions or data members
    > 5. no added new data members to a class or change order of data
    > members in a class
    > 6. no change in the class hierarchy apart from adding new classes

    It is an "ABI Compliance Checker" tool (development was started at end of 2009 under the LGPL).

+ Reply to Thread