| Issue |
87012
|
| Summary |
[libc++] How to override a single setting in __availability?
|
| Labels |
libc++
|
| Assignees |
|
| Reporter |
aheejin
|
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
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs