Skip to content

Conversation

@fanquake
Copy link
Member

_LIBCPP_ENABLE_ASSERTIONS is deprecated, and will be removed. See (from libc++ __config in main):

TODO(hardening): remove this in LLVM 19.
This is for backward compatibility -- make enabling _LIBCPP_ENABLE_ASSERTIONS (which predates hardening modes)
equivalent to setting the safe mode.
ifdef _LIBCPP_ENABLE_ASSERTIONS
warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_SAFE_MODE instead."

From LLVM 17, _LIBCPP_ENABLE_DEBUG_MODE can be used instead, which also performs more checks than safe mode:

Enables the debug mode which contains all the checks from the hardened mode and additionally more expensive checks that may affect the complexity of algorithms. The debug mode is intended to be used for testing, not in production. Mutually exclusive with _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_SAFE_MODE.

See https://libcxx.llvm.org/Hardening.html.

Related to #28476.

`_LIBCPP_ENABLE_ASSERTIONS` is deprecated, and will be removed. [See (from libc++ __config in main)](https://github.com/llvm/llvm-project/blob/b57df9fe9a1a230f277d671bfa0884bbda9fc1c5/libcxx/include/__config#L205-L209):

> TODO(hardening): remove this in LLVM 19.
> This is for backward compatibility -- make enabling `_LIBCPP_ENABLE_ASSERTIONS` (which predates hardening modes)
> equivalent to setting the safe mode.
> ifdef _LIBCPP_ENABLE_ASSERTIONS
> warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_SAFE_MODE instead."

From LLVM 17, `_LIBCPP_ENABLE_DEBUG_MODE` can be used instead.

See https://libcxx.llvm.org/Hardening.html.

Related to bitcoin#28476.
@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 14, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK MarcoFalke

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@maflcko
Copy link
Member

maflcko commented Sep 14, 2023

Concept ACK. This should fix the warning:

make
Making all in src
make[1]: Entering directory '/bitcoin-core/src'
make[2]: Entering directory '/bitcoin-core/src'
make[3]: Entering directory '/bitcoin-core'
make[3]: Leaving directory '/bitcoin-core'
  CXX      init/bitcoind-bitcoind.o
In file included from init/bitcoind.cpp:5:
In file included from ./common/args.h:8:
In file included from ./common/settings.h:8:
In file included from ./util/fs.h:8:
In file included from ./tinyformat.h:144:
In file included from /usr/lib/llvm-17/bin/../include/c++/v1/algorithm:1739:
In file included from /usr/lib/llvm-17/bin/../include/c++/v1/__assert:13:
/usr/lib/llvm-17/bin/../include/c++/v1/__config:215:6: warning: "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_HARDENED_MODE instead." [-W#warnings]
  215 | #    warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_HARDENED_MODE instead."
      |      ^
1 warning generated.

To reproduce on a fresh install of mantic:

export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git  --depth=1 ./bitcoin-core && cd bitcoin-core && apt install libc++abi-17-dev libc++-17-dev clang-17 llvm-17 build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq      make automake cmake curl  libtool binutils bsdmainutils pkg-config python3 patch bison        -y  && ( cd depends && make CC=clang-17 CXX="clang++-17 -stdlib=libc++" DEBUG=1 NO_QT=1 NO_WALLET=1 NO_ZMQ=1 NO_UPNP=1 NO_NATPMP=1 -j $(nproc) ) &&  ./autogen.sh && CONFIG_SITE="$PWD/depends/x86_64-pc-linux-gnu/share/config.site" ./configure  && make -j $(nproc)

@maflcko
Copy link
Member

maflcko commented Sep 14, 2023

As a combined follow-up idea, #27495 could be re-opened and re-based?

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm ACK 4a82503 🙏

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: lgtm ACK 4a825039a509c43ba20b2cd7aab448b3be16bcc3 🙏
qd5zY5wVVk1rUQRh+ogkg4hRqTNWyaizwMXgS0oZqgG21kesDV/Wyd4gOwysaH5/ossdSsnSQmb+Sy3hZmTNCw==

@fanquake
Copy link
Member Author

As a combined follow-up idea, #27495 could be re-opened and re-based?

Sure. Reopened and rebased (on master and this and 28476).

@fanquake fanquake merged commit f01416e into bitcoin:master Sep 16, 2023
@fanquake fanquake deleted the libcxx_debug_mode branch September 16, 2023 11:17
Frank-GER pushed a commit to syscoin/syscoin that referenced this pull request Sep 19, 2023
…_ASSERTIONS

4a82503 build: use _LIBCPP_ENABLE_DEBUG_MODE over ENABLE_ASSERTIONS (fanquake)

Pull request description:

  `_LIBCPP_ENABLE_ASSERTIONS` is deprecated, and will be removed. [See (from libc++ __config in main)](https://github.com/llvm/llvm-project/blob/b57df9fe9a1a230f277d671bfa0884bbda9fc1c5/libcxx/include/__config#L205-L209):

  > TODO(hardening): remove this in LLVM 19.
  > This is for backward compatibility -- make enabling `_LIBCPP_ENABLE_ASSERTIONS` (which predates hardening modes)
  > equivalent to setting the safe mode.
  > ifdef _LIBCPP_ENABLE_ASSERTIONS
  > warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_SAFE_MODE instead."

  From LLVM 17, `_LIBCPP_ENABLE_DEBUG_MODE` can be used instead, which also performs more checks than safe mode:

  > Enables the debug mode which contains all the checks from the hardened mode and additionally more expensive checks that may affect the complexity of algorithms. The debug mode is intended to be used for testing, not in production. Mutually exclusive with `_LIBCPP_ENABLE_HARDENED_MODE` and `_LIBCPP_ENABLE_SAFE_MODE`.

  See https://libcxx.llvm.org/Hardening.html.

  Related to bitcoin#28476.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 4a82503 🙏

Tree-SHA512: ca52603f86214e8e9350bd2b2baa44fbde0f72f1b186da7aecd8690256dff5b2be75fe89383158298a6f683bbd6ae0dff528d2ba4cc5ece1f56cfbdee0e1dc5d
@bitcoin bitcoin locked and limited conversation to collaborators Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants