Index: head/usr.bin/ar/ar.1 =================================================================== --- head/usr.bin/ar/ar.1 +++ head/usr.bin/ar/ar.1 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 2015 +.Dd June 16, 2016 .Dt AR 1 .Os .Sh NAME @@ -205,7 +205,12 @@ .Fl r or .Fl q -option, insert 0's instead of the real mtime, uid and gid values +option, +with the +.Fl s +option without other options, or when invoked as +.Nm ranlib , +insert 0's instead of the real mtime, uid and gid values and 0644 instead of file mode from the members named by arguments .Ar . This ensures that checksums on the resulting archives are reproducible Index: head/usr.bin/ar/ar.c =================================================================== --- head/usr.bin/ar/ar.c +++ head/usr.bin/ar/ar.c @@ -283,7 +283,8 @@ } /* Set determinstic mode for -D, and by default without -U. */ - if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r'))) + if (Dflag || (Uflag == 0 && (bsdar->mode == 'q' || bsdar->mode == 'r' || + (bsdar->mode == '\0' && bsdar->options & AR_S)))) bsdar->options |= AR_D; if (bsdar->options & AR_A)