[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Shared library versioning

> That's almost certainly a terrible idea.

I somehow expected that might come up. I didn't fell to comfortable with this
idea, but I think there must be another solution than simply doing it "by hand",
a more "elegant" way.

> The SONAME needs to match across distributions so it really needs to be
> managed (and managed correctly) by upstream.

I have access to upstream's CVS so if any modification is to be made, it will
concern the whole project not only the debianization of it.

>  If every change to the
> library requires an SONAME change then it almost certainly should not
> *be* a library.  It would be rather disappointing if what you're saying
> about C++ template classes is really accurate.  Personally, I suspect
> it's not.

That's what the upstream author explained me, and that's what I want to find
out. Two possibilities, either the upstream author has missed something, or
there is a proper way of dealing with this kind of situation.

One example that might fail :
let's say we have a shared library with 2 source files : g.cc and g.h

g.h :
template <class T>
void g (T x);

g.cc :
template <class T>
void g (T x) {
   cout << x;

The .h file has to include the .cc one in order for the compilation to work.
That leads to a shared library that we'll call libg.so.1.0.0
Let's say now that I compile a program `prgm` and link it against the above library.

Now if I decide to change one line of g.cc :
   cout << x;
   cout << x << endl;

and if I don't change the SONAME (the ABI hasn't changed, there doesn't seem to
be a reason to increment the SONAME), and call `prgm`, I want the the newline on
the output, because the code of g isn't in the .so library but in prgm itself.
According to the upstream author, since the template (class T) isn't known, we
cannot insert the code of g into the library (which seems normal).

My programming skills are limited, therefore I'm doing my best to explain
myself, hope it was clear enough...

Alexis Papadopoulos

envoyé via Webmail/IMAG !

Reply to: