libstdc++: Downgrade DEBUG to ASSERTIONS when !HOSTED
authorArsen Arsenović <arsen@aarsen.me>
Tue, 4 Apr 2023 17:25:09 +0000 (19:25 +0200)
committerArsen Arsenović <arsen@aarsen.me>
Wed, 5 Apr 2023 16:45:14 +0000 (18:45 +0200)
commitbff26ac162772313d3d9b8ce952b5a0846e26878
tree754e0a573fd17701fe8a933277e8462063231908
parent6f0d67b912900009bff5018bd58e17ea1db1de69
libstdc++: Downgrade DEBUG to ASSERTIONS when !HOSTED

Supporting the debug mode in freestanding is a non-trivial job, so
instead, as a best-effort, enable assertions, which are light and easy.

libstdc++-v3/ChangeLog:

* include/bits/c++config: When __STDC_HOSTED__ is zero,
disable _GLIBCXX_DEBUG and, if it was set, enable
_GLIBCXX_ASSERTIONS.
* testsuite/lib/libstdc++.exp (check_v3_target_debug_mode):
Include <bits/c++config.h> when determining whether debug is
set, in order to inherit the logic from above
libstdc++-v3/include/bits/c++config
libstdc++-v3/testsuite/lib/libstdc++.exp