Commit graph

401 commits

Author SHA1 Message Date
fanquake acd644b83d build: remove --large-address-aware linker flag
This flag was used when building 32-bit Windows executables, which we no-longer 
do, and is not accepted by the linker for any of the hosts we currently build 
for. i.e:

```bash
checking whether the linker accepts -Wl,--large-address-aware... no
```

--large-address-aware
    If given, the appropriate bit in the "Characteristics" field of the COFF
    header is set to indicate that this executable supports virtual addresses
    greater than 2 gigabytes. This should be used in conjunction with the /3GB
    or /USERVA=value megabytes switch in the "[operating systems]" section of
    the BOOT .INI. Otherwise, this bit has no effect. [This option is specific
    to PE targeted ports of the linker]

You can check that the appropriate bit in the COFF header of our current
Windows binaries is still be set using dumpbin. i.e:

```powershell
dumpbin /headers .\bitcoind.exe 

FILE HEADER VALUES
<snip>
26 characteristics
     Executable
     Line numbers stripped
     Application can handle large (>2GB) addresses
```
2020-01-26 10:43:10 +08:00
fanquake 2525c096b0
build: remove configure checks for win libraries we don't link against
While cross compiling, HOST=x86_64-w64-mingw32, none of these
libs actually seem to be passed to the linker.
2020-01-23 07:59:54 +08:00
Wladimir J. van der Laan 7a311fa54a
Merge #17738: build: remove linking librt for backwards compatibility
f7453dcc03 build: remove linking librt for backwards compatibility (fanquake)

