From bf4c95d1f7d718722eb16cb699e0dcbb8368c73c Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 12 May 2022 02:58:35 +0000 Subject: [PATCH 1/2] Add workaround for Boost.Process 1.77 missing an include --- configure.ac | 3 +++ src/common/run_command.cpp | 4 ++++ src/common/run_command.h | 3 +++ src/test/system_tests.cpp | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/configure.ac b/configure.ac index 93279a36c5..316b14c583 100644 --- a/configure.ac +++ b/configure.ac @@ -1507,6 +1507,9 @@ if test "$use_external_signer" != "no"; then dnl Boost 1.73 and older require the following workaround. LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + // Boost 1.77 requires the following workaround. + // See: https://github.com/boostorg/process/issues/213 + #include #define BOOST_PROCESS_USE_STD_FS #include diff --git a/src/common/run_command.cpp b/src/common/run_command.cpp index 4b1fb44f3d..7ecb963c0c 100644 --- a/src/common/run_command.cpp +++ b/src/common/run_command.cpp @@ -12,6 +12,10 @@ #include #ifdef ENABLE_EXTERNAL_SIGNER +// Boost 1.77 requires the following workaround. +// See: https://github.com/boostorg/process/issues/213 +#include + #include #endif // ENABLE_EXTERNAL_SIGNER diff --git a/src/common/run_command.h b/src/common/run_command.h index 2a52649bbf..933750fe4a 100644 --- a/src/common/run_command.h +++ b/src/common/run_command.h @@ -18,6 +18,9 @@ #include #ifdef FD_CLOEXEC #include +// Boost 1.77 requires the following workaround. +// See: https://github.com/boostorg/process/issues/213 +#include #if defined(__GNUC__) // Boost 1.78 requires the following workaround. // See: https://github.com/boostorg/process/issues/235 diff --git a/src/test/system_tests.cpp b/src/test/system_tests.cpp index 740f461548..0e17935666 100644 --- a/src/test/system_tests.cpp +++ b/src/test/system_tests.cpp @@ -7,6 +7,10 @@ #include #ifdef ENABLE_EXTERNAL_SIGNER +// Boost 1.77 requires the following workaround. +// See: https://github.com/boostorg/process/issues/213 +#include + #include #endif // ENABLE_EXTERNAL_SIGNER From 39b2764f677519ce72bbc92ca9d6ac51d4ce2b50 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 12 May 2022 03:00:25 +0000 Subject: [PATCH 2/2] Restore still-needed workaround for Boost.Process incompatibility w/ mingw-w64 --- configure.ac | 5 +++++ src/common/run_command.cpp | 6 ++++++ src/common/run_command.h | 5 +++++ src/test/system_tests.cpp | 6 ++++++ 4 files changed, 22 insertions(+) diff --git a/configure.ac b/configure.ac index 316b14c583..a22e9ff89f 100644 --- a/configure.ac +++ b/configure.ac @@ -1510,6 +1510,11 @@ if test "$use_external_signer" != "no"; then // Boost 1.77 requires the following workaround. // See: https://github.com/boostorg/process/issues/213 #include + #if defined(WIN32) && !defined(__kernel_entry) + // Boost 1.71-1.77 requires the following workaround for compatibility with mingw-w64 compiler. + // See: https://github.com/bitcoin/bitcoin/pull/22348 + #define __kernel_entry + #endif #define BOOST_PROCESS_USE_STD_FS #include diff --git a/src/common/run_command.cpp b/src/common/run_command.cpp index 7ecb963c0c..d4ebd22969 100644 --- a/src/common/run_command.cpp +++ b/src/common/run_command.cpp @@ -16,6 +16,12 @@ // See: https://github.com/boostorg/process/issues/213 #include +#if defined(WIN32) && !defined(__kernel_entry) +// Boost 1.71-1.77 requires the following workaround for compatibility with mingw-w64 compiler. +// See: https://github.com/bitcoin/bitcoin/pull/22348 +#define __kernel_entry +#endif + #include #endif // ENABLE_EXTERNAL_SIGNER diff --git a/src/common/run_command.h b/src/common/run_command.h index 933750fe4a..59db9de273 100644 --- a/src/common/run_command.h +++ b/src/common/run_command.h @@ -21,6 +21,11 @@ // Boost 1.77 requires the following workaround. // See: https://github.com/boostorg/process/issues/213 #include +#if defined(WIN32) && !defined(__kernel_entry) +// Boost 1.71-1.77 requires the following workaround for compatibility with mingw-w64 compiler. +// See: https://github.com/bitcoin/bitcoin/pull/22348 +#define __kernel_entry +#endif #if defined(__GNUC__) // Boost 1.78 requires the following workaround. // See: https://github.com/boostorg/process/issues/235 diff --git a/src/test/system_tests.cpp b/src/test/system_tests.cpp index 0e17935666..d955a2be57 100644 --- a/src/test/system_tests.cpp +++ b/src/test/system_tests.cpp @@ -11,6 +11,12 @@ // See: https://github.com/boostorg/process/issues/213 #include +#if defined(WIN32) && !defined(__kernel_entry) +// Boost 1.71-1.77 requires the following workaround for compatibility with mingw-w64 compiler. +// See: https://github.com/bitcoin/bitcoin/pull/22348 +#define __kernel_entry +#endif + #include #endif // ENABLE_EXTERNAL_SIGNER