svn commit: r213643 - head/usr.bin/ar
brde at optusnet.com.au
Fri Oct 15 00:42:29 UTC 2010
On Thu, 14 Oct 2010, Erik Cederstrand wrote:
> Den 13/10/2010 kl. 05.55 skrev Bruce Evans:
>> I also don't like distributions that stamp every file with their release
>> build time (or maybe a little later, with a single release time). How would
>> do you prevent clobbering metadata outside of archives? What I do is install
>> with -C -p (and also -v -v to report changes), and then compare installed
>> copies or just look at the install -v -v output.
> What does install(1) do to determine if files are different, if not mtime, size or checksums? Metadata like OBJDIR, SRCDIR, timestamps and user email address might still differ, even though the binaries are functionally equivalent. Would strip(1) or objcopy(1) be able to remove or alter these?
install(1) mainly compares bytes. Thus it can consider changed metadata
in inodes (mainly timestamps) to be irrelevant. This cannot handle metadata
(like timestamps) within the file. strip(1) and objcopy(1) will clobber
external timestamps, at least if they change the contents. install -p is
partly to recover from such clobbering (but install has special knowledge
of strip, and IIRC it uses the timestamps of the unstripped file).
Sometimes they will remove internal metadata and thus allow the modified
files to compare equal. A usful example of this is stripping debug info.
Just adding a comment in a new line in a C source file will change the
line numbers in the debugging info for all subsequent lines (that generate
code). Putting build dates in object files using __DATE_ and __TIME__ in
C source files would be less annoying if they were put in a separate
section that could be stripped, but this is not very easy to at the
source level. Version control ids are already normally put in a special
section, but I think it has other stuff in it that must not be stripped.
Normally you shouldn't strip them, but they might affect the object files
too much if they contain too much info about the checkout place or time.
More information about the svn-src-head