Date: Tue, 5 Oct 2010 23:00:47 -0700 From: Tim Kientzle <tim@kientzle.com> To: Erik Cederstrand <erik@cederstrand.dk> Cc: FreeBSD Hackers <hackers@freebsd.org> Subject: Re: Timestamps in static libraries Message-ID: <140AD250-ECD1-4BCF-806B-F5901B3BFD87@kientzle.com> In-Reply-To: <C5C85BF7-3989-461E-A9C8-9D16AE779359@cederstrand.dk> References: <52C32EA5-A380-4237-A27C-9E2DF2D4E022@cederstrand.dk> <20101005135906.GA3430@owl.midgard.homeip.net> <C5C85BF7-3989-461E-A9C8-9D16AE779359@cederstrand.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 5, 2010, at 2:47 PM, Erik Cederstrand wrote: > Den 05/10/2010 kl. 15.59 skrev Erik Trulsson: > On Tue, Oct 05, 2010 at 03:28:36PM +0200, Erik Cederstrand wrote: >>>=20 >>> I was using bsdiff for the compression and found out >>> that md5 sums of static libraries (.a files) in /usr/lib and >>> /usr/local/lib didn't match between jails, even though the source >>> code used to create the jails hadn't changed. One of my goals is to >>> detect which files in a distribution change between two commits. >>>=20 >>> It turns out that timestamps are stored in the library: >>=20 >=20 > Thanks, that was very helpful. It seems I can at least normalize the = .a files ... Unfortunately it seems there's still a creation time of the = archive itself that I cant alter using the above, so the md5 sums still = don't match: >=20 > % diff mod.strings orig.strings > 2c2 > < / 1286312209 0 0 0 958 ` > --- >> / 1269146263 0 0 0 958 ` That's the timestamp on the pseudo-entry used to store the archive symbol table. (GNU/SysV ar files use a pseudo-entry named "/" to store the symbol table. Since '/' is added to end of names in this format, this is essentially an entry with an empty name.) The current ar code generates this entry and sets the timestamp around line 624 of usr.bin/ar/write.c. As far as I can tell, ar itself doesn't care about the timestamp here; it's possible that ranlib or ld do care. If they don't, we could set this timestamp to zero always. Tim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?140AD250-ECD1-4BCF-806B-F5901B3BFD87>