Skip to content

libc.a is not built reproducibility/deterministically #398

@PieroV

Description

@PieroV

When building libc.a in different machines with identical configuration, I get a different results.
It seems that the problem is the order in which the archive is created (I see some wildcard in the Makefile, but adding $(sort ) to them is not enough).

As a result, a Firefox with WASI sandbox cannot be built in a reproducible way.
Reproducibility matters to several projects, like Debian or Tor Browser (disclosure: I am a Tor Browser developer).

As a workaround, I created a Python script to re-create libc.a, but I wonder if something can be done to create libc.a deterministically in the first place (maybe some tweaks to the Makefile are enough).

Please notice that extracting libc.a with llvm-ar x libc.a and then creating it again with a sorted input list does not work, because the archive currently contains two errno.o, and also some object files without a name.

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