Merge bitcoin/bitcoin#27662: build: Bump minimum supported GCC to g++-9

fa953f15bf build: Bump minimum supported GCC to g++-9 (MarcoFalke)
fa69955e74 ci: Bump centos:stream8 to centos:stream9 (MarcoFalke)
fa6a755d9f ci: Document the false positive error for g++-9 (MarcoFalke)

Pull request description:

  It is a bit frustrating to write valid C++ code only to realize that g++-8 fails to parse it later on.

  The only non-EOL operating system still shipping with g++-8 is CentOS Stream 8. I think it is reasonable for users of affected Linux distributions to:

  * Upgrade their operating system, or compiler to a supported version.
  * Alternatively, stay with a previous release of Bitcoin Core as long as it is supported.

  Fixes https://github.com/bitcoin/bitcoin/issues/27537

ACKs for top commit:
  hebasto:
    ACK fa953f15bf
  fanquake:
    ACK fa953f15bf

Tree-SHA512: b9cf7e763d3071e1e008c5010de19601d4773afe46d58cf869d3f59285c53240c739a1cd7235a5525ede1bbdf6b6cb6fb091c8fc314864a28d5b27a400bb7632
This commit is contained in:
fanquake 2023-05-19 09:53:26 +01:00
commit edd6d8395f
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
10 changed files with 14 additions and 58 deletions

View file

@ -217,11 +217,11 @@ task:
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
task: task:
name: '32-bit + dash [gui] [CentOS 8]' name: '32-bit + dash [gui] [CentOS 9]'
<< : *GLOBAL_TASK_TEMPLATE << : *GLOBAL_TASK_TEMPLATE
container: container:
docker_arguments: docker_arguments:
CI_IMAGE_NAME_TAG: quay.io/centos/centos:stream8 CI_IMAGE_NAME_TAG: quay.io/centos/centos:stream9
FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh" FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh"
# For faster CI feedback, immediately schedule one task that runs all tests # For faster CI feedback, immediately schedule one task that runs all tests
<< : *CREDITS_TEMPLATE << : *CREDITS_TEMPLATE

View file

@ -1,38 +0,0 @@
dnl Copyright (c) 2022 The Bitcoin Core developers
dnl Distributed under the MIT software license, see the accompanying
dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
# GCC 8.1 and earlier requires -lstdc++fs
m4_define([_CHECK_FILESYSTEM_testbody], [[
#include <filesystem>
namespace fs = std::filesystem;
int main() {
(void)fs::current_path().root_name();
return 0;
}
]])
AC_DEFUN([CHECK_FILESYSTEM], [
AC_LANG_PUSH(C++)
AC_MSG_CHECKING([whether std::filesystem can be used without link library])
AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_FILESYSTEM_testbody])],[
AC_MSG_RESULT([yes])
],[
AC_MSG_RESULT([no])
LIBS="$LIBS -lstdc++fs"
AC_MSG_CHECKING([whether std::filesystem needs -lstdc++fs])
AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_FILESYSTEM_testbody])],[
AC_MSG_RESULT([yes])
],[
AC_MSG_FAILURE([cannot figure out how to use std::filesystem])
])
])
AC_LANG_POP
])

View file

@ -8,12 +8,10 @@ export LC_ALL=C.UTF-8
export HOST=i686-pc-linux-gnu export HOST=i686-pc-linux-gnu
export CONTAINER_NAME=ci_i686_centos export CONTAINER_NAME=ci_i686_centos
export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream8" export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream9"
# Use minimum supported python3.8 and gcc-8, see doc/dependencies.md export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python3 python3-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison util-linux"
export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python38 python38-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison"
export PIP_PACKAGES="pyzmq" export PIP_PACKAGES="pyzmq"
export GOAL="install" export GOAL="install"
export NO_WERROR=1 # GCC 8 export NO_WERROR=1 # Suppress error: #warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform [-Werror=cpp]
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports" export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports"
export CONFIG_SHELL="/bin/dash" export CONFIG_SHELL="/bin/dash"
export TEST_RUNNER_ENV="LC_ALL=en_US.UTF-8"

View file

@ -8,14 +8,14 @@ export LC_ALL=C.UTF-8
export CONTAINER_NAME=ci_native_qt5 export CONTAINER_NAME=ci_native_qt5
export CI_IMAGE_NAME_TAG="ubuntu:20.04" export CI_IMAGE_NAME_TAG="ubuntu:20.04"
# Use minimum supported python3.8 and gcc-8 (or best-effort gcc-9), see doc/dependencies.md # Use minimum supported python3.8 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 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" export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-9 CXX=g++-9"
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 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_SEQUENTIAL="true"
export RUN_UNIT_TESTS="false" export RUN_UNIT_TESTS="false"
export GOAL="install" export GOAL="install"
export NO_WERROR=1 export NO_WERROR=1 # -Werror=maybe-uninitialized
export DOWNLOAD_PREVIOUS_RELEASES="true" export DOWNLOAD_PREVIOUS_RELEASES="true"
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports \ export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports \
--enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\"" --enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\""

