Changeset View
Changeset View
Standalone View
Standalone View
doc/build-unix.md
Show All 11 Lines | |||||
```bash | ```bash | ||||
mkdir build | mkdir build | ||||
cd build | cd build | ||||
cmake -GNinja .. | cmake -GNinja .. | ||||
ninja | ninja | ||||
ninja install # optional | ninja install # optional | ||||
``` | ``` | ||||
This will build bitcoin-qt as well. | This will build ecash-qt as well. | ||||
Dependencies | Dependencies | ||||
--------------------- | --------------------- | ||||
*Note: Bitcoin ABC provides a [Docker image with all the dependencies preinstalled](#build-using-a-docker-container).* | *Note: Bitcoin ABC provides a [Docker image with all the dependencies preinstalled](#build-using-a-docker-container).* | ||||
These dependencies are required: | These dependencies are required: | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | |||||
jemalloc dependencies (provides the jemalloc library, can be disabled by passing `-DUSE_JEMALLOC=OFF` on the cmake command line): | jemalloc dependencies (provides the jemalloc library, can be disabled by passing `-DUSE_JEMALLOC=OFF` on the cmake command line): | ||||
sudo apt-get install libjemalloc-dev | sudo apt-get install libjemalloc-dev | ||||
Dependencies for the GUI: Ubuntu & Debian | Dependencies for the GUI: Ubuntu & Debian | ||||
----------------------------------------- | ----------------------------------------- | ||||
If you want to build bitcoin-qt, make sure that the required packages for Qt development | If you want to build ecash-qt, make sure that the required packages for Qt development | ||||
are installed. Qt 5 is necessary to build the GUI. | are installed. Qt 5 is necessary to build the GUI. | ||||
To build without GUI pass `-DBUILD_BITCOIN_QT=OFF` on the cmake command line. | To build without GUI pass `-DBUILD_BITCOIN_QT=OFF` on the cmake command line. | ||||
To build with Qt 5 you need the following: | To build with Qt 5 you need the following: | ||||
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler | sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler | ||||
libqrencode dependencies (can be disabled by passing `-DENABLE_QRCODE=OFF` on the cmake command line): | libqrencode dependencies (can be disabled by passing `-DENABLE_QRCODE=OFF` on the cmake command line): | ||||
Show All 19 Lines | To build with Qt 5 you need the following: | ||||
sudo dnf install qt5-qttools-devel qt5-qtbase-devel protobuf-devel | sudo dnf install qt5-qttools-devel qt5-qtbase-devel protobuf-devel | ||||
libqrencode dependencies (can be disabled by passing `-DENABLE_QRCODE=OFF`): | libqrencode dependencies (can be disabled by passing `-DENABLE_QRCODE=OFF`): | ||||
sudo dnf install qrencode-devel | sudo dnf install qrencode-devel | ||||
Notes | Notes | ||||
----- | ----- | ||||
The release is built with GCC and then "strip bitcoind" to strip the debug | The release is built with GCC and then "strip ecashd" to strip the debug | ||||
symbols, which reduces the executable size by about 90%. | symbols, which reduces the executable size by about 90%. | ||||
miniupnpc | miniupnpc | ||||
--------- | --------- | ||||
[miniupnpc](https://miniupnp.tuxfamily.org) may be used for UPnP port mapping. It can be downloaded from [here]( | [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 | https://miniupnp.tuxfamily.org/files/). UPnP support is compiled in and | ||||
Show All 19 Lines | * _Position Independent Executable_: Build position independent code to take advantage of Address Space Layout Randomization | ||||
The stack and heap are randomly located by default, but this allows the code section to be | The stack and heap are randomly located by default, but this allows the code section to be | ||||
randomly located as well. | randomly located as well. | ||||
On an AMD64 processor where a library was not compiled with -fPIC, this will cause an error | 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;" | 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: | To test that you have built PIE executable, install scanelf, part of paxutils, and use: | ||||
scanelf -e ./bitcoin | scanelf -e ./ecash | ||||
The output should contain: | The output should contain: | ||||
TYPE | TYPE | ||||
ET_DYN | ET_DYN | ||||
* _Non-executable Stack_: If the stack is executable then trivial stack-based buffer overflow exploits are possible if | * _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 ABC should be built with a non-executable stack, | vulnerable buffers are found. By default, Bitcoin ABC 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 | 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 | and uses a compiler extension which requires an executable stack, it will silently build an | ||||
executable without the non-executable stack protection. | executable without the non-executable stack protection. | ||||
To verify that the stack is non-executable after compiling use: | To verify that the stack is non-executable after compiling use: | ||||
scanelf -e ./bitcoin | scanelf -e ./ecash | ||||
The output should contain: | The output should contain: | ||||
STK/REL/PTL | STK/REL/PTL | ||||
RW- R-- RW- | RW- R-- RW- | ||||
The `STK RW-` means that the stack is readable and writeable but not executable. | The `STK RW-` means that the stack is readable and writeable but not executable. | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |