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

01-12-2008, 09:18 AM

unix

Re: tool to check for binary compatibility

On Jan 11, 11:25 pm, Bob Doe <DumpForJ...@gmail.com> wrote:
[color=blue]
> 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)[/color]

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

DS

01-12-2008, 10:31 AM

unix

Re: tool to check for binary compatibility

On 12 Jan., 16:18, David Schwartz <dav...@webmaster.com> wrote:[color=blue]
> On Jan 11, 11:25 pm, Bob Doe <DumpForJ...@gmail.com> wrote:
>[color=green]
> > 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)[/color]
>
> I can think of no way, even in principle, such a tool could work.
>[/color]

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.

01-12-2008, 11:38 AM

unix

Re: tool to check for binary compatibility

Bob Doe wrote:
[color=blue]
> 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)[/color]

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" <wdraxinger@darkstargames.de> wrote in message
news:1elm55-hob.ln1@darkstargames.dnsalias.net...[color=blue]
> Bob Doe wrote:[color=green]
>> Can someone tell me which tool can be used to check for binary
>> compatibility between two dynamic libraries? (I have two[/color]
> 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.[/color]
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)

01-12-2008, 12:52 PM

unix

Re: tool to check for binary compatibility

Arnold Hendriks wrote:
[color=blue]
> 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.[/color]

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.
[color=blue]
> 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)[/color]

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.

On Jan 12, 4:09 am, "Arnold Hendriks" <a.hendr...@b-lex.nl> wrote:
[color=blue]
> 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.[/color]

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

01-12-2008, 04:25 PM

unix

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" <a.hendr...@b-lex.nl> wrote:[color=blue]
> "Wolfgang Draxinger" <wdraxin...@darkstargames.de> wrote in message
>
> news:1elm55-hob.ln1@darkstargames.dnsalias.net...> Bob Doe wrote:[color=green][color=darkred]
> >> Can someone tell me whichtoolcan be used tocheckforbinary
> >>compatibilitybetween two dynamic libraries? (I have two[/color]
> > 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.[/color]
>
> 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)[/color]

01-13-2008, 07:41 PM

unix

Re: tool to check for binary compatibility

> These are libraries written in C++ (with symbols); I'm looking for a[color=blue]
> 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[/color]

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?

08-28-2010, 10:09 AM

andrey86

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