<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65061>65061</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
BOLT does not respect umask
</td>
</tr>
<tr>
<th>Labels</th>
<td>
BOLT
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zmodem
</td>
</tr>
</table>
<pre>
My umask:
```
$ umask
0027
```
Building a program with clang creates an executable with the expected permissions:
```
$ echo 'int main() { return 0; }' | bin/clang -x c - -Wl,--emit-relocs
$ ls -l a.out
-rwxr-x--- 1 hwennborg primarygroup 17464 Aug 29 11:16 a.out
```
However, processing with BOLT will generate an executable with `0777` permissions, both for instrumentation:
```
$ bin/llvm-bolt a.out -instrument -o a.out.instr
$ ls -l a.out.instr
-rwxrwxrwx 1 hwennborg primarygroup 6339568 Aug 29 11:17 a.out.instr
```
and optimization:
```
$ ./a.out.instr
$ bin/llvm-bolt a.out -o a.out.bolt -data=/tmp/prof.fdata
$ ls -l a.out.bolt
-rwxrwxrwx 1 hwennborg primarygroup 4199680 Aug 29 11:19 a.out.bolt
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMlE9vnDwQxj-NuYyMjGH5c-CQ3RV6D2_VS6WeDZ4Ft8ZGtslu8ukrIGmyKlEiWZY8DON5fh49wnvVG8SaHI7kcI7EHAbr6ufRShyj1sqn-tsTzKPwv0n6QNiZsNc9Zy9rO_LsJW09MsaL_bx1P85KS2V6EDA52zsxwlWFATotTA-dQxHQgzCAN-zmIFqNW0IYEPA2YRdQwoRuVN4ra_znzWE3WCC8UCbAKJQhvCS8AlIcwWGYnQFG0iOQ4kx4AaQ4QbskNVtL9AYdUKA_NeEnSnFUgTrUtvNvN2gPVIOI7Ry2IHXXm6M3SikkMFzRmNa6HianRuGeemfnCZIiyzN4mHvgFSQJSR-S_H2NXXz_2Ss-oiP8tODr0PuF5Qro-P3_H3BVWkOPBp0IuIeR5IwVRUFydgeRn6C1YYCLdaCMD24e0QQRlDWfA95waf040tbqsIkA-lYHqN2C8RrbBff-04pvXR_jy9O0OuTlPcBi55o9jMJIsFNQo3r-osaY8GZXwgfiXwWvMSpFECQ9E96EcSK8mZy9xJc1usti-evrKLKkqvKS3aOo_in1V1Uk61RWaSUirJO8SlOWpDmPhpoVMhMX2XWiysu2lCV2B9FWmShbmcsLj1TNGU9ZyStW8YrzOEsEYiKZTIS8pNmBZAxHoXS8AImt6yPl_Yx1fmB5EmnRovar43C-zCvhfPEeV2_85t6TjGnlg38rEFTQWK_TLS16MDaAQ784weY70ex0PYQwrV7AG8KbXoVhbuPOji9v8_pEk7O_sAuEN2tfnvBmbe1PAAAA__9IW4W1">