[cfe-dev] Clang and binary Reproducibility

David Blaikie dblaikie at gmail.com
Sun Mar 22 10:14:29 PDT 2015


On Sun, Mar 22, 2015 at 9:35 AM, Joerg Sonnenberger <joerg at britannica.bec.de
> wrote:

> On Sun, Mar 22, 2015 at 08:08:53AM -0700, David Blaikie wrote:
> > if by 'binary reproducibility' you mean two matching invocations of the
> > compiler (same arguments, same input, same headers, etc) should produce
> > exactly the same bytes in the binary - yes, Clang supports this.
>
> You might need to pass -frandom-seed for this purpose, e.g. a hash of
> the name of the input files + some project cookie.
>

Good to keep in mind, in general.

I /believe/ only specific opt-in features use randomness deliberately (as a
security threat mitigation, is one instance that comes to mind). If
anything that doesn't look like an explicit "Randomize my stuff" flag
causes non-reproducible output, that's probably a bug.

- David


>
> Joerg
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150322/1b50f764/attachment.html>


More information about the cfe-dev mailing list