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

    <tr>
        <th>Summary</th>
        <td>
            [OSX][TargetLibraryInfo] strrchr is replaced to non-existed memrchr
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            platform:macos
      </td>
    </tr>

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

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

<pre>
    On Mac OSX (macOS version 12.4, sdk version 12.1) llvm can replace call to `strrchr()` with call to `memrchr()` when string length is known at compile time. This results in link error, because `memrchr` is not present in `libSystem`. It is needed to disable this optimization in `TargetLibraryInfo` for affected OSX versions. 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkUstu2zoQ_RpqM4hAjx62FlokNzAQ4BZeOItsSWoksaZIgRwlTb--oGqgQbsiQJyZM-ehUrKTJ-pF8ySa50JtPIfY39aB3gsdhs_-4uGbMnC5voHA06LM5QrvFJMNHg5Y1gL_gzTcvv4dBHbg3PsCRnmItDplCIxyDjiAaGXiGM0cBZ4EdqKV8GF5_gpYaPkLMJOHxNH6CRz5iWewCW4-fHhQDCYsq3UEbBcq4XW2CSKlzXEC68FZfwOKMcR8rCajtkRfaVqZt_nAsEZK5DlPiVY6q6-fiWkRrSzhhXcU0UBDvnOwSelMmunCynaxPxVnD35Pv6o4Ef9vdVTx88WPIfOMIYIaRzJMw27q3bdUQjH01dBVnSqoP7SnQ3esD4jF3FdandoDHrWuUDVDRaeOSB2x1aNsqGkL26PEStYo5VGixHJspc7IWnVVbVQrakmLsq7MqZQhToVNaaO-RWzqwilNLu0VQFyd4jHERVSPizIhCcRcjNjn0Qe9TUnU0tnE6c8ytuz2Cl2ub6J5Fs3Tv9qbZ7jHDns6eyl2H33wD_TDpuzIPZFii66fmdckqkeBZ4HnyfK86dKEReA5M9-fhzWG72RY4HnXlASed1m_AgAA__9vfPAz">