diff --git a/configure.ac b/configure.ac index dd4b2fb49f..5ed4b4e010 100644 --- a/configure.ac +++ b/configure.ac @@ -1614,6 +1614,14 @@ 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 + #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 4b1fb44f3d..d4ebd22969 100644 --- a/src/common/run_command.cpp +++ b/src/common/run_command.cpp @@ -12,6 +12,16 @@ #include #ifdef ENABLE_EXTERNAL_SIGNER +// 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 + #include #endif // ENABLE_EXTERNAL_SIGNER diff --git a/src/common/run_command.h b/src/common/run_command.h index 2a52649bbf..59db9de273 100644 --- a/src/common/run_command.h +++ b/src/common/run_command.h @@ -18,6 +18,14 @@ #include #ifdef FD_CLOEXEC #include +// 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 740f461548..d955a2be57 100644 --- a/src/test/system_tests.cpp +++ b/src/test/system_tests.cpp @@ -7,6 +7,16 @@ #include #ifdef ENABLE_EXTERNAL_SIGNER +// 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 + #include #endif // ENABLE_EXTERNAL_SIGNER