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

    <tr>
        <th>Summary</th>
        <td>
            LLVM fails to build on 32-bit macOS
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          MarcusCalhoun-Lopez
      </td>
    </tr>
</table>

<pre>
    LLVM fails to build on 32-bit macOS with error:
```
error: no matching function for call to 'min'
                std::min(HashReadEnd - CurrHashReadPosition,
                ^~~~~~~~
note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('int' vs. 'long')
 min(const _Tp& __a, const _Tp& __b) 
```

The issues seems to be the use of `ssize_t` at https://github.com/llvm/llvm-project/blob/3c1483609369559ecb6b40c60ca0366759332767/llvm/lib/ObjCopy/MachO/MachOWriter.cpp#L524

If `ssize_t` is replaced with `std::ptrdiff_t`, the build works on both 32-bit and 64-bit systems.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU0tv2zAM_jX2RUjgSH7EBx-6tMUGpOiwFd0x0IOO1SmSIckt0l8_ym6wouhhMwSJIkXy-0haOHXu9vvHO9JzbQKJjohJG0WcJYyuhI7kxOX9T_Ki40DAe-czdpUV11lxldXF25qvFyOxDn2iHLQ9kn6yMmoM1jtPJDcmZchoc9IW98WRfPhCVCkHu5ofbb_yMPwArm6sIiuym7y_aL67oFPwjO4-j5RVN1nz2ZpfWxch4ZXcKq14BBLhNJok6KN1HhIMokBNEhSRzvZGIxlkFc8jhJnSyD0_QQSfSB0eRtxR2uKhbUyX57BOJuPsMRGm7RvShRsGDZHMfjU5HDgyIR90An3IpwVf9ocB4YYwIaAAcFpaiFRQPQUgrifoEIJ-hUNEifBIhhjHkEpMb3EdsbOTWEt3wosxz5djNXr3BBJZ3ArjEMYtk5tyy-qiZXVbVS1IUYuykHUhecHquqlaxmhTN-_i6OR3L552bjyjdMflcH85f3mNhVvLEZmyfUXL97S-fcStA_GA3Um9mIcxmS-TMkavdN_PL1MNE_tljl-c_x3SNAuHPm8jjQ0ndTmL4Ryw62G9ZM1Vx1TLWp5HHQ38y5-RT950_13RpWMoVOW2rPOha0RDoZSS8ZZRValN1Ve9UE0v23a7AZUbLsCELqu-ZJRaeFmajnJWXee6owWlRbkpKNvUZbFuBQje8lZCtUV9kZUFnJDHOuFYO3_MfTdDEtMxoNHoEMNfI8fCHy3AnA7j8ykOznd33Msp7LgZ3GRXezfCaz7D6GYafwCeG1DT">