moosichu / zar

An attempt to write an archiver using zig

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create unique timestamps for darwin target in deterministic mode

moosichu opened this issue · comments

https://github.com/llvm-mirror/llvm/blob/2c4ca6832fa6b306ee6a7010bfb80a3f2596f824/lib/Object/ArchiveWriter.cpp#L389

I came across this when researching how llvm ar did something else.

Specifically:

in deterministic archive mode (which
is the default), on Darwin we will emit a unique non-zero
timestamp for each entry with a duplicated name. This is still
deterministic: the only thing affecting that timestamp is the
order of the files in the resultant archive.

See implementation for details.