[libcxx-commits] [libcxx] [libcxxabi] [libc++][libc++abi] Build with -fsized-deallocation (PR #96217)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 20 10:57:27 PDT 2024


================
@@ -247,6 +247,10 @@ endif()
 add_compile_flags("${LIBCXXABI_ADDITIONAL_COMPILE_FLAGS}")
 add_library_flags("${LIBCXXABI_ADDITIONAL_LIBRARIES}")
 
+# Build with -fsized-deallocation, which is default in recent versions of Clang.
+# TODO(LLVM 21): This can be dropped once we only support Clang >= 19.
+add_compile_flags(-fsized-deallocation)
----------------
ldionne wrote:

> The size-deallocation functions should always be present in the library,

I don't think that's true, libc++abi doesn't define `operator new` in all configurations. In some configurations it is provided by libc++ instead.

> and we shouldn't be calling new/delete from inside the library (I think?)

However that should definitely be correct, so I think you're right I could drop that part of the change. I'll try that.

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


More information about the libcxx-commits mailing list