Skip to content

Set ZERO_AR_DATE=1 for deterministic static libraries on macOS #494

Closed
@luser

Description

@luser

Just the other day I learned that Apple's ar tool has an undocumented environment variable that you can use to get it to zero out timestamps so you get reproducible archives! Setting ZERO_AR_DATE=1 apparently triggers this behavior.

Here's the source for reference:
https://opensource.apple.com/source/cctools/cctools-949.0.1/misc/libtool.c.auto.html

It's also mentioned in this LLVM blog post:
http://blog.llvm.org/2019/11/deterministic-builds-with-clang-and-lld.html

This would help fix mozilla/sccache#169 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions