<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59438>59438</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang: support __attribute__((__symver__("...")))
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bnoordhuis
</td>
</tr>
</table>
<pre>
clang does not seem to support gcc's `__symver__` attribute (also spelled `symver`). It would be nice if it did.
gcc documentation: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes (sorry, I can't seem to link to a specific entry - it's about 4/5th down)
My workaround looks like this:
```c
#ifdef __clang__
__asm__(".symver foo,foo@@V1.2.3");
#else
__attribute__((__symver__("foo@@V1.2.3")))
#endif
void foo(void) {}
```
Other people/projects seem to hit this as well, ex. https://github.com/OpenMandrivaAssociation/kernel-rc/blob/087b62e4c6c036c4cf79558891b6851a67b2f684/linux-5.16-clang-no-attribute-symver.patch
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU02PozgQ_TXmUgKZInwdOKS7hTSH0dz2ioxdBG-MjWzTPfn3K0In0xrtrkaybAqK56r36okQ9MUSdax8YeVbIrY4O9-N1jmv5k2HZHTq1kkj7AWUowDWRQhEC0QHYVtX5yNcpGRYB2AVH4ZwW97JDwOrOIgYvR63SMCwESY4CCsZQ2pPPRJZxRm2GXyL8OE2o2AksFoS6Al0BKVVxvgb4-djv0gJysltIRtF1M6y4gxzjGtgxZlhz7C_SJld7JY5f2HYO2u0JeVkOD4x7F_dsjib9puVO0J6flQZsjkuhmHx3xl7I8F5f2P4Ct9ACsuw_sWI0fa6n2JvVOpJSyAb_Q1S0PHOkRjdFuHEsC_jDMp9WIbt1w6_3-DD-avwbrMKjHPXAEZfCeKs700euRU_lvyMsdCTogmG4S7WMBzvh0GEZRgYNgwxOyiHyTmGr_t-4uzE_8ozzAqGuFdSvDwByQR6ojwY-MRqvgh9x_53tGM9Aa3S0xG9O62OOpr9kWELrH5h9dtv7R3hjziTh5Xcaohhv3r3N8kYnrTPOt7pARHgg4zZxaGf2e-DoeO8jZl0C8P-x0r2u7DK63dxDsFJfYwT9lfylkzq91EZjRsZ9rypxwrpJCvJi0qe5FS3Zdk0bT5WTZmLqh5xqppdVaPt9jMts7xK70Kk1qVP8tKDs2wVUc6J6grVFq1IqMurmtcVrxtM5k7yKqe2xJrGqsjruhA1CVWJZpTTVI5lojvkiDnmeY55wTHjQtXUFjQVRVW0UrETp0VokxnzvuxGSHQIG3VleyqaxIiRTHhY3nd7Ujpul8BO3OgQw6_foo6GDvvvRnsY_g_mIcuyrzOQbN50_yPHfuPnkX7Ky7C_V70b9174PwEAAP__RB93AA">