diff options
author | fanquake <fanquake@gmail.com> | 2023-10-30 15:54:30 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-10-30 15:55:39 +0100 |
commit | 7d6c646cc79ecb7dbeed64e53606eb29cc19ff96 (patch) | |
tree | b0ff1056086708b888d959db55c8dc4d486fa10f | |
parent | 6391644b660740f479b915a9b34b0f287baaaac4 (diff) | |
parent | fa5423b5b582aaf8c5b7c516806157244cf20c74 (diff) |
Merge bitcoin/bitcoin#28348: build: Bump g++ minimum supported version to 10
fa5423b5b582aaf8c5b7c516806157244cf20c74 refactor: Remove unused gcc-9 workaround in txrequest (MarcoFalke)
fa918d397dd97114a00ca3d6297f1bb293a8de08 Always enable -Wsuggest-override (MarcoFalke)
faea58eee412d36a020aecf5568e4e3e1f0c5b22 Bump g++ minimum supported version to 10 (MarcoFalke)
Pull request description:
All supported operating systems ship with g++ 10 (or later), so bumping the minimum should not cause any issues. The bump allows to drop some now-unused workarounds.
For reference:
* https://packages.debian.org/bullseye/g++ (`g++-10`)
* https://packages.ubuntu.com/focal/g++-10
* FreeBSD 12/13 ships with g++ 12
* CentOS-like 9 ships with g++ 11
* OpenSuse Tumbleweed ships with g++ 13 https://software.opensuse.org/package/gcc13-c++ (No idea about OpenSuse Leap)
This is for Bitcoin Core 27.0 in 2024 (next year), not the soon upcoming 26.0 next month.
ACKs for top commit:
fanquake:
ACK fa5423b5b582aaf8c5b7c516806157244cf20c74
Tree-SHA512: 6f0697ae4c0f578873591b7872bf158aba3af17f171c3556b593a70ec379bf94c7a9dd7697e8e79173edd4ac3c81a376e0cbbc0cfabde1a1cfe5f9b5eaea6831
-rwxr-xr-x | ci/test/00_setup_env_native_qt5.sh | 7 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | doc/dependencies.md | 2 | ||||
-rw-r--r-- | src/txrequest.cpp | 16 | ||||
-rw-r--r-- | src/util/hasher.h | 2 |
5 files changed, 11 insertions, 21 deletions
diff --git a/ci/test/00_setup_env_native_qt5.sh b/ci/test/00_setup_env_native_qt5.sh index 32c8557eeb..f351298f1e 100755 --- a/ci/test/00_setup_env_native_qt5.sh +++ b/ci/test/00_setup_env_native_qt5.sh @@ -8,14 +8,13 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_qt5 export CI_IMAGE_NAME_TAG="docker.io/debian:bullseye" -# Use minimum supported python3.9 and gcc-9, see doc/dependencies.md -export PACKAGES="gcc-9 g++-9 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" -export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-9 CXX=g++-9" +# Use minimum supported python3.9 and gcc-10, see doc/dependencies.md +export PACKAGES="gcc-10 g++-10 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" +export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-10 CXX=g++-10" export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash export RUN_UNIT_TESTS_SEQUENTIAL="true" export RUN_UNIT_TESTS="false" export GOAL="install" -export NO_WERROR=1 # -Werror=maybe-uninitialized export DOWNLOAD_PREVIOUS_RELEASES="true" export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports --enable-debug \ CFLAGS=\"-g0 -O2 -funsigned-char\" CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' CXXFLAGS=\"-g0 -O2 -funsigned-char\"" diff --git a/configure.ac b/configure.ac index d6a9a1161c..6dfd2abfb2 100644 --- a/configure.ac +++ b/configure.ac @@ -447,10 +447,7 @@ if test "$CXXFLAGS_overridden" = "no"; then AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-cond"], [], [$CXXFLAG_WERROR]) AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"], [], [$CXXFLAG_WERROR]) AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"], [], [$CXXFLAG_WERROR]) - dnl -Wsuggest-override is broken with GCC before 9.2 - dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010 - AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR], - [AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])]) + AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR]) AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"], [], [$CXXFLAG_WERROR]) AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR]) diff --git a/doc/dependencies.md b/doc/dependencies.md index a9a32fe8bd..9d9380bf79 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -9,7 +9,7 @@ You can find installation instructions in the `build-*.md` file for your platfor | [Autoconf](https://www.gnu.org/software/autoconf/) | [2.69](https://github.com/bitcoin/bitcoin/pull/17769) | | [Automake](https://www.gnu.org/software/automake/) | [1.13](https://github.com/bitcoin/bitcoin/pull/18290) | | [Clang](https://clang.llvm.org) | [13.0](https://github.com/bitcoin/bitcoin/pull/28210) | -| [GCC](https://gcc.gnu.org) | [9.1](https://github.com/bitcoin/bitcoin/pull/27662) | +| [GCC](https://gcc.gnu.org) | [10.1](https://github.com/bitcoin/bitcoin/pull/28348) | | [Python](https://www.python.org) (scripts, tests) | [3.9](https://github.com/bitcoin/bitcoin/pull/28211) | | [systemtap](https://sourceware.org/systemtap/) ([tracing](tracing.md))| N/A | diff --git a/src/txrequest.cpp b/src/txrequest.cpp index 4c94d4562d..b9a41f26ff 100644 --- a/src/txrequest.cpp +++ b/src/txrequest.cpp @@ -72,16 +72,10 @@ struct Announcement { /** Whether this is a wtxid request. */ const bool m_is_wtxid : 1; - /** What state this announcement is in. - * This is a uint8_t instead of a State to silence a GCC warning in versions prior to 9.3. - * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414 */ - uint8_t m_state : 3; - - /** Convert m_state to a State enum. */ - State GetState() const { return static_cast<State>(m_state); } - - /** Convert a State enum to a uint8_t and store it in m_state. */ - void SetState(State state) { m_state = static_cast<uint8_t>(state); } + /** What state this announcement is in. */ + State m_state : 3; + State GetState() const { return m_state; } + void SetState(State state) { m_state = state; } /** Whether this announcement is selected. There can be at most 1 selected peer per txhash. */ bool IsSelected() const @@ -105,7 +99,7 @@ struct Announcement { Announcement(const GenTxid& gtxid, NodeId peer, bool preferred, std::chrono::microseconds reqtime, SequenceNumber sequence) : m_txhash(gtxid.GetHash()), m_time(reqtime), m_peer(peer), m_sequence(sequence), m_preferred(preferred), - m_is_wtxid(gtxid.IsWtxid()), m_state(static_cast<uint8_t>(State::CANDIDATE_DELAYED)) {} + m_is_wtxid{gtxid.IsWtxid()}, m_state{State::CANDIDATE_DELAYED} {} }; //! Type alias for priorities. diff --git a/src/util/hasher.h b/src/util/hasher.h index 506ae9415d..3ad6d5bb94 100644 --- a/src/util/hasher.h +++ b/src/util/hasher.h @@ -45,7 +45,7 @@ public: * a slight performance penalty (around 1.6%), but this is compensated by * memory savings of about 9% which allow for a larger dbcache setting. * - * @see https://gcc.gnu.org/onlinedocs/gcc-9.2.0/libstdc++/manual/manual/unordered_associative.html + * @see https://gcc.gnu.org/onlinedocs/gcc-13.2.0/libstdc++/manual/manual/unordered_associative.html */ size_t operator()(const COutPoint& id) const noexcept { return SipHashUint256Extra(k0, k1, id.hash, id.n); |