aboutsummaryrefslogtreecommitdiff
path: root/doc/build-unix.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/build-unix.md')
-rw-r--r--doc/build-unix.md99
1 files changed, 15 insertions, 84 deletions
diff --git a/doc/build-unix.md b/doc/build-unix.md
index 0960ae1577..3633d4f811 100644
--- a/doc/build-unix.md
+++ b/doc/build-unix.md
@@ -4,16 +4,6 @@ Some notes on how to build Bitcoin Core in Unix.
(For BSD specific instructions, see `build-*bsd.md` in this directory.)
-Note
----------------------
-Always use absolute paths to configure and compile Bitcoin Core and the dependencies.
-For example, when specifying the path of the dependency:
-
- ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX
-
-Here BDB_PREFIX must be an absolute path - it is defined using $(pwd) which ensures
-the usage of the absolute path.
-
To Build
---------------------
@@ -24,12 +14,11 @@ make # use "-j N" for N parallel jobs
make install # optional
```
-This will build bitcoin-qt as well, if the dependencies are met.
-
-See [dependencies.md](dependencies.md) for a complete overview.
+See below for instructions on how to [install the dependencies on popular Linux
+distributions](#linux-distribution-specific-instructions), or the
+[dependencies](#dependencies) section for a complete overview.
-Memory Requirements
---------------------
+## Memory Requirements
C++ compilers are memory-hungry. It is recommended to have at least 1.5 GB of
memory available when compiling Bitcoin Core. On systems with less, gcc can be
@@ -57,7 +46,7 @@ Build requirements:
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
-Now, you can either build from self-compiled [depends](/depends/README.md) or install the required dependencies:
+Now, you can either build from self-compiled [depends](#dependencies) or install the required dependencies:
sudo apt-get install libevent-dev libboost-dev
@@ -65,7 +54,7 @@ SQLite is required for the descriptor wallet:
sudo apt install libsqlite3-dev
-Berkeley DB is required for the legacy wallet. Ubuntu and Debian have their own `libdb-dev` and `libdb++-dev` packages,
+Berkeley DB is only required for the legacy wallet. Ubuntu and Debian have their own `libdb-dev` and `libdb++-dev` packages,
but these will install Berkeley DB 5.1 or later. This will break binary wallet compatibility with the distributed
executables, which are based on BerkeleyDB 4.8. If you do not care about wallet compatibility, pass
`--with-incompatible-bdb` to configure. Otherwise, you can build Berkeley DB [yourself](#berkeley-db).
@@ -114,7 +103,7 @@ Build requirements:
sudo dnf install gcc-c++ libtool make autoconf automake python3
-Now, you can either build from self-compiled [depends](/depends/README.md) or install the required dependencies:
+Now, you can either build from self-compiled [depends](#dependencies) or install the required dependencies:
sudo dnf install libevent-devel boost-devel
@@ -126,7 +115,7 @@ Berkeley DB is required for the legacy wallet:
sudo dnf install libdb4-devel libdb4-cxx-devel
-Newer Fedora releases, since Fedora 33, have only `libdb-devel` and `libdb-cxx-devel` packages, but these will install
+Berkeley DB is only required for the legacy wallet. Newer Fedora releases have only `libdb-devel` and `libdb-cxx-devel` packages, but these will install
Berkeley DB 5.3 or later. This will break binary wallet compatibility with the distributed executables, which
are based on Berkeley DB 4.8. If you do not care about wallet compatibility,
pass `--with-incompatible-bdb` to configure. Otherwise, you can build Berkeley DB [yourself](#berkeley-db).
@@ -166,27 +155,13 @@ libqrencode (optional) can be installed with:
Once these are installed, they will be found by configure and a bitcoin-qt executable will be
built by default.
-Notes
------
-The release is built with GCC and then "strip bitcoind" to strip the debug
-symbols, which reduces the executable size by about 90%.
+## Dependencies
-miniupnpc
----------
+See [dependencies.md](dependencies.md) for a complete overview, and
+[depends](/depends/README.md) on how to compile them yourself, if you wish to
+not use the packages of your Linux distribution.
-[miniupnpc](https://miniupnp.tuxfamily.org) may be used for UPnP port mapping. It can be downloaded from [here](
-https://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and
-turned off by default.
-
-libnatpmp
----------
-
-[libnatpmp](https://miniupnp.tuxfamily.org/libnatpmp.html) may be used for NAT-PMP port mapping. It can be downloaded
-from [here](https://miniupnp.tuxfamily.org/files/). NAT-PMP support is compiled in and
-turned off by default.
-
-Berkeley DB
------------
+### Berkeley DB
The legacy wallet uses Berkeley DB. To ensure backwards compatibility it is
recommended to use Berkeley DB 4.8. If you have to build it yourself, and don't
@@ -205,53 +180,9 @@ export BDB_PREFIX="/path/to/bitcoin/depends/x86_64-pc-linux-gnu"
BDB_CFLAGS="-I${BDB_PREFIX}/include"
```
-**Note**: You only need Berkeley DB if the legacy wallet is enabled (see [*Disable-wallet mode*](#disable-wallet-mode)).
-
-Security
---------
-To help make your Bitcoin Core installation more secure by making certain attacks impossible to
-exploit even if a vulnerability is found, binaries are hardened by default.
-This can be disabled with:
-
-Hardening Flags:
+**Note**: Make sure that `BDB_PREFIX` is an absolute path.
- ./configure --enable-hardening
- ./configure --disable-hardening
-
-
-Hardening enables the following features:
-* _Position Independent Executable_: Build position independent code to take advantage of Address Space Layout Randomization
- offered by some kernels. Attackers who can cause execution of code at an arbitrary memory
- location are thwarted if they don't know where anything useful is located.
- The stack and heap are randomly located by default, but this allows the code section to be
- randomly located as well.
-
- On an AMD64 processor where a library was not compiled with -fPIC, this will cause an error
- such as: "relocation R_X86_64_32 against `......' can not be used when making a shared object;"
-
- To test that you have built PIE executable, install scanelf, part of paxutils, and use:
-
- scanelf -e ./bitcoin
-
- The output should contain:
-
- TYPE
- ET_DYN
-
-* _Non-executable Stack_: If the stack is executable then trivial stack-based buffer overflow exploits are possible if
- vulnerable buffers are found. By default, Bitcoin Core should be built with a non-executable stack,
- but if one of the libraries it uses asks for an executable stack or someone makes a mistake
- and uses a compiler extension which requires an executable stack, it will silently build an
- executable without the non-executable stack protection.
-
- To verify that the stack is non-executable after compiling use:
- `scanelf -e ./bitcoin`
-
- The output should contain:
- STK/REL/PTL
- RW- R-- RW-
-
- The STK RW- means that the stack is readable and writeable but not executable.
+**Note**: You only need Berkeley DB if the legacy wallet is enabled (see [*Disable-wallet mode*](#disable-wallet-mode)).
Disable-wallet mode
--------------------