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

    <tr>
        <th>Summary</th>
        <td>
            Windows `build-id` is non-deterministic
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Tried to enable the CET hardening option with
  `clang -fuse-ld=lld -Xlinker -Xlink=-cetcompat -Wl,-s test.c`
for Windows (I used llvm-mingw 20231128 with LLVM 17.0.6). This
automatically enabled a `build-id` segment (normally suppressed by `-Wl,-s`),
which is in turn different for each, otherwise bit-by-bit identical, build. It
suggests that the `build-id` is a random value, not a deterministic hash of
the output like it is for example on Linux.

Is there a way to enable both this hardening feature _and_ making 
reproducible builds on Windows? If not, would it be possible to make
`build-id` deterministic, or disable it with CET?

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkk0-PpDYQxT-NuZRAYPoPHDhseralkSa3UTa3lcEFVNrYyC5Pb-fTR4ZOspNcuhG4Xv1e-ZUKgSaL2InjL-L4kqnIs_PdR_hT3RSHrHf60b17Qg3sAK3qDQLPCJev7zArr9GSncCtTM7CnXgW5YsovwCIUzkYZSfIxxgwN1rUL8ZoyH83ZG_onw-ifskH5MEtq2LIvxkhL3kAxsDFIE7lLjc6D9_IancPIGTzCjGgBmM-lnwhO91BlrKuKtlsCPD29tuvUJ2LsjgJ2RbwPlPYhVRktyimQRnzePrRoBJtH8nonLQ4lRBwWtBy6mWdX7bDIa6rx5Aa949U8DdsopStkJe9xX2mYQYKQBY4eguaxhF9kks2UA2zkBdwPKO_U0DoifP-kffEQBrtBpdObEAFvPKuG-I0YeAAPCve7uA_0BRAgVdWuwU-lImYRKxjUKCR0S9kKTANMKswgxt32STkIq-RwdANIVGEnfSHWlaD4Cy8kY0_ir1g_31NHOgRFNzV46dw9I5n4JnCT_EYUXH0CN-V1d9hUbf0ctfxuHqn40BbbXITUsPnZYv6Cq9jMpG83F00OgH2CKsLYathlwTxyfZ5Ip9sb0P3oClsnMR7Vi5f30V93csz3dW6rVuVYVedy-pUntvDMZs7depr3ZzGc13ptlFHfZASD9g0x2M1Ns2QUbclUJZ1JY9SHou2bM4V9iddDW1b9ZU4lLgoMkUKbeH8lFEIEbvzQdZNZlSPJmxLKKXFO2wfhZRpJ323Bb2PUxCH0lDg8K8KExvs_tmN_yXCOpt_GkMWvelm5jWI-ouQVyGvE_Ec-2Jwi5DXpPz8y1fv_sCBhbxuPEHI68b7VwAAAP__Db1f5A">