Skip to content

Commit 2b95b60

Browse files
cc55ebb merge bitcoin#22093: Try posix-specific CXX first for mingw32 host (Kittywhiskers Van Gogh) 638806b merge bitcoin#22088: improve note on choosing posix mingw32 (Kittywhiskers Van Gogh) 7ad0141 merge bitcoin#23947: use host_os instead of TARGET_OS in configure output (Kittywhiskers Van Gogh) 9126006 merge bitcoin#20201: pkg-config related cleanup (Kittywhiskers Van Gogh) 77862d8 merge bitcoin#23494: minor boost tidyups (Kittywhiskers Van Gogh) ef4b350 merge bitcoin#23269: remove redundant warning flags (Kittywhiskers Van Gogh) 183d08f merge bitcoin#22133: Make QWindowsVistaStylePlugin available again (Kittywhiskers Van Gogh) 1fbdd00 merge bitcoin#21430: Add -Werror=implicit-fallthrough compile flag (Kittywhiskers Van Gogh) cae5496 merge bitcoin#21920: improve macro for testing -latomic requirement (Kittywhiskers Van Gogh) 78db324 partial bitcoin#20938: fix linking against -latomic when building for riscv (Kittywhiskers Van Gogh) 972b419 merge bitcoin#23007: remove WSL install instructions and point to upstream (Kittywhiskers Van Gogh) 54be58b merge bitcoin#22845: improve check for ::(w)system (Kittywhiskers Van Gogh) 5b86009 merge bitcoin#22464: fix 32-bit narrowing warning in bench/peer_eviction.cpp (Kittywhiskers Van Gogh) a42202d merge bitcoin#22433: remove straggling boost thread_group related code (Kittywhiskers Van Gogh) abdf4d7 build: use enough padding to match with labels in options printout (Kittywhiskers Van Gogh) e22f421 doc: clean up `build-windows.md` (Kittywhiskers Van Gogh) Pull request description: ## Breaking Changes None expected. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK [cc55ebb](dashpay@cc55ebb) Tree-SHA512: f4cf6506120facabd5fc2e968c1b14a1fca02cf5858f63cce9e9743aa5327b18a7855b2584829eb568d6664a8e12c4bbfdda2f954ea44e29aaaba1776b3d1535
2 parents b316be7 + cc55ebb commit 2b95b60

File tree

16 files changed

+64
-94
lines changed

16 files changed

+64
-94
lines changed

build-aux/m4/bitcoin_find_bdb48.m4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ AC_DEFUN([BITCOIN_FIND_BDB48],[
9191
fi
9292
fi
9393
if test "x$use_bdb" != "xno"; then
94-
AC_SUBST(BDB_LIBS)
9594
AC_DEFINE([USE_BDB], [1], [Define if BDB support should be compiled in])
9695
use_bdb=yes
9796
fi

build-aux/m4/bitcoin_qt.m4

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
147147
dnl https://bugreports.qt.io/browse/QTBUG-27097.
148148
AX_CHECK_LINK_FLAG([-lwtsapi32], [QT_LIBS="$QT_LIBS -lwtsapi32"], [AC_MSG_ERROR([could not link against -lwtsapi32])])
149149
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QWindowsIntegrationPlugin], [-lqwindows])
150+
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QWindowsVistaStylePlugin], [-lqwindowsvistastyle])
150151
AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])
151152
elif test "x$TARGET_OS" = xlinux; then
152153
_BITCOIN_QT_CHECK_STATIC_PLUGIN([QXcbIntegrationPlugin], [-lqxcb])
@@ -292,9 +293,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
292293
AC_SUBST(QT_LIBS)
293294
AC_SUBST(QT_LDFLAGS)
294295
AC_SUBST(QT_DBUS_INCLUDES)
295-
AC_SUBST(QT_DBUS_LIBS)
296296
AC_SUBST(QT_TEST_INCLUDES)
297-
AC_SUBST(QT_TEST_LIBS)
298297
AC_SUBST(QT_SELECT, qt5)
299298
AC_SUBST(MOC_DEFS)
300299
])

