[libcxx-commits] [libcxx] [libc++][test] fix redefinition of _LIBCPP_HARDENING_MODE (PR #109330)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 23 11:24:15 PDT 2024


ldionne wrote:

> > In what files?
> 
> `/etc/clang/foo.cfg`
> 
> This is how we apply `-D_LIBCPP_HARDENING_MODE` on gentoo.

How does that work? I am not familiar with these kinds of files. Is there a mechanism to tweak the default Clang flags using files like that?

It looks like what you're trying to do is enable hardening by default on Gentoo overall. Is that right? The correct way of doing that is to set `-DLIBCXX_HARDENING_MODE=<mode>` when *configuring* the library with CMake. That will end up with the appropriate definitions in `__config_site` and the test suite can then be run with e.g. `hardening_mode=fast` and everything should work.

https://github.com/llvm/llvm-project/pull/109330


More information about the libcxx-commits mailing list