View file

@ -18,8 +18,8 @@ if [ -n "$DPKG_ADD_ARCH" ]; then
fi fi
if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then
${CI_RETRY_EXE} bash -c "dnf -y install epel-release" bash -c "dnf -y install epel-release"
${CI_RETRY_EXE} bash -c "dnf -y --allowerasing install $CI_BASE_PACKAGES $PACKAGES" bash -c "dnf -y --allowerasing install $CI_BASE_PACKAGES $PACKAGES"
elif [ "$CI_USE_APT_INSTALL" != "no" ]; then elif [ "$CI_USE_APT_INSTALL" != "no" ]; then
if [[ -n "${APPEND_APT_SOURCES_LIST}" ]]; then if [[ -n "${APPEND_APT_SOURCES_LIST}" ]]; then
echo "${APPEND_APT_SOURCES_LIST}" >> /etc/apt/sources.list echo "${APPEND_APT_SOURCES_LIST}" >> /etc/apt/sources.list

View file

@ -52,7 +52,7 @@ fi
if [ -z "$NO_DEPENDS" ]; then if [ -z "$NO_DEPENDS" ]; then
if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then
SHELL_OPTS="LC_ALL=en_US.UTF-8 CONFIG_SHELL=/bin/dash" SHELL_OPTS="CONFIG_SHELL=/bin/dash"
else else
SHELL_OPTS="CONFIG_SHELL=" SHELL_OPTS="CONFIG_SHELL="
fi fi

View file

@ -115,9 +115,6 @@ else
AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory]) AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory])
fi fi
dnl check if additional link flags are required for std::filesystem
CHECK_FILESYSTEM
dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures
dnl that we get the same -std flags for both. dnl that we get the same -std flags for both.
m4_ifdef([AC_PROG_OBJCXX],[ m4_ifdef([AC_PROG_OBJCXX],[

View file

@ -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) | | [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) | | [Automake](https://www.gnu.org/software/automake/) | [1.13](https://github.com/bitcoin/bitcoin/pull/18290) |
| [Clang](https://clang.llvm.org) | [10.0](https://github.com/bitcoin/bitcoin/pull/27682) | | [Clang](https://clang.llvm.org) | [10.0](https://github.com/bitcoin/bitcoin/pull/27682) |
| [GCC](https://gcc.gnu.org) | [8.1](https://github.com/bitcoin/bitcoin/pull/23060) | | [GCC](https://gcc.gnu.org) | [9.1](https://github.com/bitcoin/bitcoin/pull/27662) |
| [Python](https://www.python.org) (scripts, tests) | [3.8](https://github.com/bitcoin/bitcoin/pull/27483) | | [Python](https://www.python.org) (scripts, tests) | [3.8](https://github.com/bitcoin/bitcoin/pull/27483) |
| [systemtap](https://sourceware.org/systemtap/) ([tracing](tracing.md))| N/A | | [systemtap](https://sourceware.org/systemtap/) ([tracing](tracing.md))| N/A |

View file

@ -53,15 +53,14 @@ struct AddressTableEntryLessThan
}; };
/* Determine address type from address purpose */ /* Determine address type from address purpose */
static AddressTableEntry::Type translateTransactionType(wallet::AddressPurpose purpose, bool isMine) constexpr AddressTableEntry::Type translateTransactionType(wallet::AddressPurpose purpose, bool isMine)
{ {
// "refund" addresses aren't shown, and change addresses aren't returned by getAddresses at all. // "refund" addresses aren't shown, and change addresses aren't returned by getAddresses at all.
switch (purpose) { switch (purpose) {
case wallet::AddressPurpose::SEND: return AddressTableEntry::Sending; case wallet::AddressPurpose::SEND: return AddressTableEntry::Sending;
case wallet::AddressPurpose::RECEIVE: return AddressTableEntry::Receiving; case wallet::AddressPurpose::RECEIVE: return AddressTableEntry::Receiving;
case wallet::AddressPurpose::REFUND: return AddressTableEntry::Hidden; case wallet::AddressPurpose::REFUND: return AddressTableEntry::Hidden;
// No default case to allow for compiler to warn } // no default case, so the compiler can warn about missing cases
}
assert(false); assert(false);
} }

View file

@ -69,7 +69,7 @@ struct Announcement {
const bool m_is_wtxid : 1; const bool m_is_wtxid : 1;
/** What state this announcement is in. /** What state this announcement is in.
* This is a uint8_t instead of a State to silence a GCC warning in versions prior to 8.4 and 9.3. * 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 */ * See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414 */
uint8_t m_state : 3; uint8_t m_state : 3;