[libcxx-commits] [PATCH] D122941: [libc++] Make the Debug mode a configuration-time only option

Danila Kutenin via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 3 08:42:23 PDT 2022

danlark added a comment.

In D122941#3425151 <https://reviews.llvm.org/D122941#3425151>, @ldionne wrote:

> In D122941#3425149 <https://reviews.llvm.org/D122941#3425149>, @danlark wrote:
>>> @danlark 
>>> This patch will break users of the randomized unspecified behavior you added since you are most likely not shipping a debug-mode version of the library today. Has it been in used internally at Google?
>> Thanks for adding me.
>> I confirm we haven't shipped anything with randomization to the (external) users and this patch should be fine with us as we build everything from source
> Just to make sure we're on the same page, here's what this change entails if you've been using randomization (even just internally): Out-of-the-box, you'll get a compiler error saying that you're using unspecified behavior randomization with a library that has been built without the debug mode. You'll need to switch to building the library with the debug mode enabled, i.e. `LIBCXX_ENABLE_DEBUG_MODE=ON` when configuring in CMake. However, that will also cause all the other debug mode checks to be enabled, which you may or may not want. And there will certainly be a slowdown associated to this, too. Is that fine, or do we need to make it possible to use unspecified behavior randomization without using the rest of the debug mode from the get-go? If that's a requirement for you, I'll try to think about ways to make that possible in this version of the patch and keep you up-to-date. If not, that makes my life easier since I can land this and then relax requirements once we've agreed on a design document (aiming to make it happen this week).

Hmm, from the exact snapshot of the patch I see that `_LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY` can be used as a build flag without `LIBCXX_ENABLE_DEBUG_MODE=on`, is this going to be changed?

Ideally, yes, we would like to build without all checks being enabled at the same time as they increase the build size by substantial amount (especially things like vector subscription operator), we enabled randomization separately without all checks and that was our intention

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list