[libcxx-commits] [PATCH] D154997: [libc++][hardening] Deprecate `_LIBCPP_ENABLE_ASSERTIONS`.

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 26 12:22:24 PDT 2023


cjdb added a comment.

In D154997#4536344 <https://reviews.llvm.org/D154997#4536344>, @dblaikie wrote:

> Looks like this change didn't update https://github.com/llvm/llvm-project/commit/d8e9a1a12557cd5e80c3d713d9cbbba0f7406882 ? At least for me this seems to be causing hard failures when building like this:
>
>   CC=clang CXX=clang++ cmake -G Ninja -DLLVM_ENABLE_WERROR=true -DLIBCXX_ENABLE_WERROR=true -DLLVM_BUILD_EXAMPLES=true -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=true -DLLVM_USE_SPLIT_DWARF=true -DLLVM_OPTIMIZED_TABLEGEN=true  -DLLVM_ENABLE_LLD=true -DLLVM_ENABLE_PROJECTS='llvm;clang;clang-tools-extra;lld;lldb;cross-project-tests' -DLLVM_ENABLE_RUNTIMES='libcxxabi;libcxx;compiler-rt'  -DLLDB_ENABLE_PYTHON=On  ~/dev/llvm/src/llvm
>   ninja check-all
>
>
>
>   usr/local/google/home/blaikie/dev/llvm/build/default/./bin/clang++ --target=x86_64-unknown-linux-gnu -DLIBCXX_BUILDING_LIBCXXABI -D_GLIBCXX_ASSERTIONS -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_ENABLE_ASSERTIONS -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_LINK_PTHREAD_LIB -D_LIBCPP_LINK_RT_LIB -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/local/google/home/blaikie/dev/llvm/src/libcxx/src -I/usr/local/google/home/blaikie/dev/llvm/build/default/include/c++/v1 -I/usr/local/google/home/blaikie/dev/llvm/build/default/include/x86_64-unknown-linux-gnu/c++/v1 -I/usr/local/google/home/blaikie/dev/llvm/src/libcxxabi/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -fPIC -gsplit-dwarf -faligned-allocation -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -Wall -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Werror -std=c++20 -MD -MT libcxx/src/CMakeFiles/cxx_shared.dir/new_handler.cpp.o -MF libcxx/src/CMakeFiles/cxx_shared.dir/new_handler.cpp.o.d -o libcxx/src/CMakeFiles/cxx_shared.dir/new_handler.cpp.o -c /usr/local/google/home/blaikie/dev/llvm/src/libcxx/src/new_handler.cpp
>   In file included from /usr/local/google/home/blaikie/dev/llvm/src/libcxx/src/new_handler.cpp:9:
>   In file included from /usr/local/google/home/blaikie/dev/llvm/build/default/include/c++/v1/new:89:
>   In file included from /usr/local/google/home/blaikie/dev/llvm/build/default/include/c++/v1/__assert:13:
>   /usr/local/google/home/blaikie/dev/llvm/build/default/include/c++/v1/__config:215:6: error: "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_HARDENED_MODE instead." [-Werror,-W#warnings]
>     215 | #    warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_HARDENED_MODE instead."
>         |      ^
>
> is something in the way I'm doing this not supported? If not, how has this not impacted other people in the last few weeks?

I also see this when building LLVM with libc++.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154997/new/

https://reviews.llvm.org/D154997



More information about the libcxx-commits mailing list