<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/72206>72206</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            llvm17/rust: random variations in binaries
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          bmwiedemann
      </td>
    </tr>
</table>

<pre>
    While working on reproducible builds for openSUSE, I found that
various rust packages produced different binaries in every build,
even when trying to run builds as similar as possible.

versions:
* openSUSE Tumbleweed 20231108
* libLLVM17-17.0.4
* rust-1.73

affected packages:
* contrast
* difftastic
* rage-encryption
* sad
* tiny

Diffs (from `filterdiff strings {1,2}/usr/bin/sad`) look like this:
```diff
 _ZN12aho_corasick6packed5teddy7compile7Builder5build17h1ec13fda1b911f51E
-_ZN71_$LT$sad..argparse..Arguments$u20$as$u20$clap_builder..derive..Args$GT$12augment_args17hb63754f2b3f23d81E.llvm.7060706947469140631
 _ZN9hashbrown11rustc_entry62_$LT$impl$u20$hashbrown..map..HashMap$LT$K$C$V$C$S$C$A$GT$$GT$11rustc_entry17h3404a67c5ebadd16E
...
 _ZN4core3ptr37drop_in_place$LT$sad..types..Fail$GT$17h4a94ee46810be113E.llvm.8642040941601995225
+_ZN71_$LT$sad..argparse..Arguments$u20$as$u20$clap_builder..derive..Args$GT$12augment_args17hb63754f2b3f23d81E.llvm.5074700338430727270
 _ZN5tokio7runtime9scheduler6Handle5spawn17he9d3e7b13daae14fE
...
 anon.f8976536234e6da06679650d2fbaaa4b.3.llvm.2679463096021464399
-anon.cf22f61d4b59a658db753519f084dfc2.29.llvm.7060706947469140631
 anon.cdafd13cf3071da50e39cc55ae689763.5.llvm.15702125857252448827
@@ -40685,6 +40684,7 @@
 anon.865f8e79028a90f3ec901722c5bc9a01.1751.llvm.141406229195693483
 anon.a3ee08d29b32c89866319fa543dc03d1.3.llvm.17006684412476199951
 _ZN61_$LT$std..io..stdio..StdoutLock$u20$as$u20$std..io..Write$GT$5flush17ha20f2e5d3ef392cdE
+anon.cf22f61d4b59a658db753519f084dfc2.29.llvm.5074700338430727270
 rust_panic
```

so it seems there is some random number appended and that influences ordering.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVkuP7KgV_jXUBjXijVnU4nbfW5kod2ZzJzPSbEoYjsukbbAAd6v_feSu5yiJouwiWcLA4fu-8-Dhao2nBLBH6hmprzu3tjGXfT-_Rwgwu5R2fQ4f-9_HOAF-z-U1phPOCRdYSg6rj_0EuF_jFCoecsF5gfTj7z--If6C_4qHvKaA2-gaol8R_fLmSsxrxWWtDS_Ov7oTVHxGgoBDHAYokBruY3IlQsUxYXiD8nHmQPzlDARvkPD7CAm38rFJahmXNV2VuIprnOPkyva75Fo3neS89iIFSo05VSQuA4h_uanHv65zP8E7QMCccsEY7e5WU-y_f__tZ2aemCGUyPvM5tcTI0Y8MrlhAN8g3Bz-E6XPqRVX231ki0JztUX_AOxO8ATJl4-lxZzuE9WFe6fF9PHI_DUOQ8WId0PJM0aaDnFqUDYCXFuJ6VQxMs8M8ReOzFfED2stiB_6mBA_bNCaIm7xlPMrnuIr4DbGB_manr8N8DyEj3_8wrgb89Hn4mr0r3rzGoJqEMKH8Xle4gTmecsTFPWZL2ZGBp6JITjWW8YGxb6d4Z6Of_xi2BFx-f1XxGV1gRBXTosrFQj5Uk7rDKlVxOXKKeLS3X_95JZjf6YhJECJb-clm8lfNjTG3Xra1h9dOVVmxl4Lo-TAezFwETr2jUzT20wM1dRQbaWR2jJJtWB3Z-3o6tiX_J4Y27Lvj5Ba-dD8JjrOy3RTdbMmZHYLIT-5Ov7slqvt3xCXL4jL3y7tj0v75ar5pv2RjJlRSCqdNl5B70Jg-hI_QshdqvS5gFhaESaUvBxjOi6T8_Cn6LaPBSohBxenG5cZpbMSQOqO0R4YE5fIdFpyKqmVTFNmreJcXYvx-f8hc4oa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