Skip to content

Commit

Permalink
[libc++] Build with -fsized-deallocation
Browse files Browse the repository at this point in the history
This patch makes libc++ build with -fsized-deallocation. That flag is
enabled by default in recent versions of Clang, so this patch will make
libc++ forward-compatible with ToT Clang.
  • Loading branch information
ldionne committed Jun 20, 2024
1 parent 88dae3d commit ab0d435
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ function(cxx_add_basic_build_flags target)
target_add_compile_flags_if_supported(${target} PRIVATE -fvisibility=hidden)
endif()

# 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.
target_compile_options(${target} PRIVATE -fsized-deallocation)

# Let the library headers know they are currently being used to build the
# library.
target_compile_definitions(${target} PRIVATE -D_LIBCPP_BUILDING_LIBRARY)
Expand Down

0 comments on commit ab0d435

Please sign in to comment.