emscripten-core / emscripten-core/emscripten
Should we ship NDEBUG (no asserts) versions of system libraries
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Our use of NDEBUG to disable asserts in system libraries is inconsistent today:
libcxx: Always define NDEBUG
libunwind: Always define NDEBUG
libmalloc: Defines `-debug` variant which doesn't define NDEBUG
libstubs: Defines `-debug` variant which doesn't define NDEBUG
libstandalonewasm: Always define NDEBUG
All other libraries do not define NDEBUG which means they include assertions. This includes libc, compiler-rt and libwasmfs.
For most of libc its not a huge deal since musl doesn't do at lot of asserting, but where have modified musl (for example in the pthread code we do have a bunch of asserts).
I guess we should probably define `-debug` versions of all libraries and link them when `ASSERTIONS` is enabled?
Contributor guide
Assessment
This issue has not been assessed yet.