Subject: Re: bug#26044: coreutils-8.27 fails to build

From: Pádraig Brady <[email-masked]>
Date: Thu, 9 Mar 2017 23:22:56 -0800

On 09/03/17 22:08, J Rogowsky wrote:
> coreutils-8.27  fails to build.
> 
> function renameat, found in src/force-link.c, is not found on my  
> system, which is an iBook G4 running OSX 10.5.8.
> Therefore the link step fails, citing the linker cannot find _renameat.

Drats. It looks like the coreutils source repo will need something like:

diff --git a/bootstrap.conf b/bootstrap.conf
index 7def1f9..30ce621 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -202,6 +202,7 @@ gnulib_modules="
   regex
   remove
   rename
+  renameat
   rmdir
   root-dev-ino
   rpmatch

> I see there is a similar function in lib/at-func2.c which could be  
> used, but I chose to solve this problem in the simplest way possible  
> by defining renameat in src/force-link.c like so:
> 
> diff src/force-link.c src/force-link.c.OEM
> 86,93d85
> < /* see: https://www.freebsd.org/cgi/man.cgi?query=rename&sektion=2  */
> < static int
> < renameat(int fromfd,const char *from,int tofd,const char *to)
> < {
> < 	return rename(from,to);
> < }

I've not analysed whether that will work (in all cases).

> Perhaps there is a better solution?
> Such as using at_func2 in src/force-link.c  like so:
> 
> static int
> renameat(int fromfd,const char *from,int tofd,const char *to)
> {
> 	return at_func2(fromfd,from,tofd,to,rename);
> }
> 
> ????????????????

I've applied that locally and generated an untested tarball with `make dist`:
https://www.pixelbeat.org/cu/coreutils-8.27.4-3c9d7.tar.xz

Could you test that one out?

> BTW, I had only one test FAIL in "make check":  tests/misc/sort-debug- 
> keys
> Is this related to the above?

I'm guessing that "failure" might be locale related.
Could you attach the tests/test-suite.log file generated with:
  make TESTS=tests/misc/sort-debug-keys.sh SUBDIRS=. VERBOSE=yes check

thanks,
Pádraig