[devel] Q: --no-copy-dt-needed-entries

Dmitry V. Levin ldv на altlinux.org
Ср Мар 24 22:01:50 UTC 2010


On Wed, Mar 24, 2010 at 09:01:51PM +0200, Kirill A. Shutemov wrote:
> 2010/3/24 Alexey Tourbin <at на altlinux.ru>:
> > On Wed, Mar 24, 2010 at 09:04:48PM +0300, Dmitry V. Levin wrote:
> >> On Mon, Mar 22, 2010 at 11:23:01AM +0300, Alexey Tourbin wrote:
[...]
> >> > Just don't do it - in conjunction with --as-needed, --copy-dt-needed-entries
> >> > is good by default.
> >>
> >> Current --as-needed + --copy-dt-needed-entries combination works pretty
> >> well, so let's delay changing this default until we face a real bug.
> >
> > Not only does it work pretty well, it also tries to do "the right
> > thing".  In a previous message, I tried to describe two distinct ld
> > modes: dumb mode and smart mode.  Dumb mode would just do what is
> > specified on the command line.  By contrast, smart mode could do
> > something more about shared library dependencies based on how symbols
> > are resolved.
> >
> > Now, a smart mode, what could that be?  It's about either extra
> > dependencies which are unused (--as-needed), or missing/implicit
> > dependencies which can be obtained automatically (--copy-dt-needed-entries).
> > So, if there's anything like a smart mode, these two options togehter
> > are pretty smart.
> 
> Ok, for example, we have package libfoo with library libfoo.so.0 which
> links with libm. Program bar uses symbols from both libfoo and libm,
> but it links only with libfoo.so.0. Everything works fine. Then libfoo
> changes a bit. It doesn't link with libm any more, but soname hasn't
> changed. Everything still works fine, but building of program bar is
> broken.

Note that, as you've just said, runtime still works fine, and there are no
wrong linkage.

> Cause of breakage is not clean in this situation. Do we care
> about situations like this?

Well, if it just no longer links due to this error, the fix is rather
trivial.  Why should we bother of fixing these harmless hidden linkage
bugs so much?  Let's fix them as soon as they arise.

> Currently, we have a good chance to fix buggy software.

It's always good to fix buggy software.  However, there are too many bugs
around, let's fix first those that harm most.  Fixing linkage bugs
uncovered by --no-copy-dt-needed-enties option brings us nothing besides
this fix, because the option itself has no other benefits, unlike e.g.
--as-needed which was introduced to solve real issue -- overlinking.

> --no-copy-dt-needed-enties provides rather informative error message
> on underlinking.

That's nice.


-- 
ldv
----------- ????????? ????? -----------
???? ??????? ???????? ?? ? ????????? ???????...
???     : ???????????
???     : application/pgp-signature
??????  : 198 ??????
????????: ???????????
Url     : <http://lists.altlinux.org/pipermail/devel/attachments/20100325/babb81a0/attachment.bin>


Подробная информация о списке рассылки Devel