<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61920>61920</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
The dsymutil tool left a directory in the tmpdir.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
578559967
</td>
</tr>
</table>
<pre>
dsymutil creates a temporary directory in tmpdir when it's working, but forgets to remove it upon exiting.
This issue has been present since clang 14.0.3 or earlier, but not before 14.0.0.
It causes Golang compilation to fail on Mac. See https://github.com/golang/go/issues/59026.
Here is how to reproduce :
```bash
$ cat test.c
#include <stdio.h>
int main() {
printf("hello\n");
}
$ mkdir tmp
$ TMPDIR=$PWD/tmp clang test.c -o test.o -ggdb -c
$ ls tmp
$ TMPDIR=$PWD/tmp clang test.o -o test -ggdb
$ ls tmp
$ TMPDIR=$PWD/tmp dsymutil -f test -o test.k
$ ls tmp
dsymutil-5f58bc
$ clang --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
```
Until clang 15.0.7, this issue still exists.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVMGOpDYQ_RpzKWEZg7vhwGF2Op2stCutkolyNqYAZ4yNbDO98_eRgd4dTaQ5JFKrsavKr57l90qGoEeL2BLxiYhLJtc4Od-Kcy1E05zOWef617YPr_MatQHlUUYMICHivDgv_Sv02qOKzr-CthDnpdcebhNa0JHwc4Cb88_ajoQ_QrdGGJwfMQaIDjzO7gVBR1gXZwG_66jtSAm7EPbwNOkAOoQVYZIBOkQLi8eANkLQViEoI-0IRUUZLcF5QOmNRn9vZF2EDgfnca9hB_DnCEquAQP86jYE5eZFGxm1s4nVILUBZ-GrVBT-QIQpxiWQ8oHwK-HXUcdp7ahyc9psCNuC8OvGNhB-FQ3jp6Pd_v8begQdYHK3_eaLd_2qEBLuXndi-6-TYTpCvAIlI0QMkap7rNRWmbVPRx9D7LWjEyl_edtM2wiz1JbwmvAGyPnTHofFaxuHLcwnNMYR8WgJ54Q3pDyKyPnyFitxmJ_Tm8Z5eZ94-vrt8vl3Ul4Ir779dSH8GufleJedNORuXznIx7HvIFfvQUz4T9DuDr0D_x_UH_LOhwPxIP38Eer9VC4GUXf_utZONc9f0IekrD3zsCzmrtx75lAw4fUWz4uKlZRRzmlR0SK9zW4ImYxDygeQfj5VuUxQeS_9TVvOaUnZ3TgeZQ-z69Gk6sUF_f2Qvg1RGoP9RfuUIvz6RXfJxYRfL_iCxi3JQNdHN8_S9l-0xSfnTNL0GlKi0_adXPftn3YbD7sjBWX0nGwYf3o4RG1MsniIgWZ9W_ZN2cgM2-JUM3Eui0pkU8tkXZ-rQaESfalkjU1RV1LUqhJ9N3Ce6ZYzXrKKVawQnAsqygplhbwRp6JmAknFcJbaUGNeZur8mG3921PRcJYZ2aEJ27Dj3OJtJ5ccIC6Zb9OZvFvHQCpmNqY_UKKOBtunCX-qJTpnwOAQQb4bghMeg5BmqzftBwMk4R-ffPHub1Tx7SDZWP8TAAD__38Mtzo">