Pull request description:

  Now that we require glibc 2.17+, see #17538, we can remove linking librt
  for backwards compatibility purposes. The `clock_*` functions from librt
  were merged into glibc as part of the [2.17 release](https://sourceware.org/ml/libc-announce/2012/msg00001.html):

  * The `clock_*` suite of functions (declared in <time.h>) is now available
    directly in the main C library.  Previously it was necessary to link with
    -lrt to use these functions.  This change has the effect that a
    single-threaded program that uses a function such as `clock_gettime' (and
    is not linked with -lrt) will no longer implicitly load the pthreads
    library at runtime and so will not suffer the overheads associated with
    multi-thread support in other code such as the C++ runtime library.

  Note that `librt` is already unused by the RISC-V and AARCH64 binaries as their librts don't export any `clock_*` functions. As an example, you can find a diff of the arm32 vs arm64 librt symbols [here](https://gist.github.com/fanquake/b08cb1f0d14df3133395d7796ebf030c).

  Below is the library usage for the `v0.19.0.1` release (can delete these tables pre-merge).

  #### RISC-V
  ```bash
  riscv/bin/bitcoin-cli: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1']
  riscv/bin/bitcoin-qt: ['libpthread.so.0', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1', 'libatomic.so.1']
  riscv/bin/bitcoin-wallet: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1', 'libatomic.so.1']
  riscv/bin/bitcoind: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1', 'libatomic.so.1']
  riscv/bin/bitcoin-tx: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1']
  riscv/bin/test_bitcoin: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-riscv64-lp64d.so.1', 'libatomic.so.1']
  ```

  #### AARCH64
  ```bash
  aarch64/bin/bitcoin-cli: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
  aarch64/bin/bitcoin-qt: ['libpthread.so.0', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
  aarch64/bin/bitcoin-wallet: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
  aarch64/bin/bitcoind: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
  aarch64/bin/bitcoin-tx: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
  aarch64/bin/test_bitcoin: ['libpthread.so.0', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-aarch64.so.1']
  ```

  #### ARM LINUX GNUEABIHF
  ```bash
  arm32/bin/bitcoin-cli: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
  arm32/bin/bitcoin-qt: ['libpthread.so.0', 'librt.so.1', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
  arm32/bin/bitcoin-wallet: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
  arm32/bin/bitcoind: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
  arm32/bin/bitcoin-tx: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
  arm32/bin/test_bitcoin: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-armhf.so.3']
  ```

  #### LINUX X86_64
  ```bash
  x86_64/bin/bitcoin-cli: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
  x86_64/bin/bitcoin-qt: ['libpthread.so.0', 'librt.so.1', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
  x86_64/bin/bitcoin-wallet: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
  x86_64/bin/bitcoind: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
  x86_64/bin/bitcoin-tx: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
  x86_64/bin/test_bitcoin: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux-x86-64.so.2']
  ```

  #### LINUX i686
  ```bash
  i686/bin/bitcoin-cli: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
  i686/bin/bitcoin-qt: ['libpthread.so.0', 'librt.so.1', 'libfontconfig.so.1', 'libfreetype.so.6', 'libxcb.so.1', 'libdl.so.2', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
  i686/bin/bitcoin-wallet: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
  i686/bin/bitcoind: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
  i686/bin/bitcoin-tx: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
  i686/bin/test_bitcoin: ['libpthread.so.0', 'librt.so.1', 'libm.so.6', 'libgcc_s.so.1', 'libc.so.6', 'ld-linux.so.2']
  ```

ACKs for top commit:
  laanwj:
    ACK f7453dcc03

Tree-SHA512: b418260edcda88583abfa386a592ebfb977d111e8e2ba887a30bf830b0b10dba429b9cfd615fad453ff0bb824225914ccb91433064b158ae1fbb9d20fc0b9937
2020-01-22 22:24:51 +01:00
fanquake b0a254019c build: add Wdate-time to Werror flags
-Wdate-time

    Warn when macros __TIME__, __DATE__ or __TIMESTAMP__ are encountered as 
    they might prevent bit-wise-identical reproducible compilations.

This is supported by GCC and Clang.
https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
https://clang.llvm.org/docs/DiagnosticsReference.html#wdate-time
2020-01-06 09:02:01 +08:00
fanquake f7453dcc03
build: remove linking librt for backwards compatibility
Now that we require glibc 2.17+, #17538, we can remove linking in librt
for backwards compatibility purposes. The clock_* functions from librt
were merged into glibc as part of the 2.17 release.

* The `clock_*' suite of functions (declared in <time.h>) is now available
  directly in the main C library.  Previously it was necessary to link with
  -lrt to use these functions.  This change has the effect that a
  single-threaded program that uses a function such as `clock_gettime' (and
  is not linked with -lrt) will no longer implicitly load the pthreads
  library at runtime and so will not suffer the overheads associated with
  multi-thread support in other code such as the C++ runtime library.

https://sourceware.org/ml/libc-announce/2012/msg00001.html

Note that librt is already not linked by the RISC-V and AARCH64 binaries.
2019-12-31 21:58:00 +03:00
Emil Engler 8dc9aa90c3
doc: Update license year range to 2020 2019-12-26 23:11:21 +01:00
fanquake 4f4ae6f97e build: set AC_PREREQ to 2.69
We use build macros such as AX_CHECK_LINK_FLAG, that require >=2.64, so
our configure should also require Autoconf >= 2.64. The build would
already blow up if 2.64 wasn't available. i.e:

configure.ac:320: error: Autoconf version 2.64 or higher is required
build-aux/m4/ax_check_link_flag.m4:74: AX_CHECK_LINK_FLAG is expanded from...

For reference, Autoconf 2.69 was released in April of 2012.
https://lists.gnu.org/archive/html/autoconf/2012-04/msg00041.html

See https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Versioning.html
for more info on AC_PREREQ.
2019-12-18 16:36:17 -05:00
fanquake 47f45b6776
Merge #17686: build: add -bind_at_load to macOS hardened LDFLAGS
c78b123982 build: add -bind_at_load to hardened LDFLAGS (fanquake)

Pull request description:

  This performs the same function as `-Wl,-z,now`, except for ld on macOS.

  You can check the binaries using `otool -l`, and looking for the `LC_DYLD_INFO_ONLY` section; `lazy_bind_off` and `lazy_bind_size` should both be 0.

  This seems to be the case with our current release binaries. However we can make the check, and applying the flag explicit in configure.

  man ld:
  ```bash
  -bind_at_load
  Sets a bit in the mach header of the resulting binary which tells dyld
  to bind all symbols when the binary is loaded, rather than lazily.
  ```
  TODO:
  - [ ] Follow up with `MH_BINDATLOAD` flag.

ACKs for top commit:
  theuni:
    ACK c78b123982.

Tree-SHA512: 12259558b84f7e3d75d6fcde63b517685e42b18fcf8e8cfcf347483c5ba089d3b4b6d330e7b7f61f83a328fe4d141b771e8e52ddee9cac6da87dfc073ab1183d
2019-12-17 16:32:18 -05:00
fanquake abc147de95
build: remove WINDOWS_BITS from build system
We no longer build/ship 32 bit windows executables.
2019-12-16 13:12:29 -05:00
fanquake c78b123982
build: add -bind_at_load to hardened LDFLAGS
This performs the same function as -Wl,-z,now, except for ld on macOS.

You can check the binaries using otool -l, looking for the
LC_DYLD_INFO_ONLY section. lazy_bind_off and lazy_bind_size should both
be 0.

man ld:

-bind_at_load
Sets a bit in the mach header of the resulting binary which tells dyld
to bind all symbols when the binary is loaded, rather than lazily.
2019-12-13 09:33:20 -05:00
fanquake 3ab1824625
build: Use dnl for all comments in configure.ac, rather than # 2019-12-10 08:35:33 -05:00
fanquake 8ddcbb4e41
build: Remove backticks from configure.ac 2019-12-10 08:35:10 -05:00
Wladimir J. van der Laan c7c9c44278
Merge #17663: build: pass -dead_strip_dylibs to ld on macOS
bd44711e1b build: pass -dead_strip_dylibs to ld on macOS (fanquake)

Pull request description:

  This strips some unused dylibs from bitcoin-qt.

  ```diff
  otool -L src/qt/bitcoin-qt
    /usr/lib/libSystem.B.dylib
  - /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  -/System/Library/Frameworks/Security.framework/Versions/A/Security
    /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
    /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
  -/System/Library/Frameworks/AGL.framework/Versions/A/AGL
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
    /usr/lib/libc++.1.dylib
    /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
    /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
    /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
    /usr/lib/libobjc.A.dylib
  ```

  `AGL` - ObjC wrapper for OpenGL.
  `DiskArbitration` - mount/unmount notifications and events.
  `Security` - low level security operations, authentication services.

  From `man ld`:
  ```
  Remove dylibs that are unreachable by the entry point or exported symbols.
  That is, suppresses the generation of load command commands for dylibs
  which supplied no symbols during the link. This option should not be
  used when linking against a dylib which is required at runtime for
  some indirect reason such as the dylib has an important initializer.
  ```

ACKs for top commit:
  theuni:
    ACK bd44711e1b.

Tree-SHA512: 9592ce2966d28cb6c58e01efd401f56a4baa5dc5be5313f4fe8454632b578608be65a23c8602772049cd4655a9cb020fdd40d6622a244c301920d8c3db43f99a
2019-12-06 09:11:14 +01:00
fanquake bd44711e1b build: pass -dead_strip_dylibs to ld on macOS
This strips some unused dylibs from bitcoin-qt.

From man ld:
Remove dylibs that are unreachable by the entry point or exported symbols. 
That is, suppresses the generation of load command commands for dylibs 
which supplied no symbols during the link. This option should not be 
used when linking against a dylib which is required at runtime for 
some indirect reason such as the dylib has an important initializer.
2019-12-03 17:50:30 -05:00
Hennadii Stepanov 651c636f9e
build: Fix configure report about qr 2019-11-21 13:52:41 +02:00
fanquake 8983ee3e6d
build: remove OpenSSL detection and libs 2019-11-18 08:56:47 -05:00
Wladimir J. van der Laan 0bb37e437e
Merge #17270: Feed environment data into RNG initializers
d1c02775aa Report amount of data gathered from environment (Pieter Wuille)
64e1e022ce Use thread-safe atomic in perfmon seeder (Pieter Wuille)
d61f2bb076 Run background seeding periodically instead of unpredictably (Pieter Wuille)
483b94292e Add information gathered through getauxval() (Pieter Wuille)
11793ea22e Feed CPUID data into RNG (Pieter Wuille)
a81c494b4c Use sysctl for seeding on MacOS/BSD (Pieter Wuille)
2554c1b81b Gather additional entropy from the environment (Pieter Wuille)
c2a262a78c Seed randomness with process id / thread id / various clocks (Pieter Wuille)
723c796667 [MOVEONLY] Move cpuid code from random & sha256 to compat/cpuid (Pieter Wuille)
cea3902015 [MOVEONLY] Move perfmon data gathering to new randomenv module (Pieter Wuille)
b51bae1a5a doc: minor corrections in random.cpp (fanquake)

Pull request description:

  This introduces a new `randomenv` module that queries varies non-cryptographic (and non-RNG) sources of entropy available on the system; things like user IDs, system configuration, time, statistics, CPUID data.

  The idea is that these provide a fallback in scenarios where system entropy is somehow broken (note that if system entropy *fails* we will abort regardless; this is only meant to function as a last resort against undetected failure). It includes some data sources OpenSSL currently uses, and more.

  The separation between random and randomenv is a bit arbitrary, but I felt that all this "non-essential" functionality deserved to be separated from the core random module.

ACKs for top commit:
  TheBlueMatt:
    utACK d1c02775aa. Certainly no longer measuring the time elapsed between a 1ms sleep (which got removed in the latest change) is a fair tradeoff for adding about 2 million other actually-higher-entropy bits :).
  laanwj:
    ACK d1c02775aa

Tree-SHA512: d290a8db6538a164348118ee02079e4f4c8551749ea78fa44b2aad57f5df2ccbc2a12dc7d80d8f3e916d68cdd8e204faf9e1bcbec15f9054eba6b22f17c66ae3
2019-11-18 13:33:43 +01:00
Sjors Provoost 18b18f8e81
[build] ./configure --enable-werror: add unused-variable
Turn corresponding warning on by default (not always covered by -Wall).
2019-11-15 17:35:59 +01:00
Pieter Wuille a81c494b4c Use sysctl for seeding on MacOS/BSD 2019-11-12 15:35:22 -08:00
Wladimir J. van der Laan 91fbcf41b3
Merge #16110: depends: Add Android NDK support
f9af3ced1c Android: add all arch support (Block Mechanic)
d419ca7e32 depends: export dynamic JNI symbols from static qtforandroid.a (Igor Cota)
ed30684d03 Qt: patch androidjnimain.cpp to make sure JNI is initialised when statically compiled (Igor Cota)
e4c319e8a1 builds: remove superfluous config_opts_aarch64_android (Igor Cota)
24ffef0c27 Patch libevent when building for Android (fix arc4random_addrandom) (Igor Cota)
f1e40b3e71 Update bitcoin_qt.m4 (BlockMechanic)
b4057d8261 Define TARGET_OS when host is android (Igor Cota)
80b475f159 Fix Android zlib cross compilation issue (https://stackoverflow.com/questions/21396988/zlib-build-not-configuring-properly-with-cross-compiler-ignores-ar) (Igor Cota)
45f8219015 Add full Android build example command and instructions on getting SDK/NDK (Igor Cota)
b68f2a68c2 Add config opts and patch for aarch64_android build of Qt (Igor Cota)
9c4cb0166e Add ranlib to android.mk hosts file (fix OSX Android NDK build) (Igor Cota)
c2a749c9c1 Add example Android host-platform-triplet and options (Igor Cota)
0b0cff3c61 Add support for building Android dependencies (Igor Cota)

Pull request description:

  This allows one to build the dependencies with the Android SDK and goes towards fixing #11844. It has been tested to work with:
  `make HOST=aarch64-linux-android ANDROID_API_LEVEL=28 ANDROID_TOOLCHAIN_BIN=/home/user/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin NO_QT=1 NO_WALLET=1`

ACKs for top commit:
  Sjors:
    ACK f9af3ce. I'm OK with merging and then improving later.

Tree-SHA512: cb805115ebe5c9e33db2bf3eab8628808fe3f50052053d8877d8b8e4406d6fea1ed9e5c4dff85d777fb99c81be6ffb9d95a0e6d32344e728e5e0da6c653e2ce7
2019-11-04 13:32:19 +01:00
fanquake befbc40eb5
build: remove EVP_MD_CTX_new detection
This was added in #9475 to fix LibreSSL compatibility for
BIP70, so is no longer required.
2019-10-24 16:01:43 -04:00
fanquake fcee10c2d0
build: remove SSL lib detection 2019-10-24 16:01:43 -04:00
fanquake 3548e4aac7
Remove BIP70 Support 2019-10-24 16:01:43 -04:00
Wladimir J. van der Laan ee47461ea5
Merge #17033: Disable _FORTIFY_SOURCE when enable-debug
44f7a8d7a7 Disable _FORTIFY_SOURCE when enable-debug (Andrew Chow)

Pull request description:

  The `_FORTIFY_SOURCE` macro is enabled by default when hardening is enabled, but it requires optimization in order to be used. Since we disable all optimization with `--enable-debug`, this macro doesn't actually do anything and instead just causes a lot of warnings to be printed. This PR explicitly disables `_FORTIFY_SOURCE` so that these useless warnings aren't printed.

ACKs for top commit:
  laanwj:
    Thanks. ACK 44f7a8d7a7

Tree-SHA512: e9302aef794dfd9ca9d0d032179ecc51d3212a9a0204454419f410011343b27c32e6be05f385051b5b594c607b91b8e0e588f644584d6684429a649a413077d9
2019-10-15 14:00:32 +02:00
Andrew Chow 44f7a8d7a7 Disable _FORTIFY_SOURCE when enable-debug
Since enable-debug disables optimization entirely, _FORTIFY_SOURCE
does nothing as it requires some kind of optimization enabled. It
instead produces a bunch of useless warnings. So explicitly disable
it when enable-debug so that those warnings are not produced.
2019-10-07 14:11:40 -04:00
Hennadii Stepanov 30fc1a3f54
build: Remove workaround for ancient libtool
Since libtool 1.5.2, on Linux libtool no longer sets RPATH for any
directories in the dynamic linker search path, so there is no longer an
issue.
This commit reverts a98356fee8.
2019-10-06 15:18:08 +03:00
Hennadii Stepanov 6ca01b9a10
build: Ensure a minimal version of libtool 2019-10-06 15:17:29 +03:00
Jon Atack c0859b7dac
build: 0.19 release updates on master
as per doc/release-process.md.

Note: On branch-off, these same changes should be made on the release branch, with also these additional changes to both files:

  - set `CLIENT_VERSION_REVISION` to `0`
  - set `CLIENT_VERSION_IS_RELEASE` to `true`
2019-10-02 11:08:15 +02:00
Igor Cota b4057d8261 Define TARGET_OS when host is android 2019-09-22 14:35:41 +02:00
Wladimir J. van der Laan dd8cf82e96
Merge #15146: Solve SmartOS FD_ZERO build issue
b4fd0ca9be Include cstring for sanity_test_fdelt if required (Ben Woosley)
7fb886b1b1 [moveonly] Split glibc sanity_test_fdelt out (Ben Woosley)

Pull request description:

  SmartOS FD_ZERO is implemented in a way that requires
  an external declaration of memcpy. We can not simply
  include cstring in the existing file because
  sanity_test_memcpy is attempting to replace memcpy.

  Instead split glibc_sanity into fdelt and memcpy files,
  and include <cstring> in glibc_sanity/fdelt.cpp.

  Fixes #13581, see also #13619

ACKs for top commit:
  laanwj:
    Code review an lightly tested (but not on SmartOS) ACK b4fd0ca9be

Tree-SHA512: 231306da291ad9eca8ba91bea1e9c27b6c2e96e484d1602e1c2cf27761202f9287ce0bc19fefd000943d2b449d0e5929cd39e2f7e09cf930d89fa520228ccbec
2019-09-18 16:33:23 +02:00
fanquake 376f4929f8
build: disable BIP70 support by default 2019-09-12 20:28:17 +10:00
Hennadii Stepanov 0bb33b5348
qt: Replace objc_msgSend with native syntax 2019-08-31 12:25:34 +03:00
Jon Atack a6c1fc3cd9
build: echo prop tests status during build
Enable users to see if the prop tests are enabled during the build. This can be particularly helpful as property-based tests are silently auto-enabled by default if librapidcheck is found.

Minor fixes to the docs and help grammar for this option.
2019-08-16 11:51:07 +02:00
Jonas Schnelli f418c3379c
Merge #16435: autoconf: Sane --enable-debug defaults.
d6ac25bdd9 autoconf: Sane --enable-debug defaults. (Carl Dong)

Pull request description:

  ```
  Don't optimize even if variables adhere to as-if rule. This is a
  somewhat sane default for debugging.
  ```

  -----

  Fixes: #14830

  This is more of a "do something dumb and have people correct you" kind of PR. The end goal is to have a configure flag that will allow for debugging without annoying "optimized out" messages, for developer experiences' sake. This is the minimal diff, but people have suggested `--enable-debug-slow` in the past.

ACKs for top commit:
  jonasschnelli:
    Tested ACK d6ac25bdd9

Tree-SHA512: 7a5576ad1d33850aff1445ccb71b133f654b455da2d1daed2ed1b82ea773965790a62895aeeab74b23a25513ab96dddb670f9dbc593dd0b8c030694206a99ccf
2019-08-14 22:07:06 +02:00
fanquake bf72b8a555
build: disable libsecp256k1 benchmarks
These were previously disabled, but upstream changed to having benchmarks enabled by default
in https://github.com/bitcoin-core/secp256k1/pull/480 and we pulled that change as part of #15703.
2019-08-09 11:12:51 +08:00
Carl Dong d6ac25bdd9
autoconf: Sane --enable-debug defaults.
Don't optimize at all when --enable-debug is supplied. This makes sure
that nothing is optimized out.
2019-07-30 15:58:10 -04:00
Wladimir J. van der Laan b21acab82f
Merge #15993: net: Drop support of the insecure miniUPnPc versions
59cb722fd0 Update configure to reject unsafe miniUPnPc API ver (Hennadii Stepanov)
ab2190557e doc: Add release notes for 15993 (Hennadii Stepanov)
02709e9560 Align formatting with clang-format (Hennadii Stepanov)
91a1b85083 Use PACKAGE_NAME in UPnP description (Hennadii Stepanov)
9f76e45b9d Drop support of insecure miniUPnPc versions (Hennadii Stepanov)

Pull request description:

  1. Minimum supported miniUPnPc API version is set to 10:
  - https://packages.ubuntu.com/xenial/libminiupnpc-dev
  - https://packages.debian.org/jessie/libminiupnpc-dev

  Refs:
  - #6583
  - #6789
  - #10414

  2. The hardcoded "Bitcoin" replaced with `PACKAGE_NAME`:
  ![Screenshot from 2019-05-06 23-10-29](https://user-images.githubusercontent.com/32963518/57253178-afc60780-7056-11e9-83c9-e85670c58c1e.png)

  3. Also style-only commit applied.

  Pardon: could not reopen my previous PR #15966.

ACKs for top commit:
  ryanofsky:
    utACK 59cb722fd0. Changes since last review: adding a new commit which updates configure script to fall back to disabling upnp if version is too old, adding a requested comment explaining static_assert condition, and fixing a spelling (jessy/jessie)

Tree-SHA512: 42ed11bc2fb2ec83d5dd58e2383da5444a24fd572707f6cf10b622cb8943e28adfcca4750d06801024c4472625b5ea9279516fbd9d2ccebc9bbaafe1d148e80d
2019-07-29 16:51:36 +02:00
MarcoFalke fabfcb5d8e
build: Treat -Wswitch as error when --enable-werror 2019-07-19 15:40:48 -04:00
Wladimir J. van der Laan 5859b7dc6f
Merge #16338: test: Disable other targets when enable-fuzz is set
84edfc72e5 Update doc and CI config (qmma)
48bcb2ac24 Disable other targets when enable-fuzz is set (qmma)

Pull request description:

  This is to fix https://github.com/bitcoin/bitcoin/issues/16094

  When the `enable-fuzz` flag is set, disable all other binary targets.

ACKs for top commit:
  MarcoFalke:
    ACK 84edfc72e5 (only checked that travis compiled this)

Tree-SHA512: f4ac80526388a67709986b22de88b00bf93ab44ae31a20bd4d8923a4982ab97e015a9f13010081d6ecf6c23ae8afeac7ca9d849d198ce6ebe239aa3127151efc
2019-07-10 12:23:35 +02:00
qmma 48bcb2ac24
Disable other targets when enable-fuzz is set 2019-07-04 15:43:32 -04:00
Hennadii Stepanov 59cb722fd0
Update configure to reject unsafe miniUPnPc API ver
Also fixes behavior when libminiupnpc is not installed.
2019-06-13 23:52:07 +03:00
Sjors Provoost f874e14cd3
[build]: check std::system for -[alert|block|wallet]notify
Platforms such as iOs do not support launching a process
through system().
2019-06-06 11:54:26 +02:00
Sjors Provoost c1c91bb78d
[build] detect std::system or ::wsystem 2019-06-06 11:50:16 +02:00
Carl Dong 480e3415d7 configure: Add flag for enabling thread_local.
- When aiming for glibc compatibility, don't use thread_local.
- Add a flag --enable-threadlocal, which, when specified, will
  enable/disable thread_local regardless of the value of glibc_compat.
- FreeBSD has a buggy thread_local, don't use it.
2019-05-23 15:15:46 -04:00
MarcoFalke faf38bc056
build with -fstack-reuse=none 2019-05-15 15:41:28 -04:00
MarcoFalke 2c35fe6238
Merge #15849: Thread names in logs and deadlock debug tools
8722e54e56 threads: add thread names to deadlock debugging message (James O'Beirne)
383b186c28 threads: prefix log messages with thread names (James O'Beirne)
ddd95ccb80 tests: add threadutil tests (James O'Beirne)
ae5f2b6a6c threads: introduce util/threadnames, refactor thread naming (James O'Beirne)
188ca75e5f disable HAVE_THREAD_LOCAL on unreliable platforms (James O'Beirne)

Pull request description:

  I'm resurrecting this one (from #13168) because I need it to make progress on #15735.

  It's now off by default and can be turned on with `-logthreadnames=1`.

  Ran some benchmarks (IBD from local peer from 500_000 -> 504_000) and it's within spitting distance either on or off:

  ### threadnames off (default)

  #### 2018-05-threadnames.3 vs. master (absolute)
  |                      name                      | iterations |   2018-05-threadnames.3    |           master           |
  |------------------------------------------------|-----------:|----------------------------|----------------------------|
  | ibd.local.500000.504000.dbcache=2048           |          3 | 376.1584 (± 9.2944)        | 392.3414 (± 13.4238)       |
  | ibd.local.500000.504000.dbcache=2048.mem-usage |          3 | 2236117.3333 (± 1845.9623) | 2238690.6667 (± 2669.3487) |

  #### 2018-05-threadnames.3 vs. master (relative)
  |                      name                      | iterations | 2018-05-threadnames.3 | master |
  |------------------------------------------------|-----------:|----------------------:|-------:|
  | ibd.local.500000.504000.dbcache=2048           |          3 |                     1 |  1.043 |
  | ibd.local.500000.504000.dbcache=2048.mem-usage |          3 |                     1 |  1.001 |

  ### threadnames on

  #### 2018-05-threadnames-take-2 vs. master (absolute)
  |                      name                      | iterations | 2018-05-threadnames-take-2 |           master           |
  |------------------------------------------------|-----------:|----------------------------|----------------------------|
  | ibd.local.500000.504000.dbcache=2048           |          3 | 367.6861 (± 0.3941)        | 364.1667 (± 0.9776)        |
  | ibd.local.500000.504000.dbcache=2048.mem-usage |          3 | 2238461.3333 (± 3697.8730) | 2237014.6667 (± 3307.6966) |

  #### 2018-05-threadnames-take-2 vs. master (relative)
  |                      name                      | iterations | 2018-05-threadnames-take-2 | master |
  |------------------------------------------------|-----------:|---------------------------:|-------:|
  | ibd.local.500000.504000.dbcache=2048           |          3 |                      1.010 |   1.00 |
  | ibd.local.500000.504000.dbcache=2048.mem-usage |          3 |                      1.001 |   1.00 |
  ```

ACKs for commit 8722e5:
  Empact:
    utACK 8722e54e56
  jnewbery:
    utACK 8722e54e56
  MarcoFalke:
    re-utACK 8722e54e56 (Only change since my previous review is DEFAULT_LOGTHREADNAMES=false and stylistic updates

Tree-SHA512: 50af992708295b8d680cf10025262dd964e599a356bdfc1dfc84fb18c00afabcb34d3d12d551b0677ff81f8fccad0e17c1d5b24dfecb953a913bc77fdd1a4577
2019-04-30 15:26:01 -04:00
James O'Beirne 188ca75e5f disable HAVE_THREAD_LOCAL on unreliable platforms
Note that this doesn't affect anything unless
DEBUG_LOCKCONTENTION is defined.

See discussions here:

- https://github.com/bitcoin/bitcoin/pull/11722#pullrequestreview-79322658
- https://github.com/bitcoin/bitcoin/pull/13168#issuecomment-387181155
2019-04-26 13:46:07 -04:00
MarcoFalke b1e013e4fa
Merge #13788: Fix --disable-asm for newer assembly checks/code
4207c1b35c configure: Initialise assembly enable_* variables (Luke Dashjr)
afe0875577 configure: Skip assembly support checks, when assembly is disabled (Luke Dashjr)
d8ab8dc12d configure: Invert --enable-asm help string since default is now enabled (Luke Dashjr)

Pull request description:

  Fixes #13759

  Also inverts the help (so it shows `--disable-asm` like other enabled-by-default options, and initialises the flag variables.

ACKs for commit 4207c1:
  laanwj:
    makes sense, utACK 4207c1b35c
  achow101:
    utACK 4207c1b35c
  ken2812221:
    ACK 4207c1b35c
  practicalswift:
    tACK 4207c1b35c

Tree-SHA512: a30be1008fd8f019db34073f78e90a3c4ad3767d88d7c20ebb83e99c7abc23552f7da3ac8bd20f727405799aff1ecb6044cf869653f8db70478a074d0b877e0a
2019-04-26 12:44:38 -04:00
Ben Woosley b4fd0ca9be
Include cstring for sanity_test_fdelt if required
SmartOS FD_ZERO is implemented in a way that requires
an external declaration of memcpy. We can not simply
include cstring in the existing file because
sanity_test_memcpy is attempting to replace memcpy, but we can do
so here, now that the fdelt test is split out.
2019-04-13 20:21:02 -07:00
MarcoFalke fab5a1e0f4
build: Require python 3.5 2019-03-02 10:40:23 -05:00