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

    <tr>
        <th>Summary</th>
        <td>
            llvm::MachO::InterfaceFile::symbols 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>
          MaskRay
      </td>
    </tr>
</table>

<pre>
    https://github.com/llvm/llvm-project/blob/0991bd7887a313d4d6bb66ca44d11939ad71b660/llvm/include/llvm/TextAPI/InterfaceFile.h#L447 `std::unique_ptr<SymbolSet> SymbolsSet;` is implemented as a `using SymbolsMapType = llvm::DenseMap<SymbolsMapKey, Symbol *>;`, which has a non-deterministic iteration order in `LLVM_ENABLE_ABI_BREAKING_CHECKS=on` builds (`hash_combine(hash_value(Key.Kind), hash_value(Key.Name))` uses a non-deterministic seed #96282).

This hade made `lld/test/MachO/dead-strip.s` flaky until I fixed by it with ceeea9193726ff3ceeee48e0e121ac25ac12cef0.
The fix is imperfect, since it's better for `llvm/include/llvm/TextAPI/InterfaceFile.h` to provide a stable iteration order.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlEtz4zYMxz8NfeFEQ0KyHgcd_FLrcZx2NplePXxAFrsUpYpUsv72HcpJM-32kgslABTwI_GHhPfm6hBrst6S9X4l5tANU30W_vs3cVvJQd_qLoTRk3RDoCHQXE3oZpmooSfQWPv68XgYp-FPVIFAI-0gCTSsqrjURVkWIuWpznQuZZ4rkWWa8yqthC64zHP2mcc4ZWeNn44X_BE2vx8JNEcXcGqFwsZYTDoC6WOWFZTkzAcd4dLN7MxfM17GMJF093zr5WCfMZD0QO-GX6wtyRk1npp-tNijC6ip8FTEVLM37vqx-yzGl9uIlKR7uuAsRfboPJ7F-E-JuO-ENwK79w8pgQ1JD_dK0f3WGdXRbiniBvegMeDUG2d8MIqagJMIZnB0mDRO1LhI8vj4x_lyeNpsHw-XzfZ42X47bE7Hp18uu18Pu9MzSfeDiweRs7HaUwIlyVknfHdRQy-NQwLlYr4KO0fjhLfkZJwmUEWmn2JPosclVsW0s8f_p_WImhJIqxxKIFAlhO0J29zXl8542gmNtI8LyZm1mkAT0EdZnIXqfiPQaBT6wYfJjImPxVorvt_o7IKx9Ehb8wM1lTdqAn0zoaMKEUXFq7SAvG3TaGJWIkMOXChYC8VBYcuSDwiMOd5bjFO7aHJHvXEKqQkECk8lhoATbYfpTvlV9eWMhoGO0_BqNFJBfRDS4n97-U600nWqo95XWPOCVzmv8ipddXUOXAspsnINJS-YLJjKVFYp1qq1LnO9MjUwyFgOFWOs5GnCy0orWag1Aw5aI8kY9sLYJBInw3RdGe9nrKuCQ7GyQqL1y2gDOHyjS5AAxEmf6mVq5Xz1JGPW-OA_swQTLNafqr-3bnn911XcXf4-CPHKf1LMap7s1_8gC6gn0NwP8lrD3wEAAP__tKp82A">