diff --git a/doc/build-cross.md b/doc/build-cross.md index b8f227ded..0dfd04081 100644 --- a/doc/build-cross.md +++ b/doc/build-cross.md @@ -46,17 +46,32 @@ $ sudo apt-get install nsis wine-stable wine64 bc For Windows 64bit, install : ```bash $ sudo apt-get install g++-mingw-w64-x86-64 -$ # Required to enable C++ threading libraries (e.g. std::thread) -$ sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix -$ sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix +``` + +If you're building on Ubuntu 17.04 or later, run these two commands, selecting the 'posix' variant for both, +to work around issues with mingw-w64. See issue [8732](https://github.com/bitcoin/bitcoin/issues/8732) for more information. +This also fixes linker issues related to std::thread and other threading related standard C++ libraries. +``` +sudo update-alternatives --config x86_64-w64-mingw32-g++ +sudo update-alternatives --config x86_64-w64-mingw32-gcc ``` For Windows 32bit, install: ```bash $ sudo apt-get install g++-mingw-w64-i686 -$ # Required to enable C++ threading libraries (e.g. std::thread) -$ sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix -$ sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix +``` + +If you're building on Ubuntu 17.04 or later, run these two commands, selecting the 'posix' variant for both, +to fix linker issues related to std::thread and other threading related standard C++ libraries. +``` +sudo update-alternatives --config x86_64-w64-mingw32-g++ +sudo update-alternatives --config x86_64-w64-mingw32-gcc +``` + +Before building for Windows 32bit or 64bit, run + +``` +$ PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var ``` When building the dependencies, as described in [build-generic](build-generic.md), use diff --git a/doc/build-windows.md b/doc/build-windows.md index e8b6e3d85..5639b3ac4 100644 --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -4,10 +4,11 @@ WINDOWS BUILD NOTES Below are some notes on how to build Dash Core for Windows. Most developers use cross-compilation from Ubuntu to build executables for -Windows. This is also used to build the release binaries. +Windows. Cross-compilation is also used to build the release binaries. -Currently only building on Ubuntu Trusty 14.04 is supported. -Other versions are unsupported or known to be broken (e.g. Ubuntu Xenial 16.04). +Currently only building on Ubuntu Trusty 14.04 or Ubuntu Zesty 17.04 or later is supported. +Building on Ubuntu Xenial 16.04 is known to be broken, see extensive discussion in issue [8732](https://github.com/bitcoin/bitcoin/issues/8732). +While it may be possible to do so with work arounds, it's potentially dangerous and not recommended. While there are potentially a number of ways to build on Windows (for example using msys / mingw-w64), using the Windows Subsystem For Linux is the most straightforward. If you are building with