slow ar on cygwin windows patch

Mike Stump mrs@windriver.com
Thu Jan 25 15:54:00 GMT 2001


I've found that I need the below patch on Windows to prevent it from
being 233 times slower when cygwin (B19) is hosting when an achieve is
being created with 14 .o files.  Without this patch, it was taking
over a minute, with the patch, 0.3 seconds, a worthwhile win.

2001-01-25  Mike Stump  <mrs@kankakee.wrs.com>

	* rename.c (smart_rename): Don't use chown/chmod on Cygwin on
          Windows, it is very slow.

*** rename.c.old	Mon Oct  4 14:06:46 1999
--- rename.c	Thu Jan 25 15:45:31 2001
*************** smart_rename (from, to, preserve_dates)
*** 178,183 ****
--- 178,187 ----
        ret = rename (from, to);
        if (ret == 0)
  	{
+ 	  /* This speed up creating an archive with ar with 14 .o
+ 	     files 233x on Windows, this functionality isn't worth the
+ 	     slowness.  */
+ #if ! defined (_WIN32)
  	  if (exists)
  	    {
  	      /* Try to preserve the permission bits and ownership of
*************** smart_rename (from, to, preserve_dates)
*** 196,201 ****
--- 200,206 ----
  	      if (chown (to, s.st_uid, s.st_gid) >= 0)
  		chmod (to, s.st_mode & 07777);
  	    }
+ #endif
  	}
        else
  	{
------------------------------


More information about the Binutils mailing list