<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61914>61914</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang creates call to non-existant libcall for half float complex division on arm64-apple-darwin
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SachaBallantyne
</td>
</tr>
</table>
<pre>
For the program:
```c
_Complex _Float16 f(_Complex _Float16 a, _Complex _Float16 b) {
return a / b;
}
int main() {
_Complex _Float16 a;
_Complex _Float16 b;
f(a, b);
}
```
Trying to compile this on mac leads to
```shell
$ clang test.c
Undefined symbols for architecture arm64:
"___divhc3", referenced from:
_f in test-0456a9.o
ld: symbol(s) not found for architecture arm64
```
This is due to compiler-rt builtins not supporting half float for complex division, so clang relies on getting this from libgcc which is not present on mac.
The version of Clang was built from [this commit](https://github.com/llvm/llvm-project/commit/2a76429778768ed29404f0396194636e2bc11b90)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUlMuOrDYQhp_GbErdAnNfsJiLeIEk65Yv5caRsZFtZs68fWTDKHNmOou0WoDLrqq_vh_BQtB3iziR9pm0rwXb4-L89AcTC3tmxjAbPywW3MmPaXYe4oKweXf3bCX1E5DylZRPpCuPvzjWtxe3bgZ_wW02jsWqA0Xo8DPKCH2Bn2FO6Aikfz6KwfnzGHdvgQGhM3BSn9ukfz0f8lXbCCvTltDh9yqPutffWjyS8v1MmiTrTiofqPhEcSz_9B_a3iE6EG7dtEGIiw7gLKxMgEEmQ9r8lhsWNOaM0QaEYakGhng9Af9lJSptUUL4WLkzAZTzwLxYdEQRd4_A_No1pH76VE8ovd1uUr8toiaUpgk8KvRoBUpQ3q1fDmcYCrTNXS9l03ZsvLpj28jk_NGY0CEkztZFUG638r-EPIJzIkpAdAC54xdO_uIj8F2bqG3I5cO-bc7HhHNhRoFKFuV24nRN6jcdtLNptuBObB6Nxkz8jjFnZwfSwGA0vwsB74sWS5KQ2mweA9p4WnT9XSnCG_rUApyCl1z_nYVD51GStM-5vnDrqiNpXwkdlhi3kOjSmdD5ruOy86twK6GzMW-ft8vm3d8oIqHzmUxnyvquoWPfD303oKRjUzaqrMeuGpuu7pByUVV8LAkdCznVcqxHVuBUdUPZ1n3VV8Uy8Vo2vFUDjlxKqvg4tENXsbovqUJV0UJPtKR12ZR11ba0ra4KS9lTXlU9yoGJhjQlrkyba5J5df5e6BB2nLpqrJrCMI4mfH4__JRn4fs9kKY0OsTwb1rU0eB0cBMeWcQAghmTfLfOXvCXDpHZmIzJ8eTuF7O_G51Myq_XhW2bwYtk_l3bYvdm-t_M80iB0DlP9U8AAAD__4Ojk8Y">