Skip to content

Commit e4d4bc7

Browse files
committed
Disable __libcpp_verbose_abort directly in code
In #20707 we decided to disable `__libcpp_verbose_abort` not to incur the code size increase that brings (it brings in `vfprintf` and its family). We disabled it in adding `#define _LIBCPP_AVAILABILITY_HAS_NO_VERBOSE_ABORT` in `__config_site`. That `_NO_` macros are gone in LLVM 18.1.2, so I changed it to `#define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT 0` 2bd7c67 But apparently, when including `__availability`, that setting is overridden by this line: https://github.com/llvm/llvm-project/blob/38f5596feda3276a8aa64fc14e074334017088ca/libcxx/include/__availability#L138 because we don't define our own vendor availability annotations https://github.com/emscripten-core/emscripten/blob/193b2bff980529dbf5d067f01761ed8a6e41189f/system/lib/libcxx/include/__config_site#L4 I asked about this in llvm/llvm-project#87012 and llvm/llvm-project#71002 (comment) (and more comments below) but didn't get an actionable answer yet. This disables `__libcpp_verbose_abort` in the code directly for now, hopefully temporarily.
1 parent 72283aa commit e4d4bc7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

system/lib/libcxx/include/__config_site

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@
66
#define _LIBCPP_ABI_NAMESPACE __2
77
// Emscripten doesn't use PSTL at the moment.
88
#define _LIBCPP_PSTL_CPU_BACKEND_SERIAL
9-
// __libcpp_verbose_abort creases code size too much
10-
#define _LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT 0
119
#define _LIBCPP_HARDENING_MODE _LIBCPP_HARDENING_MODE_NONE
1210
#define _LIBCPP_HAS_NO_TIME_ZONE_DATABASE

system/lib/libcxx/include/__verbose_abort

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ _LIBCPP_NORETURN _LIBCPP_AVAILABILITY_VERBOSE_ABORT _LIBCPP_OVERRIDABLE_FUNC_VIS
3838
// make sure that the program terminates but without taking any complex dependencies in this header.
3939
#if !defined(_LIBCPP_VERBOSE_ABORT)
4040

41-
# if !_LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT
41+
// XXX EMSCRIPTEN __libcpp_verbose_abort creases code size too much
42+
# if !_LIBCPP_AVAILABILITY_HAS_VERBOSE_ABORT || defined (__EMSCRIPTEN__)
4243
// The decltype is there to suppress -Wunused warnings in this configuration.
4344
void __use(const char*, ...);
4445
# define _LIBCPP_VERBOSE_ABORT(...) (decltype(::std::__use(__VA_ARGS__))(), __builtin_abort())

0 commit comments

Comments
 (0)