bug-gnulib
[Top][All Lists]
Advanced

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

Re: link dependencies


From: Bruno Haible
Subject: Re: link dependencies
Date: Thu, 21 Jan 2021 19:01:57 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; )

Simon Josefsson wrote:
> >  
> > +Link:
> > +$(LIB_GETRANDOM)
> > +
> >  License:
> >  LGPLv2+
> 
> Is this part needed?  The module depends on getrandom.  Is it because
> that is only a conditional dependency?
> 
> > diff --git a/modules/crypto/gc-tests b/modules/crypto/gc-tests
> > index 7b153d1..5a16ba3 100644
> > --- a/modules/crypto/gc-tests
> > +++ b/modules/crypto/gc-tests
> > @@ -8,4 +8,4 @@ configure.ac:
> >  Makefile.am:
> >  TESTS += test-gc
> >  check_PROGRAMS += test-gc
> > -test_gc_LDADD = $(LDADD) @LIB_CRYPTO@
> > +test_gc_LDADD = $(LDADD) @LIB_CRYPTO@ $(LIB_GETRANDOM)

In test_gc_LDADD, $(LIB_GETRANDOM) is needed, to avoid the link error on MSVC.

The 'Link' section in the module description is only informative.

Originally, we thought that it would be good to note, in the 'Link' section,
only the immediate link dependencies of the module, and let the user use
  ./gnulib-tool --extract-recursive-link-directive MODULE
for the rest.

But in the past few years, it has turned out that this does not work well:
As a user of a module, we don't look at the recursive dependencies closure
any more (partly because this closure is so large, often). The user of a
module looks at the module description _only_.

And so, the 'Link' section needs to contain the recursive link directive.
And when changing some module to use 'getrandom', all direct and indirect
callers of this module must get $(LIB_GETRANDOM) added to their module
descriptions.

Note that we don't (yet) follow this rule strictly for $(LIBINTL) and
$(LIBUNISTRING). But for more rarely used libraries like $(LIB_GETRANDOM)
it's worth it.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]