<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71037>71037</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[compiler-rt][libfuzzer][iossim] How to build libfuzzer libraries for iossim?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Picasso-r
</td>
</tr>
</table>
<pre>
I built an iOS app demo on my Mac using Xcode and now I want to fuzz it with LibFuzzer. After reading the LibFuzzer documentation, I found that it has a feature to use LibFuzzer as a library. However, when I modified my code and tried to link `libclang_rt.fuzzer_no_main_osx.a`, I encountered an error:
```
In /usr/local/Cellar/llvm/16.0.6/lib/clang/16/lib/darwin/libclang_rt.fuzzer_no_main_osx.a(FuzzerCrossOver.cpp.o),
building for iOS Simulator, but linking in object file built for macOS,
file '/usr/local/Cellar/llvm/16.0.6/lib/clang/16/lib/darwin/libclang_rt.fuzzer_no_main_osx.a' for architecture x86_64
```
>From my understanding, I need to specify the target architecture as iossim when compiling compiler-rt to obtain the corresponding library: `libclang_rt.fuzzer_no_main_iossim.a`.
I'm not sure about the specific terminal command for this( New to this area. T^T). I'm hoping to get some help here.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VE9v5LYP_TSaCxHDlmc8MwcfssnP-AVomwLZQ28BbdNjtrJo6E9mk09fSM4mW6BobwV8MCWKenzvUeg9XyxRqw5f1OF-hzHM4tpfeUDv5cbtehlf2wfoI5sAaIEfnwDXFUZaBMTC8go_4wDRs73Ab4OMBGhHsHKFB7iiDRAEpvj2BhzgymGGn7jv4tsbuQJup0AOHOGYToeZPjdhlCEuZAMGFqv0HTzAJNGOEGYMqdiMHhAmwhAdpVui__F83jXcO3SvBfxfrvRCLtW5zmThARYZeWIaUwcfsINLK0HAsP0DVFMa7geD9vLsQjHlws9Wnhdk-yz-W4GqKTdsZAeJNpCjMdFEzolT9a0q71V5m7K2L4cPFpTuondKd0YGNEp3d2QM5gXzsijdVU1RFk2KuVe6yyDy8sfSiO7Kdgv_GaM-bZzcOfH-8YVcMaxrIUqfE_YNUxI4qzCJyyI_8RINBsmc9TFkSlICW5D-dxoCTGzo3Rnp1ILD45PSd1vBvKn08b_t9JiRoBtmDjRkZ3w7Nc_N_m-F6JwsSf9oR3I-oE0MbHpa2ozgVxp4es3mDOguFP5aHT2weM_L5qtBlpVNomn7I3fj8ghIH5BtLjOIc-RXybd9t6iqb__Fb9s12XLFu4-UPi5gJYDPUHqJId-wgeYBArmFLZqEZkkGT-yEmb3SJ_iFrglZCgEdYQFf1eF_X5U-F7CVnmXNgymQ-vayEMxkVpjJUbEb23o812fcUVs159O52ldVvZtbrOk0NVWp8TBS35x7qqqxJDzta0Rdn3fc6lLXVVXq8lQfqrrYY13pamzOeqr740BqX9KCbIpkkULcZcfeR2qPVVkfdwZ7Mv77i-XalHTTx4tX-9KwD_7zWOBg8tv2gxrqcK8OXwz3G79buJGrDvfppUgN53mAj6x3mZj8NiBbet3tojPtHMLq07DrTunuwmGOfTHI8unxDHF1ksZG6S5345XuckN_BgAA___yWNjR">