* configure.in (--enable-deterministic-archives): Grok new

argument.  Set DEFAULT_AR_DETERMINISTIC to 1 or 0 accordingly.
	* configure: Regenerated.
	* config.in: Regenerated.
	* ar.c (deterministic): Initialize to -1.
	(decode_options, ranlib_main): Grok U option.
	(usage, ranlib_usage): Mention U; say for D and U which is the default.
	(default_deterministic): New function.
	(ranlib_main): Call it.
	(main): Likewise.  Make newer_only && deterministic error
	non-fatal if it was just DEFAULT_AR_DETERMINISTIC and not the D option.
	* doc/binutils.texi (ar cmdline, ranlib): Document U modifier and
	--enable-deterministic-archives behavior.
This commit is contained in:
Roland McGrath
2011-12-21 19:39:11 +00:00
parent 74929e7bba
commit 9cb80f72d8
6 changed files with 138 additions and 13 deletions

View File

@@ -418,6 +418,7 @@ using this modifier.
@item D
@cindex deterministic archives
@kindex --enable-deterministic-archives
Operate in @emph{deterministic} mode. When adding files and the archive
index use zero for UIDs, GIDs, timestamps, and use consistent file modes
for all files. When this option is used, if @command{ar} is used with
@@ -425,6 +426,10 @@ identical options and identical input files, multiple runs will create
identical output files regardless of the input files' owners, groups,
file modes, or modification times.
If @file{binutils} was configured with
@option{--enable-deterministic-archives}, then this mode is on by default.
It can be disabled with the @samp{U} modifier, below.
@item f
Truncate names in the archive. @sc{gnu} @command{ar} will normally permit file
names of any length. This will cause it to create archives which are
@@ -493,6 +498,16 @@ operation @samp{r} (replace). In particular, the combination @samp{qu} is
not allowed, since checking the timestamps would lose any speed
advantage from the operation @samp{q}.
@item U
@cindex deterministic archives
@kindex --enable-deterministic-archives
Do @emph{not} operate in @emph{deterministic} mode. This is the inverse
of the @samp{D} modifier, above: added files and the archive index will
get their actual UID, GID, timestamp, and file mode values.
This is the default unless @file{binutils} was configured with
@option{--enable-deterministic-archives}.
@item v
This modifier requests the @emph{verbose} version of an operation. Many
operations display additional information, such as filenames processed,
@@ -2386,12 +2401,26 @@ Show the version number of @command{ranlib}.
@item -D
@cindex deterministic archives
@kindex --enable-deterministic-archives
Operate in @emph{deterministic} mode. The symbol map archive member's
header will show zero for the UID, GID, and timestamp. When this
option is used, multiple runs will produce identical output files.
This is the default unless @file{binutils} was configured with
@option{--enable-deterministic-archives}.
@item -t
Update the timestamp of the symbol map of an archive.
@item -U
@cindex deterministic archives
@kindex --enable-deterministic-archives
Do @emph{not} operate in @emph{deterministic} mode. This is the
inverse of the @samp{-D} option, above: the archive index will get
actual UID, GID, timestamp, and file mode values.
This is the default unless @file{binutils} was configured with
@option{--enable-deterministic-archives}.
@end table
@c man end