<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87012>87012</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] How to override a single setting in __availability?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
aheejin
</td>
</tr>
</table>
<pre>
WebAssembly's emscripten toolchain (https://github.com/emscripten-core/emscripten) has been using `_LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT` not to pay for the increased code size of `__libcpp_verbose_abort` so far. But after https://github.com/llvm/llvm-project/pull/71002, that macro does not exist. We don't provide our own vendor annotation, and defining `_LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT` as 0 is overridden by this line:
https://github.com/llvm/llvm-project/blob/38f5596feda3276a8aa64fc14e074334017088ca/libcxx/include/__availability#L138
I read the discussions in that PR that it is recommended to create our own availability markup like Apple:
https://github.com/llvm/llvm-project/blob/38f5596feda3276a8aa64fc14e074334017088ca/libcxx/include/__availability#L163
But to do that it looks we have to copy the whole list of macros here
https://github.com/llvm/llvm-project/blob/38f5596feda3276a8aa64fc14e074334017088ca/libcxx/include/__availability#L86-L161
and copy-paste them to our section in order to just change the one line (`_LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT`). Is this the recommended way of changing one setting? Is there a way we can control this elsewhere?
This doesn't necessarily have to be about `_LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT`, but it can be more general question about what is the recommended way of toggling one setting without copy-pasting dozens of settings to add another `ifdef (__SOMEPLATFORM__)` in `__availability`.
A similar concern was posted in https://github.com/llvm/llvm-project/pull/71002#issuecomment-1914720293 by @wang-bin.
cc @philnik777 @ldionne
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVl-P2jgQ_zTmZQRKHMifBx6gbVQkervarlrdU-TYE-KusXO2A6Wf_jSh12V7ujut7qUS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