build-aux/m4/l_atomic.m4

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,17 @@ dnl warranty.
1212
m4_define([_CHECK_ATOMIC_testbody], [[
1313
#include <atomic>
1414
#include <cstdint>
15+
#include <chrono>
16+
17+
using namespace std::chrono_literals;
1518
1619
int main() {
20+
std::atomic<bool> lock{true};
21+
std::atomic_exchange(&lock, false);
22+
23+
std::atomic<std::chrono::seconds> t{0s};
24+
t.store(2s);
25+
1726
std::atomic<int64_t> a{};
1827
1928
int64_t v = 5;

configure.ac

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ if test "x$enable_werror" = "xyes"; then
468468
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])
469469
AX_CHECK_COMPILE_FLAG([-Werror=unreachable-code-loop-increment],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=unreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
470470
AX_CHECK_COMPILE_FLAG([-Werror=mismatched-tags], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=mismatched-tags"], [], [$CXXFLAG_WERROR])
471+
AX_CHECK_COMPILE_FLAG([-Werror=implicit-fallthrough], [ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=implicit-fallthrough"], [], [$CXXFLAG_WERROR])
471472
fi
472473

473474
if test "x$CXXFLAGS_overridden" = "xno"; then
@@ -478,30 +479,26 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
478479
AX_CHECK_COMPILE_FLAG([-Wformat -Wformat-security],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat -Wformat-security"],,[[$CXXFLAG_WERROR]])
479480
AX_CHECK_COMPILE_FLAG([-Wvla],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wvla"],,[[$CXXFLAG_WERROR]])
480481
AX_CHECK_COMPILE_FLAG([-Wshadow-field],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wshadow-field"],,[[$CXXFLAG_WERROR]])
481-
AX_CHECK_COMPILE_FLAG([-Wswitch],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wswitch"],,[[$CXXFLAG_WERROR]])
482482
AX_CHECK_COMPILE_FLAG([-Wthread-safety],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wthread-safety"],,[[$CXXFLAG_WERROR]])
483-
AX_CHECK_COMPILE_FLAG([-Wrange-loop-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wrange-loop-analysis"],,[[$CXXFLAG_WERROR]])
483+
AX_CHECK_COMPILE_FLAG([-Wloop-analysis],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wloop-analysis"],,[[$CXXFLAG_WERROR]])
484484
AX_CHECK_COMPILE_FLAG([-Wredundant-decls],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wredundant-decls"],,[[$CXXFLAG_WERROR]])
485-
AX_CHECK_COMPILE_FLAG([-Wunused-variable],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunused-variable"],,[[$CXXFLAG_WERROR]])
486485
AX_CHECK_COMPILE_FLAG([-Wunused-member-function],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunused-member-function"],,[[$CXXFLAG_WERROR]])
487486
AX_CHECK_COMPILE_FLAG([-Wdate-time],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"],,[[$CXXFLAG_WERROR]])
488487
AX_CHECK_COMPILE_FLAG([-Wconditional-uninitialized],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"],,[[$CXXFLAG_WERROR]])
489-
AX_CHECK_COMPILE_FLAG([-Wsign-compare],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsign-compare"],,[[$CXXFLAG_WERROR]])
490488
AX_CHECK_COMPILE_FLAG([-Wduplicated-branches],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-branches"],,[[$CXXFLAG_WERROR]])
491489
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-cond"],,[[$CXXFLAG_WERROR]])
492490
AX_CHECK_COMPILE_FLAG([-Wlogical-op],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"],,[[$CXXFLAG_WERROR]])
493491
AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"],,[[$CXXFLAG_WERROR]])
494492
AX_CHECK_COMPILE_FLAG([-Wsuggest-override],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"],,[[$CXXFLAG_WERROR]],
495493
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])
496494
AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
495+
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR])
497496

498497
dnl Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
499498
dnl unknown options if any other warning is produced. Test the -Wfoo case, and
500499
dnl set the -Wno-foo case if it works.
501500
AX_CHECK_COMPILE_FLAG([-Wunused-parameter],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-parameter"],,[[$CXXFLAG_WERROR]])
502501
AX_CHECK_COMPILE_FLAG([-Wself-assign],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-self-assign"],,[[$CXXFLAG_WERROR]])
503-
AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]])
504-
AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-implicit-fallthrough"],,[[$CXXFLAG_WERROR]])
505502
if test x$suppress_external_warnings != xyes ; then
506503
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy],[NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"],,[[$CXXFLAG_WERROR]])
507504
fi
@@ -1272,13 +1269,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
12721269
[ AC_MSG_RESULT(no); HAVE_STRONG_GETAUXVAL=0 ]
12731270
)
12741271

1272+
have_any_system=no
12751273
AC_MSG_CHECKING([for std::system])
12761274
AC_LINK_IFELSE(
12771275
[ AC_LANG_PROGRAM(
12781276
[[ #include <cstdlib> ]],
12791277
[[ int nErr = std::system(""); ]]
12801278
)],
1281-
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STD__SYSTEM, 1, Define to 1 if you have the `std::system' function.)],
1279+
[ AC_MSG_RESULT(yes); have_any_system=yes],
12821280
[ AC_MSG_RESULT(no) ]
12831281
)
12841282

@@ -1288,12 +1286,13 @@ AC_LINK_IFELSE(
12881286
[[ #include <stdlib.h> ]],
12891287
[[ int nErr = ::_wsystem(NULL); ]]
12901288
)],
1291-
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_WSYSTEM, 1, Define to 1 if you have the `::wsystem' function.)],
1289+
[ AC_MSG_RESULT(yes); have_any_system=yes],
12921290
[ AC_MSG_RESULT(no) ]
12931291
)
12941292

1295-
# Define to 1 if std::system or ::wsystem (Windows) is available
1296-
AC_DEFINE([HAVE_SYSTEM], [HAVE_STD__SYSTEM || HAVE_WSYSTEM], [std::system or ::wsystem])
1293+
if test "x$have_any_system" != "xno"; then
1294+
AC_DEFINE(HAVE_SYSTEM, 1, Define to 1 if std::system or ::wsystem is available.)
1295+
fi
12971296

12981297
dnl SUPPRESSED_CPPFLAGS=SUPPRESS_WARNINGS([$SOME_CPPFLAGS])
12991298
dnl Replace -I with -isystem in $SOME_CPPFLAGS to suppress warnings from
@@ -1585,15 +1584,13 @@ dnl libmultiprocess library check
15851584

15861585
libmultiprocess_found=no
15871586
if test "x$with_libmultiprocess" = xyes || test "x$with_libmultiprocess" = xauto; then
1588-
m4_ifdef([PKG_CHECK_MODULES], [PKG_CHECK_MODULES([LIBMULTIPROCESS], [libmultiprocess], [
1587+
PKG_CHECK_MODULES([LIBMULTIPROCESS], [libmultiprocess], [
15891588
libmultiprocess_found=yes;
15901589
libmultiprocess_prefix=`$PKG_CONFIG --variable=prefix libmultiprocess`;
1591-
], [true])])
1590+
], [true])
15921591
elif test "x$with_libmultiprocess" != xno; then
15931592
AC_MSG_ERROR([--with-libmultiprocess=$with_libmultiprocess value is not yes, auto, or no])
15941593
fi
1595-
AC_SUBST(LIBMULTIPROCESS_CFLAGS)
1596-
AC_SUBST(LIBMULTIPROCESS_LIBS)
15971594

15981595
dnl Enable multiprocess check
15991596

@@ -1882,17 +1879,12 @@ AC_SUBST(USE_BDB)
18821879
AC_SUBST(USE_UPNP)
18831880
AC_SUBST(USE_QRCODE)
18841881
AC_SUBST(BOOST_LIBS)
1885-
AC_SUBST(SQLITE_LIBS)
18861882
AC_SUBST(TESTDEFS)
18871883
AC_SUBST(MINIUPNPC_CPPFLAGS)
18881884
AC_SUBST(MINIUPNPC_LIBS)
18891885
AC_SUBST(GMP_LIBS)
18901886
AC_SUBST(NATPMP_CPPFLAGS)
18911887
AC_SUBST(NATPMP_LIBS)
1892-
AC_SUBST(EVENT_LIBS)
1893-
AC_SUBST(EVENT_PTHREADS_LIBS)
1894-
AC_SUBST(ZMQ_LIBS)
1895-
AC_SUBST(QR_LIBS)
18961888
AC_SUBST(DSYMUTIL_FLAT)
18971889
AC_SUBST(HAVE_FDATASYNC)
18981890
AC_SUBST(HAVE_FULLFSYNC)
@@ -1947,9 +1939,9 @@ esac
19471939

19481940
echo
19491941
echo "Options used to compile and link:"
1950-
echo " boost process = $with_boost_process"
1951-
echo " multiprocess = $build_multiprocess"
1952-
echo " with libs = $build_bitcoin_libs"
1942+
echo " boost process = $with_boost_process"
1943+
echo " multiprocess = $build_multiprocess"
1944+
echo " with libs = $build_bitcoin_libs"
19531945
echo " with wallet = $enable_wallet"
19541946
echo " with gui / qt = $bitcoin_enable_qt"
19551947
if test "x$enable_wallet" != "xno"; then
@@ -1979,7 +1971,7 @@ echo " miner enabled = $enable_miner"
19791971
echo " gprof enabled = $enable_gprof"
19801972
echo " werror = $enable_werror"
19811973
echo
1982-
echo " target os = $TARGET_OS"
1974+
echo " target os = $host_os"
19831975
echo " build os = $build_os"
19841976
echo
19851977
echo " CC = $CC"

depends/hosts/mingw32.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
ifneq ($(shell which $(host)-g++-posix),)
2+
mingw32_CXX := $(host)-g++-posix
3+
endif
4+
15
mingw32_CFLAGS=-pipe
26
mingw32_CXXFLAGS=$(mingw32_CFLAGS)
37

depends/packages/boost.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ else
3131
$(package)_toolset_$(host_os)=gcc
3232
endif
3333
$(package)_config_libraries=filesystem,test
34-
$(package)_cxxflags=-std=c++17 -fvisibility=hidden
34+
$(package)_cxxflags=-std=c++17
3535
$(package)_cxxflags_linux=-fPIC
3636
$(package)_cxxflags_freebsd=-fPIC
3737
$(package)_cxxflags_openbsd=-fPIC
@@ -54,5 +54,5 @@ define $(package)_build_cmds
5454
endef
5555

5656
define $(package)_stage_cmds
57-
b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) install
57+
b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) --no-cmake-config install
5858
endef

doc/build-windows.md

Lines changed: 18 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ Below are some notes on how to build Dash Core for Windows.
55

66
The options known to work for building Dash Core on Windows are:
77

8-
* On Linux, using the [Mingw-w64](https://mingw-w64.org/doku.php) cross compiler tool chain. Ubuntu Focal 20.04 is required
9-
and is the platform used to build the Dash Core Windows release binaries.
10-
* On Windows, using [Windows
11-
Subsystem for Linux (WSL)](https://docs.microsoft.com/windows/wsl/about) and the Mingw-w64 cross compiler tool chain.
12-
* On Windows, using a native compiler tool chain such as [Visual Studio](https://www.visualstudio.com).
8+
* On Linux, using the [Mingw-w64](https://www.mingw-w64.org/) cross compiler tool chain.
9+
* On Windows, using [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/windows/wsl/about) and Mingw-w64.
1310

1411
Other options which may work, but which have not been extensively tested are (please contribute instructions):
1512

@@ -18,86 +15,51 @@ Other options which may work, but which have not been extensively tested are (pl
1815
Installing Windows Subsystem for Linux
1916
---------------------------------------
2017

21-
With Windows 10, Microsoft has released a new feature named the [Windows
22-
Subsystem for Linux (WSL)](https://docs.microsoft.com/windows/wsl/about). This
23-
feature allows you to run a bash shell directly on Windows in an Ubuntu-based
24-
environment. Within this environment you can cross compile for Windows without
25-
the need for a separate Linux VM or server. Note that while WSL can be installed with
26-
other Linux variants, such as OpenSUSE, the following instructions have only been
27-
tested with Ubuntu.
28-
29-
This feature is not supported in versions of Windows prior to Windows 10 or on
30-
Windows Server SKUs. In addition, it is available [only for 64-bit versions of
31-
Windows](https://docs.microsoft.com/windows/wsl/install-win10).
32-
33-
Full instructions to install WSL are available on the above link.
34-
To install WSL on Windows 10 with Fall Creators Update installed (version >= 16215.0) do the following:
35-
36-
1. Enable the Windows Subsystem for Linux feature
37-
* Open the Windows Features dialog (`OptionalFeatures.exe`)
38-
* Enable 'Windows Subsystem for Linux'
39-
* Click 'OK' and restart if necessary
40-
2. Install Ubuntu
41-
* Open Microsoft Store and search for "Ubuntu 20.04" or use [this link](https://www.microsoft.com/store/productId/9MTTCL66CPXJ)
42-
* Click Install
43-
3. Complete Installation
44-
* Open a cmd prompt and type "Ubuntu2004"
45-
* Create a new UNIX user account (this is a separate account from your Windows account)
46-
47-
After the bash shell is active, you can follow the instructions below, starting
48-
with the "Cross-compilation" section. Compiling the 64-bit version is
49-
recommended, but it is possible to compile the 32-bit version.
18+
Follow the upstream installation instructions, available [here](https://docs.microsoft.com/windows/wsl/install-win10).
5019

5120
Cross-compilation
5221
-------------------
5322

54-
These steps can be performed on, for example, an Ubuntu VM. The depends system
23+
The steps below can be performed on Ubuntu or WSL. The depends system
5524
will also work on other Linux distributions, however the commands for
5625
installing the toolchain will be different.
5726

5827
First, install the general dependencies:
5928

60-
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils bison curl
29+
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git bison
6130

6231
A host toolchain (`build-essential`) is necessary because some dependency
63-
packages (such as `protobuf`) need to build host utilities that are used in the
64-
build process.
32+
packages need to build host utilities that are used in the build process.
33+
34+
See [dependencies.md](dependencies.md) for a complete overview.
6535

6636
## Building for 64-bit Windows
6737

68-
To build executables for Windows 64-bit, install the following dependencies:
38+
The first step is to install the mingw-w64 cross-compilation tool chain:
6939

7040
sudo apt-get install g++-mingw-w64-x86-64 mingw-w64-x86-64-dev
7141

72-
Then build using:
73-
74-
cd depends
75-
make HOST=x86_64-w64-mingw32
76-
cd ..
77-
./autogen.sh # not required when building from tarball
78-
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
79-
make
80-
81-
## Building for 32-bit Windows
82-
83-
To build executables for Windows 32-bit, install the following dependencies:
42+
Once the toolchain is installed the build steps are common:
8443

85-
sudo apt-get install g++-mingw-w64-i686 mingw-w64-i686-dev
44+
Note that for WSL the Dash Core source path MUST be somewhere in the default mount file system, for
45+
example /usr/src/dash, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail.
46+
This means you cannot use a directory that is located directly on the host Windows file system to perform the build.
8647

8748
Additional WSL Note: WSL support for [launching Win32 applications](https://docs.microsoft.com/en-us/archive/blogs/wsl/windows-and-ubuntu-interoperability#launching-win32-applications-from-within-wsl)
8849
results in `Autoconf` configure scripts being able to execute Windows Portable Executable files. This can cause
8950
unexpected behaviour during the build, such as Win32 error dialogs for missing libraries. The recommended approach
9051
is to temporarily disable WSL support for Win32 applications.
9152

92-
Then build using:
53+
Build using:
9354

55+
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
9456
sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status" # Disable WSL support for Win32 applications.
9557
cd depends
96-
make HOST=i686-w64-mingw32
58+
make HOST=x86_64-w64-mingw32
9759
cd ..
9860
./autogen.sh
99-
CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --prefix=/
100-
make
61+
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
62+
make # use "-j N" for N parallel jobs
10163
sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status" # Enable WSL support for Win32 applications.
10264

10365
## Depends system

src/Makefile.leveldb.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ LEVELDB_CPPFLAGS_INT += -DHAVE_SNAPPY=0 -DHAVE_CRC32C=1
2222
LEVELDB_CPPFLAGS_INT += -DHAVE_FDATASYNC=@HAVE_FDATASYNC@
2323
LEVELDB_CPPFLAGS_INT += -DHAVE_FULLFSYNC=@HAVE_FULLFSYNC@
2424
LEVELDB_CPPFLAGS_INT += -DHAVE_O_CLOEXEC=@HAVE_O_CLOEXEC@
25+
LEVELDB_CPPFLAGS_INT += -DFALLTHROUGH_INTENDED=[[fallthrough]]
2526

2627
if WORDS_BIGENDIAN
2728
LEVELDB_CPPFLAGS_INT += -DLEVELDB_IS_BIG_ENDIAN=1

src/bench/peer_eviction.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ static void EvictionProtectionCommon(
2727
candidate_setup_fn(c);
2828
}
2929

30-
std::vector<Candidates> copies{bench.epochs() * bench.epochIterations(), candidates};
30+
std::vector<Candidates> copies{
31+
static_cast<size_t>(bench.epochs() * bench.epochIterations()), candidates};
3132
size_t i{0};
3233
bench.run([&] {
3334
ProtectEvictionCandidatesByRatio(copies.at(i));

src/hash.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ unsigned int MurmurHash3(unsigned int nHashSeed, Span<const unsigned char> vData
4747
switch (vDataToHash.size() & 3) {
4848
case 3:
4949
k1 ^= tail[2] << 16;
50+
[[fallthrough]];
5051
case 2:
5152
k1 ^= tail[1] << 8;
53+
[[fallthrough]];
5254
case 1:
5355
k1 ^= tail[0];
5456
k1 *= c1;

0 commit comments

Comments
 (0)