Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

build-unix.txt 5.2KB

  1. Copyright (c) 2009-2012 Bitcoin Developers
  2. Distributed under the MIT/X11 software license, see the accompanying
  3. file license.txt or http://www.opensource.org/licenses/mit-license.php.
  4. This product includes software developed by the OpenSSL Project for use in
  5. the OpenSSL Toolkit (http://www.openssl.org/). This product includes
  6. cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP
  7. software written by Thomas Bernard.
  9. ================
  10. To Build
  11. --------
  12. cd src/
  13. make -f makefile.unix # Headless bitcoin
  14. See readme-qt.rst for instructions on building Bitcoin-Qt,
  15. the graphical user interface.
  16. Dependencies
  17. ------------
  18. Library Purpose Description
  19. ------- ------- -----------
  20. libssl SSL Support Secure communications
  21. libdb4.8 Berkeley DB Blockchain & wallet storage
  22. libboost Boost C++ Library
  23. miniupnpc UPnP Support Optional firewall-jumping support
  24. libqrencode QRCode generation Optional QRCode generation
  25. miniupnpc may be used for UPnP port mapping. It can be downloaded from
  26. http://miniupnp.tuxfamily.org/files/. UPnP support is compiled in and
  27. turned off by default. Set USE_UPNP to a different value to control this:
  28. USE_UPNP=- No UPnP support - miniupnp not required
  29. USE_UPNP=0 (the default) UPnP support turned off by default at runtime
  30. USE_UPNP=1 UPnP support turned on by default at runtime
  31. libqrencode may be used for QRCode image generation. It can be downloaded
  32. from http://fukuchi.org/works/qrencode/index.html.en, or installed via
  33. your package manager. Set USE_QRCODE to control this:
  34. USE_QRCODE=0 (the default) No QRCode support - libqrcode not required
  35. USE_QRCODE=1 QRCode support enabled
  36. IPv6 support may be enabled by setting
  37. USE_IPV6=1 Enable IPv6 support
  38. Licenses of statically linked libraries:
  39. Berkeley DB New BSD license with additional requirement that linked
  40. software must be free open source
  41. Boost MIT-like license
  42. miniupnpc New (3-clause) BSD license
  43. Versions used in this release:
  44. GCC 4.3.3
  45. OpenSSL 0.9.8g
  46. Berkeley DB 4.8.30.NC
  47. Boost 1.37
  48. miniupnpc 1.6
  49. Dependency Build Instructions: Ubuntu & Debian
  50. ----------------------------------------------
  51. sudo apt-get install build-essential
  52. sudo apt-get install libssl-dev
  53. sudo apt-get install libdb4.8-dev
  54. sudo apt-get install libdb4.8++-dev
  55. Boost 1.40+: sudo apt-get install libboost-all-dev
  56. or Boost 1.37: sudo apt-get install libboost1.37-dev
  57. sudo apt-get install libqrencode-dev
  58. If using Boost 1.37, append -mt to the boost libraries in the makefile.
  59. Dependency Build Instructions: Gentoo
  60. -------------------------------------
  61. Note: If you just want to install bitcoind on Gentoo, you can add the Bitcoin
  62. overlay and use your package manager:
  63. layman -a bitcoin && emerge bitcoind
  64. emerge -av1 --noreplace boost glib openssl sys-libs/db:4.8
  65. Take the following steps to build (no UPnP support):
  66. cd ${BITCOIN_DIR}/src
  67. make -f makefile.unix USE_UPNP= USE_IPV6=1 BDB_INCLUDE_PATH='/usr/include/db4.8'
  68. strip bitcoind
  69. Notes
  70. -----
  71. The release is built with GCC and then "strip bitcoind" to strip the debug
  72. symbols, which reduces the executable size by about 90%.
  73. miniupnpc
  74. ---------
  75. tar -xzvf miniupnpc-1.6.tar.gz
  76. cd miniupnpc-1.6
  77. make
  78. sudo su
  79. make install
  80. Berkeley DB
  81. -----------
  82. You need Berkeley DB 4.8. If you have to build Berkeley DB yourself:
  83. ../dist/configure --enable-cxx
  84. make
  85. Boost
  86. -----
  87. If you need to build Boost yourself:
  88. sudo su
  89. ./bootstrap.sh
  90. ./bjam install
  91. Security
  92. --------
  93. To help make your bitcoin installation more secure by making certain attacks impossible to
  94. exploit even if a vulnerability is found, you can take the following measures:
  95. * Position Independent Executable
  96. Build position independent code to take advantage of Address Space Layout Randomization
  97. offered by some kernels. An attacker who is able to cause execution of code at an arbitrary
  98. memory location is thwarted if he doesn't know where anything useful is located.
  99. The stack and heap are randomly located by default but this allows the code section to be
  100. randomly located as well.
  101. On an Amd64 processor where a library was not compiled with -fPIC, this will cause an error
  102. such as: "relocation R_X86_64_32 against `......' can not be used when making a shared object;"
  103. To build with PIE, use:
  104. make -f makefile.unix ... -e PIE=1
  105. To test that you have built PIE executable, install scanelf, part of paxutils, and use:
  106. scanelf -e ./bitcoin
  107. The output should contain:
  108. TYPE
  109. ET_DYN
  110. * Non-executable Stack
  111. If the stack is executable then trivial stack based buffer overflow exploits are possible if
  112. vulnerable buffers are found. By default, bitcoin should be built with a non-executable stack
  113. but if one of the libraries it uses asks for an executable stack or someone makes a mistake
  114. and uses a compiler extension which requires an executable stack, it will silently build an
  115. executable without the non-executable stack protection.
  116. To verify that the stack is non-executable after compiling use:
  117. scanelf -e ./bitcoin
  118. the output should contain:
  119. STK/REL/PTL
  120. RW- R-- RW-
  121. The STK RW- means that the stack is readable and writeable but not executable.