On Sun, Jan 5, 2025 at 4:36 AM Bruno Haible via Gnulib discussion list
<bug-gnulib@gnu.org> wrote:
> Building a recent diffutils snapshot on FreeBSD 5.2.1, I see this
> compilation error:
>
>   CCLD     diff
> ../lib/libdiffutils.a(libdiffutils_a-save-cwd.o): In function `save_cwd':
> /usr/home/bruno/diffutils-3.10.242-d65b/build/lib/../../lib/save-cwd.c:65: 
> undefined reference to `rpl_getcwd'
> gmake[2]: *** [diff] Error 1
> gmake[2]: Leaving directory 
> `/usr/home/bruno/diffutils-3.10.242-d65b/build/src'
>
> The reason is that this package has
>   - getcwd-lgpl.c in lib/ - disabled
>   - getcwd.c in gnulib-tests/ - enabled, with REPLACE_GETCWD=1
> But the REPLACE_GETCWD=1 setting makes a side effect on lib/unistd.h,
> namely it enables '#define getcwd rpl_getcwd'.
>
> The fix is to make sure that the tests contain module 'getcwd-lgpl',
> not 'getcwd'.
>
>
> 2025-01-05  Bruno Haible  <br...@clisp.org>
>
>         tests: Don't use module 'getcwd' as dependency.
>         * modules/getcwd (Comment): New section.
>         * modules/xgetcwd (Comment): Likewise.
>         * modules/xgetcwd-lgpl: New file, based on modules/xgetcwd.
>         * modules/chown-tests (Depends-on): Add xgetcwd-lgpl. Remove xgetcwd.
>         * modules/fchownat-tests (Depends-on): Likewise.
>         * modules/fdutimensat-tests (Depends-on): Likewise.
>         * modules/futimens-tests (Depends-on): Likewise.
>         * modules/lchown-tests (Depends-on): Likewise.
>         * modules/stat-time-tests (Depends-on): Likewise.
>         * modules/utime-tests (Depends-on): Likewise.
>         * modules/utimens-tests (Depends-on): Likewise.
>         * modules/utimensat-tests (Depends-on): Likewise.

Thank you for finding and fixing that.

Reply via email to