[Top][All Lists]

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

Re: [PATCHv2 2/9] getcwd-lgpl: new module

From: Eric Blake
Subject: Re: [PATCHv2 2/9] getcwd-lgpl: new module
Date: Wed, 27 Apr 2011 11:36:50 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9

On 04/26/2011 06:54 PM, Bruno Haible wrote:
> Hi Eric,
> Now the code is clear enough that it can be understood :-) I have three 
> remarks:

The first two were trivial fixes.

>>  [
>> +      [Define to 1 if GPL code should be used to attempt to work around
>> +       native getcwd failures.])
> This will cause a link error if a package uses
> "gnulib-tool --import --with-tests ... getcwd-lgpl ..."
> and the module 'getcwd' occurs among the dependencies of the tests. Then
> USE_GPL_GETCWD will be defined to 1, therefore lib/getcwd-lgpl.o will be 
> empty,
> therefore lib/libgnu.a will have a missing link dependency. (Recall that
> lib/getcwd.o is linked into the tests only, not into lib/libgnu.a, in this
> case.)

I couldn't reproduce it with 'gl_cv_func_getcwd_null=no ./gnulib-tool
--with-tests --test getcwd-lgpl fchdir', which seems like it matches the
setup you described (fchdir-tests pulls in getcwd).  But my failure to
reproduce may be because at this point in the series, fchdir still pulls
in enough indirect dependencies to get getcwd into the main library and
not just the test library.  At any rate, your claim makes sense, so...

> The easiest fix is to use
>      gl_MODULE_INDICATOR([getcwd])
> and then in the C code you use
>      #if GNULIB_GETCWD

That's what I ended up using.  I've now pushed the amended commit;
thanks for the careful review.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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