Commit ee5ae8c
[OSX][TargetLibraryInfo] Mark memrchr as unavailable on OSX
On Mac OSX (tested version macOS 12.4, sdk 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.
This non-standard function (`memrchr`) is not present on (at least) several versions of MacOS https://www.gnu.org/software/gnulib/manual/html_node/memrchr.html , so, in this patch `memrchr` is marked as unavailable for all versions. If someone knows versions where it should be available - please let me know.
Github issue: llvm#62254
Tests for this feature also cannot be easily added: https://reviews.llvm.org/D134134#3801747
~~~
Huawei RRI, OS Lab
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D155168
(cherry-picked from a7a6ef3)1 parent 829efb1 commit ee5ae8c
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| |||
0 commit comments