Commit Graph

585 Commits

Author SHA1 Message Date
Kittywhiskers Van Gogh
959518fdfd merge bitcoin#18862: Remove fdelt_chk back-compat code and sanity check 2022-07-01 09:02:38 +05:30
fanquake
c1969bb2e8
Merge bitcoin/bitcoin#21788: build: Silence [-Wunused-command-line-argument] warnings
e9f948c72790136656df6056fd9e3698f360e077 build: Convert warnings into errors when testing for -fstack-clash-protection (Hennadii Stepanov)

Pull request description:

  Apple clang version 12.0.5 (clang-1205.0.22.9) that is a part of Xcode 12.5, and is based on LLVM clang 11.1.0, fires spammy warnings:

  ```
  clang: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument]
  ```

  From the https://github.com/apple/llvm-project:
  ```
  $ git log --oneline | grep 'stack-clash-protection'
  00065d5cbd02 Revert "-fstack-clash-protection: Return an actual error when used on unsupported OS"
  4d59c8fdb955 -fstack-clash-protection: Return an actual error when used on unsupported OS
  df3bfaa39071 [Driver] Change -fnostack-clash-protection to  -fno-stack-clash-protection
  68e07da3e5d5 [clang][PowerPC] Enable -fstack-clash-protection option for ppc64
  515bfc66eace [SystemZ] Implement -fstack-clash-protection
  e67cbac81211 Support -fstack-clash-protection for x86
  454621160066 Revert "Support -fstack-clash-protection for x86"
  0fd51a4554f5 Support -fstack-clash-protection for x86
  658495e6ecd4 Revert "Support -fstack-clash-protection for x86"
  e229017732bc Support -fstack-clash-protection for x86
  b03c3d8c6209 Revert "Support -fstack-clash-protection for x86"
  4a1a0690ad68 Support -fstack-clash-protection for x86
  f6d98429fcdb Revert "Support -fstack-clash-protection for x86"
  39f50da2a357 Support -fstack-clash-protection for x86
  ```

  I suppose, that Apple clang-1205.0.22.9 ends with on of the "Revert..." commits.

  This PR prevents using of the `-fstack-clash-protection` flag if it causes warnings.

  ---

  System: macOS Big Sur 11.3 (20E232).

ACKs for top commit:
  jarolrod:
    re-ACK e9f948c72790136656df6056fd9e3698f360e077
  Sjors:
    tACK e9f948c72790136656df6056fd9e3698f360e077 on macOS 11.3.1

Tree-SHA512: 30186da67f9b0f34418014860c766c2e7f622405520f1cbbc1095d4aa4038b0a86014d76076f318a4b1b09170a96d8167c21d7f53a760e26017f486e1a7d39d4
2022-06-27 11:37:03 -05:00
fanquake
b2df26bec3
Merge #21421: build: don't try and use -fstack-clash-protection on Windows
7b3434f8002d1a8cf0dbd0a0caef28e783b1efd8 build: don't try and use -fstack-clash-protection on Windows (fanquake)

Pull request description:

  This has never worked with any of the mingw-w64 compilers we use, and the `-O0` is causing issues for builders applying spectre mitigations (see [IRC logs](http://www.erisian.com.au/bitcoin-core-dev/log-2021-03-12.html#l-15)).

  Recent discussion on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 would also indicate that this should just not be used on Windows.

ACKs for top commit:
  laanwj:
    Concept and code review ACK (but untested) 7b3434f8002d1a8cf0dbd0a0caef28e783b1efd8
  hebasto:
    ACK 7b3434f8002d1a8cf0dbd0a0caef28e783b1efd8, I've verified that this change does not affect builds for `HOST=x86_64-w64-mingw32` by comparing sizes of the output `*.exe` files.

Tree-SHA512: 72b582321ddff8db3201460fa42a53304e70f141ae078d76a4d4eeb1ca27c8dd567ccb468cc8616179c8df784bd8ca038dcb9a277f9e29f9d98c3cc842916b18
2022-06-27 11:37:02 -05:00
fanquake
b50457044c
Merge #20720: build: more robustly check for fcf-protection support
e9189a750b237eba1befc6b16c12c2cee3e0176c build: more robustly check for fcf-protection support (fanquake)

Pull request description:

  When using Clang 7, we may end up trying to use the flag when it won't
  work properly, which can lead to confusing errors. i.e:
  ```bash
  /usr/bin/ld: error: ... <corrupt x86 feature size: 0x8>
  ```

  Use `AX_CHECK_LINK_FLAG` & `--fatal-warnings` to ensure we wont use the flag in this case.

  We do this as even when the error is emitted, compilation succeeds, and the binaries produced will run. This means we can't just check if the compiler accepts the flag, or if compilation succeeds (without or without `-Werror`, and/or passing `-Wl,--fatal-warnings`, which may not be passed through to the linker).

  This was reported by someone configuring for fuzzing, on Debian 10, where Clang 7 is the default.

  See here for a minimal example of the problematic behaviour:
  https://gist.github.com/fanquake/9b33555fcfebef8eb8c0795a71732bc6

ACKs for top commit:
  pstratem:
    tested ACK e9189a750b237eba1befc6b16c12c2cee3e0176c
  MarcoFalke:
    not an ACK e9189a750b237eba1befc6b16c12c2cee3e0176c , I only tested configure on my system (gcc-10, clang-11):
  hebasto:
    ACK e9189a750b237eba1befc6b16c12c2cee3e0176c, tested with clang-7, clang-10 and gcc: the `-fcf-protection=full` is not applied for clang-7, but applied for others compilers.

Tree-SHA512: ec24b0cc5523b90139c96cbb33bb98d1e6a24d858c466aa7dfb3c474caf8c50aca53e570fdbc0ff88378406b0ac5d687542452637b1b5fa062e829291b886fc1
2022-06-18 22:14:04 -07:00
Jonas Schnelli
2622653e74
Merge #20563: build: Check that Homebrew's berkeley-db4 package is actually installed
d3ef947524a07f8d7fbad5b95781ab6cacb1cb49 build: Check that Homebrew's berkeley-db4 package is actually installed (Hennadii Stepanov)

Pull request description:

  On master (a0489f3472f3799dc1ece32a59556fd239c4c14b) the `configure` script is not able to determine that Homebrew's `berkeley-db4` package is uninstalled. This causes a compile error on macOS.

  With this PR, and with the [uninstalled](https://stackoverflow.com/questions/20802320/detect-if-homebrew-package-is-installed) `berkeley-db4` package:
  ```
  % ./configure -q
  configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for BDB wallet support (--without-bdb to disable BDB wallet support)
  ```

  Related #20478.

ACKs for top commit:
  promag:
    Tested ACK d3ef947524a07f8d7fbad5b95781ab6cacb1cb49.
  willcl-ark:
    tACK d3ef947524a07f8d7fbad5b95781ab6cacb1cb49
  jonasschnelli:
    utACK d3ef947524a07f8d7fbad5b95781ab6cacb1cb49

Tree-SHA512: 8dc532e08249ec63bd357594aa458d314b6e8537fc63f5b1d509c84d0d71d5b1f70172caa1a7efe2fc8af31c829e7982a0695cf3fbe5cbc477019550269915e1
2022-06-18 22:14:04 -07:00
Jonas Schnelli
6d5109e90f
Merge #20478: Don't set BDB flags when configuring without
982e548a9a78b1b0abad59b54c780b6b06570452 Don't set BDB flags when configuring without (Jonas Schnelli)

Pull request description:

  Configuring `--without-bdb` on MacOS leads to a compile error (when BerkeleyDB is not installed). `brew --prefix berkeley-db4` always reports the target directory (even if not installed).

  This PR prevents BDB_CFLAGS (et al) from being populated when configuring `--without-bdb`

  ```
  ld: warning: directory not found for option '-L/Users/user/Documents/homebrew/Cellar/berkeley-db@4/4.8.30/lib'
  ld: warning: directory not found for option '-L/Users/user/Documents/homebrew/Cellar/berkeley-db@4/4.8.30/lib'
  ld: library not found for -ldb_cxx-4.8
  ld: library not found for -ldb_cxx-4.8
  ```

ACKs for top commit:
  promag:
    Tested ACK 982e548a9a78b1b0abad59b54c780b6b06570452.
  hebasto:
    ACK 982e548a9a78b1b0abad59b54c780b6b06570452, tested on macOS 11 Big Sur.

Tree-SHA512: f8ca0adca0e18e2de4c0f99d5332cba70d957a9d31a357483b43dcf61c2ed4749d223eabadd45fdbf3ef0781c6b37217770e9aa935b5207eaf7f87c5bdfe9e95
2022-06-18 22:14:04 -07:00
Wladimir J. van der Laan
e1b091be3b
Merge #18921: build: add stack-clash and control-flow protection options to hardening flags
b536813cefc13f5c54a28a7c2fce8c69e89d6624 build: add -fstack-clash-protection to hardening flags (fanquake)
076183b36b76a11438463883ff916f17aef9e001 build: add -fcf-protection=full to hardening options (fanquake)

Pull request description:

  Beginning with Ubuntu `19.10`, it's packaged GCC now has some additional hardening options enabled by default (in addition to existing defaults like `-fstack-protector-strong` and reducing the minimum ssp buffer size). The new additions are`-fcf-protection=full` and `-fstack-clash-protection`.

  > -fcf-protection=[full|branch|return|none]
  > Enable code instrumentation of control-flow transfers to increase program security by checking that target addresses of control-flow transfer instructions (such as indirect function call, function return, indirect jump) are valid. This prevents diverting the flow of control to an unexpected target. This is intended to protect against such threats as Return-oriented Programming (ROP), and similarly call/jmp-oriented programming (COP/JOP).

  > -fstack-clash-protection
  > Generate code to prevent stack clash style attacks. When this option is enabled, the compiler will only allocate one page of stack space at a time and each page is accessed immediately after allocation. Thus, it prevents allocations from jumping over any stack guard page provided by the operating system.

  If your interested you can grab `gcc-9_9.3.0-10ubuntu2.debian.tar.xz` from https://packages.ubuntu.com/focal/g++-9. The relevant changes are part of the `gcc-distro-specs` patches, along with the relevant additions to the gcc manages:

  > NOTE: In Ubuntu 19.10 and later versions, -fcf-protection is enabled by default for C, C++, ObjC, ObjC++, if none of -fno-cf-protection nor -fcf-protection=* are found.

  > NOTE: In Ubuntu 19.10 and later versions, -fstack-clash-protection is enabled by default for C, C++, ObjC, ObjC++, unless -fno-stack-clash-protection is found.

  So, if you're C++ using GCC on Ubuntu 19.10 or later, these options will be active unless you explicitly opt out. This can be observed with a small test:

  ```c++
  int main() { return 0; }
  ```

  ```bash
  g++ --version
  g++ (Ubuntu 9.3.0-10ubuntu2) 9.3.0

  g++ test.cpp

  objdump -dC a.out
  ..
  0000000000001129 <main>:
      1129:	f3 0f 1e fa          	endbr64
      112d:	55                   	push   %rbp
      112e:	48 89 e5             	mov    %rsp,%rbp
      1131:	b8 00 00 00 00       	mov    $0x0,%eax
      1136:	5d                   	pop    %rbp
      1137:	c3                   	retq
      1138:	0f 1f 84 00 00 00 00 	nopl   0x0(%rax,%rax,1)
      113f:	00

  # recompile opting out of control flow protection
  g++ test.cpp -fcf-protection=none

  objdump -dC a.out
  ...
  0000000000001129 <main>:
      1129:	55                   	push   %rbp
      112a:	48 89 e5             	mov    %rsp,%rbp
      112d:	b8 00 00 00 00       	mov    $0x0,%eax
      1132:	5d                   	pop    %rbp
      1133:	c3                   	retq
      1134:	66 2e 0f 1f 84 00 00 	nopw   %cs:0x0(%rax,%rax,1)
      113b:	00 00 00
      113e:	66 90                	xchg   %ax,%ax
  ```

  Note the insertion of an `endbr64` instruction when compiling and _not_ opting out. This instruction is part of the Intel Control-flow Enforcement Technology [spec](https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf), which the GCC control flow implementation is based on.

  If we're still doing gitian builds for the `0.21.0` and `0.22.0` releases, we'd likely update the gitian image to Ubuntu Focal, which would mean that the GCC used for gitian builds would also be using these options by default. So we should decide whether we want to explicitly turn these options on as part of our hardening options (although not just for this reason), or, we should be opting-out.

  GCC has supported both options since 8.0.0. Clang has supported `-fcf-protection` from 7.0.0 and will support `-fstack-clash-protection` in it's upcoming [11.0.0 release](https://clang.llvm.org/docs/ReleaseNotes.html#id6).

ACKs for top commit:
  jamesob:
    ACK b536813cefc13f5c54a28a7c2fce8c69e89d6624 ([`jamesob/ackr/18921.1.fanquake.build_add_stack_clash_an`](https://github.com/jamesob/bitcoin/tree/ackr/18921.1.fanquake.build_add_stack_clash_an))
  laanwj:
    Code review ACK b536813cefc13f5c54a28a7c2fce8c69e89d6624

Tree-SHA512: abc9adf23cdf1be384f5fb9aa5bfffdda86b9ecd671064298d4cda0440828b509f070f9b19c88c7ce50ead9ff32afff9f14c5e78d75f01241568fbfa077be0b7
2022-06-18 22:14:03 -07:00
fanquake
37d58e402c
Merge #19356: build: Fix search for brew-installed BDB 4 on OS X
8578c6fccd11404412d2c60f9bede311b79ca0d0 build: Fix search for brew-installed BDB 4 on OS X (Glenn Willen)

Pull request description:

  ~~NOTE: This PR contains one important fix that I need (to make Bitcoin Core build cleanly on my system without shenanigans), plus some related general cleanup that is not really necessary, and could be annoying. (I am prepared to defend my argument that BDB_CFLAGS is wrong here, and BDB_CPPFLAGS is right, but this could bite anybody who has gotten in the habit of -- or scripted -- setting the former.)~~

  Ok, I have been convinced that I was too clever with the refactor and I have removed it. Now it's just the tiny change to fix the build on my local machine.

  ---

  On OS X, when searching Homebrew keg-only packages for BDB 4.8, if we find it,
  use BDB_CPPFLAGS and BDB_LIBS instead of CFLAGS and LIBS for the result. This
  is (1) more correct, and (2) necessary in order to give this location
  priority over other directories in the include search path, which may include
  system include directories with other versions of BDB.

ACKs for top commit:
  theuni:
    ACK 8578c6fccd11404412d2c60f9bede311b79ca0d0.

Tree-SHA512: a28f48fc81a25736f7e77c663f21cd9a6ae1cd115682031c5aa695c94cb5afa11920330a60cd6a54832822a2aec1eb23123ac2e2dcd4f0b3835aef9c9339ac97
2022-06-18 22:14:03 -07:00
fanquake
96866c4579
Merge #18709: doc: note why we can't use thread_local with glibc back compat
b155fcda5186c59fc4fb2a9eaaf791d132e0ab30 doc: fix typo in configure.ac (fanquake)
20a30922fbf6ba14e250ca649239af115dbbe7b0 doc: note why we can't use thread_local with glibc back compat (fanquake)

Pull request description:

  Given that we went through a [gitian build](https://github.com/bitcoin/bitcoin/pull/18681) to remember why this is the case, we might as well make a note of it in configure.ac.

  [From #18681](https://github.com/bitcoin/bitcoin/pull/18681#issuecomment-615526634):

  Looking at the Linux build log, this has failed with:
  ```bash
  Checking glibc back compat...
  bitcoind: symbol __cxa_thread_atexit_impl from unsupported version GLIBC_2.18
  bitcoind: failed IMPORTED_SYMBOLS
  bitcoin-cli: symbol __cxa_thread_atexit_impl from unsupported version GLIBC_2.18
  bitcoin-cli: failed IMPORTED_SYMBOLS
  bitcoin-tx: symbol __cxa_thread_atexit_impl from unsupported version GLIBC_2.18
  bitcoin-tx: failed IMPORTED_SYMBOLS
  bitcoin-wallet: symbol __cxa_thread_atexit_impl from unsupported version GLIBC_2.18
  bitcoin-wallet: failed IMPORTED_SYMBOLS
  test/test_bitcoin: symbol __cxa_thread_atexit_impl from unsupported version GLIBC_2.18
  test/test_bitcoin: failed IMPORTED_SYMBOLS
  bench/bench_bitcoin: symbol __cxa_thread_atexit_impl from unsupported version GLIBC_2.18
  bench/bench_bitcoin: failed IMPORTED_SYMBOLS
  qt/bitcoin-qt: symbol __cxa_thread_atexit_impl from unsupported version GLIBC_2.18
  ```

  `__cxa_thread_atexit_impl` is used for [thread_local variable destruction](https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables):

  > To implement this support, glibc defines __cxa_thread_atexit_impl exclusively for use by libstdc++ (which has the __cxa_thread_atexit to wrap around it), that registers destructors for thread_local variables in a list. Upon thread or process exit, the destructors are called in reverse order in which they were added.

  As suggested, this only became available in glibc 2.18. From the [2.18 release notes](https://sourceware.org/legacy-ml/libc-alpha/2013-08/msg00160.html):

  > * Add support for calling C++11 thread_local object destructors on thread
    and program exit.  This needs compiler support for offloading C++11
    destructor calls to glibc.

ACKs for top commit:
  hebasto:
    ACK b155fcda5186c59fc4fb2a9eaaf791d132e0ab30

Tree-SHA512: 5b9567e4a70598a4b0b91956f44ae0d93091db17c84cbf9817dac6cfa992c97d3438a8b1bb66644c74891f2149e44984daed445d22de93ca8858c5b0eabefb40
2022-06-18 22:14:02 -07:00
Wladimir J. van der Laan
3ceb45fdb7
Merge #18135: build: add --enable-determinism configure flag
3d9b41ecc02a69daa19df2bc850d60bf9917b724 build: add --enable-determinism configure flag (fanquake)

Pull request description:

  This adds a `--enable-determinsm` configure flag, which if used, will enable additional compile / link time flags to make subsequent builds of bitcoind deterministic.

  The first flag enabled is `--no-insert-timestamp`. This prevents the linker from embedding timestamps, and makes consecutive builds of `bitcoind.exe` deterministic. This will likely also be used for [Guix Windows builds](https://github.com/bitcoin/bitcoin/pull/17595#issuecomment-582696467).

  [`--no-insert-timestamp`](https://manpages.debian.org/buster/binutils-mingw-w64-x86-64/x86_64-w64-mingw32-ld.bfd.1.en.html):
  > The option --no-insert-timestamp can be used to insert a zero value for the timestamp, this ensuring that binaries produced from identical sources will compare identically.

  Diff of consecutive builds of [master](2bdc476d4d):
  ```diff
  --- bitcoind.exe.1
  +++ bitcoind.exe.2
  @@ -2,20 +2,20 @@
   00000060: 7420 6265 2072 756e 2069 6e20 444f 5320  t be run in DOS
   00000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000  mode....$.......
  -00000080: 5045 0000 6486 1400 57e8 445e 00da 6900  PE..d...W.D^..i.
  +00000080: 5045 0000 6486 1400 e3e9 445e 00da 6900  PE..d.....D^..i.
   00000090: e015 0100 f000 2600 0b02 021f 00de 4900  ......&.......I.
   000000a0: 00b0 5b00 008a 0000 e014 0000 0010 0000  ..[.............
   000000b0: 0000 4000 0000 0000 0010 0000 0002 0000  ..@.............
   000000c0: 0400 0000 0000 0000 0500 0200 0000 0000  ................
  -000000d0: 00f0 6a00 0006 0000 bd31 af00 0300 6001  ..j......1....`.
  +000000d0: 00f0 6a00 0006 0000 d434 af00 0300 6001  ..j......4....`.
   000000e0: 0000 2000 0000 0000 0010 0000 0000 0000  .. .............
  @@ -373594,15 +373594,15 @@
   005b35f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
  -005b3600: 0000 0000 57e8 445e 0000 0000 7ce1 5b00  ....W.D^....|.[.
  +005b3600: 0000 0000 e2e9 445e 0000 0000 7ce1 5b00  ......D^....|.[.
   005b3610: 0100 0000 2200 0000 2200 0000 28e0 5b00  ...."..."...(.[.
  ```

ACKs for top commit:
  practicalswift:
    ACK 3d9b41ecc02a69daa19df2bc850d60bf9917b724 -- patch looks correct
  laanwj:
    ACK 3d9b41ecc02a69daa19df2bc850d60bf9917b724

Tree-SHA512: 1ff9dab7fa818b1fc6b0eb3b7a1e0468aac9e2578f4451aa300a648f883fa83f83722067f1adf27ebad54157790857d1501d573adbd7ebdf6962858cc669960d
2022-06-18 22:14:02 -07:00
Wladimir J. van der Laan
091865b02c
Merge #18082: logging: enable thread_local usage on macOS
d76894987d0277e8011932ab7dfd77c537f8ea6e logging: enable thread_local usage on macOS (fanquake)

Pull request description:

  Now that we're building against a newer SDK (`10.14`), we should be able to enable `thread_local` usage on macOS. Have tested building and running locally, as well as cross-compiling and running the binaries on a macOS 10.14 system.

  #### master 8a56f79d491271120abc3843c46e9dda44edd308
  ```bash
  src/bitcoind -logthreadnames=1
  2020-02-06T04:38:33Z [] Bitcoin Core version v0.19.99.0-8a56f79d4 (release build)
  2020-02-06T04:38:33Z [] Assuming ancestors of block 00000000000000000005f8920febd3925f8272a6a71237563d78c2edfdd09ddf have valid signatures.
  2020-02-06T04:38:33Z [] Setting nMinimumChainWork=000000000000000000000000000000000000000008ea3cf107ae0dec57f03fe8
  2020-02-06T04:38:33Z [] Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
  2020-02-06T04:38:33Z [] Using RdSeed as additional entropy source
  ```

  #### this PR d76894987d0277e8011932ab7dfd77c537f8ea6e
  ```bash
  checking for thread_local support... yes
  ...
  src/bitcoind -logthreadnames=1
  2020-02-06T04:17:49Z [net] net thread start
  2020-02-06T04:17:49Z [opencon] opencon thread start
  2020-02-06T04:17:49Z [dnsseed] dnsseed thread start
  2020-02-06T04:17:49Z [init] init message: Done loading
  2020-02-06T04:17:49Z [msghand] msghand thread start
  2020-02-06T04:17:49Z [addcon] addcon thread start
  ...
  2020-02-06T04:17:54Z [init] tor: Thread interrupt
  2020-02-06T04:17:54Z [init] Shutdown: In progress...
  ```

  From the [Xcode 8 release notes](https://developer.apple.com/library/archive/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html#//apple_ref/doc/uid/TP40001051-CH1-SW78)
  > C++ now supports the thread_local keyword, which declares thread-local storage (TLS) and supports C++ classes with non-trivial constructors and destructors. (9001553)

ACKs for top commit:
  jonasschnelli:
    Tested ACK d76894987d0277e8011932ab7dfd77c537f8ea6e
  nijynot:
    ACK d768949
  hebasto:
    ACK d76894987d0277e8011932ab7dfd77c537f8ea6e

Tree-SHA512: 48f3e4104b80bd7b6aedcef10bb1957b073530130f33af7c5cb59e876ac3f5480e53d7af1c0b226d809fe9eef1add3d6c3fb6de4af174966202c6030060ea823
2022-06-18 22:14:01 -07:00
MarcoFalke
59c55fd274 Merge #17703: build: Improve configure.ac formatting
3ab18246254019896132d1cdb8af2dcdb213ec3b build: Use dnl for all comments in configure.ac, rather than # (fanquake)
8ddcbb4e41fa91e7f80efe6d9c4d5e9bb1355036 build: Remove backticks from configure.ac (fanquake)

Pull request description:

  Use `dnl` for all comments, rather than `#`.
  Remove backticks - Their usage for the `bdb_prefix` and `qt5_prefix` commands may have improved backwards compatibility in some cases, however we now require recent versions of macOS. I'm not sure why they were being used in the `HAVE_STD__SYSTEM` and `HAVE_WSYSTEM` defines.

ACKs for top commit:
  dongcarl:
    ACK 3ab18246254019896132d1cdb8af2dcdb213ec3b
  hebasto:
    ACK 3ab18246254019896132d1cdb8af2dcdb213ec3b, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 2bcffb52c365acff87a0e6b9527ae31f36fdabb7ea095a8fd261f9a39b2c2848f5dfc148bc38d21e21e7bd761b1a2960e9a96f508c66be84d9569b8a401e812a
2022-06-08 12:33:00 +07:00
PastaPastaPasta
d64b7229cd
chore: bump copyrights (#4873)
* chore: bump copyright in configure.ac

* chore: bump copyright via copyright_header.py

ran command `python3 contrib/devtools/copyright_header.py update .`
2022-06-08 02:36:46 +03:00
fanquake
3dbbdf6775
Merge #19719: build: Add Werror=range-loop-analysis
fa55c1d5fdd88c4bc4d361da231cd63b20255b50 build: Add Werror=range-loop-analysis (MarcoFalke)

Pull request description:

  The warning is implicitly enabled for Bitcoin Core. Also explicitly since commit d92204c900d.

  To avoid "fix range loop" follow-up refactors, we have two options:

  * Disable the warning, so that issues never appear
  * Enable it as an error, so that issues are either caught locally or by ci

ACKs for top commit:
  fanquake:
    ACK fa55c1d5fdd88c4bc4d361da231cd63b20255b50
  practicalswift:
    ACK fa55c1d5fdd88c4bc4d361da231cd63b20255b50 -- pre-review fix-up is better than post-review fix-up
  hebasto:
    re-ACK fa55c1d5fdd88c4bc4d361da231cd63b20255b50

Tree-SHA512: 019aa133f254af8882c1d5d10c420d9882305db0fc2aa9dad7d285168e2556306c3eedcc03bd30e63f11eae4cc82b648d83fb6e9179d6a6364651fb602d70134
2022-06-07 16:11:23 -05:00
Kittywhiskers Van Gogh
6627bc9688 merge bitcoin#15457: Check std::system for -[alert|block|wallet|instantsend]notify 2022-06-07 09:21:28 +05:30
Kittywhiskers Van Gogh
63b9860cf2 merge bitcoin#19188: Avoid overwriting the NodeContext member of the testing setup [-Wshadow-field]
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-06-03 18:25:28 +05:30
Kittywhiskers Van Gogh
6d8839473c merge bitcoin#20255: Add Assume() identity function 2022-05-13 18:06:06 +05:30
Kittywhiskers Van Gogh
b47d4843bf
merge bitcoin#22646: tighter Univalue integration, remove --with-system-univalue (#4823)
* merge bitcoin#22646: tighter Univalue integration, remove `--with-system-univalue`

* masternode: add missing header in meta.cpp
2022-05-02 10:31:46 -05:00
UdjinM6
208fa62acb
Merge pull request #4818 from PastaPastaPasta/develop-trivial-2022-04-28
backport trivial 2022 04 28
2022-04-28 23:24:27 +03:00
MarcoFalke
0277d06767 Merge bitcoin/bitcoin#23761: build: use __SIZEOF_INT128__ for checking __int128 availability
e9440aeb5cad98fea9971f5126461e0a2b30ab54 build: use __SIZEOF_INT128__ for checking __int128 availability (fanquake)

Pull request description:

  We already use this in the blockfilter code,

  bf66e258a8/src/blockfilter.cpp (L34-L36)

  so not sure we need to maintain two different ways of testing
  for the same functionality. Consolidate on testing for `__SIZEOF_INT128__`,
  which we already use, is supported by the compilers we care about, and is
  also used by libsecp256k1.

ACKs for top commit:
  sipa:
    utACK e9440aeb5cad98fea9971f5126461e0a2b30ab54
  Zero-1729:
    crACK e9440aeb5cad98fea9971f5126461e0a2b30ab54

Tree-SHA512: 8aeef1734486a863b5091123bb5f9ba8868b1e2b4b35114586e3eb5862a38d4a1518ed069f37f41cb5e5ce2f6c87d95671996366d5ee990e0c90f268a8978ba3
2022-04-28 10:59:05 -05:00
UdjinM6
b22d589d4e
Merge pull request #4817 from UdjinM6/drop_0
build: switch to classical `major.minor.patch` semver
2022-04-28 18:40:08 +03:00
PastaPastaPasta
2197786843
Merge pull request #4704 from kittywhiskers/muhash
merge bitcoin#17319...19601: muhash implementation
2022-04-28 10:30:09 -05:00
PastaPastaPasta
f56b7fcf81
Merge pull request #4812 from Munkybooty/misc-backports
Misc backports v17
2022-04-28 10:13:43 -05:00
MarcoFalke
a3a7a22268
Merge #20223: build: Drop the leading 0 from the version number
8f7b93047581c67f2133cdb8c7845471de66c30f Drop the leading 0 from the version number (Andrew Chow)

Pull request description:

  Removes the leading 0 from the version number. The minor version, which we had been using as the major version, is now the major version. The revision, which we had been using as the minor version, is now the minor version. The revision number is dropped. The build number is promoted to being part of the version number. This also avoids issues where it was accidentally not included in the version number.

  The CLIENT_VERSION remains the same format as previous as previously, as the Major version was 0 so it never actually got included in it.

  The user agent string formatter is updated to follow this new versioning.

  ***

  Honestly I'm just tired of all of the people asking for "1.0" that maybe this'll shut them up. Skip the whole 1.0 thing and go straight to version 22.0!

  Also, this means that the terminology we commonly use lines up with how the variables are named. So major versions are actually bumping the major version number, etc.

ACKs for top commit:
  jnewbery:
    Code review ACK 8f7b930475
  MarcoFalke:
    review ACK 8f7b93047581c67f2133cdb8c7845471de66c30f 🎻

Tree-SHA512: b5c3fae14d4c0a9c0ab3b1db7c949ecc0ac3537646306b13d98dd0efc17c489cdd16d43f0a24aaa28e9c4a92ea360500e05480a335b03f9fb308010cdd93a436
2022-04-28 13:47:53 +03:00
UdjinM6
4d70755155 more of/followup 13177 2022-04-27 10:45:51 -04:00
Kittywhiskers Van Gogh
c7eb44a911 partial bitcoin#19055: Add MuHash3072 implementation
Excludes b111410914041b72961536c3e4037eba103a8085 and 01297fb3ca57e4b8cbc5a89fc7c6367de33b0bc6
2022-04-27 20:05:13 +05:30
PastaPastaPasta
1e3c35e6bd
chore: bump develop to 18.1.0.0 (#4811) 2022-04-26 21:03:29 +03:00
Wladimir J. van der Laan
87112fd95f Merge #13177: GCC-7 and glibc-2.27 back compat code
253f5929097548fb10ef995002dedbb8dadb6a0d Add stdin, stdout, stderr to ignored export list (Chun Kuan Lee)
fc6a9f2ab18ca8466d65d14c263c4f78f9ccebbf Use IN6ADDR_ANY_INIT instead of in6addr_any (Cory Fields)
908c1d7745f0ed117b0374fcc8486f83bf743bfc GCC-7 and glibc-2.27 compat code (Chun Kuan Lee)

Pull request description:

  The `__divmoddi4` code was modified from https://github.com/gcc-mirror/gcc/blob/master/libgcc/libgcc2.c . I manually find the older glibc version of log2f by objdump, use `.symver` to specify the certain version.

Tree-SHA512: e8d875652003618c73e019ccc420e7a25d46f4eaff1c7a1a6bfc1770b3b46f074b368b2cb14df541b5ab124cca41dede4e28fe863a670589b834ef6b8713f9c4
2022-04-26 13:41:49 -04:00
Pieter Wuille
3285e21cfd Merge #12686: Add -ftrapv to CFLAGS and CXXFLAGS when --enable-debug is used. Enable -ftrapv in Travis.
98d842cb52 travis: Build with --enable-debug (x86_64-unknown-linux-gnu) (practicalswift)
94e52d13db Add -ftrapv to DEBUG_CXXFLAGS when --enable-debug is used (practicalswift)

Pull request description:

  By generating a trap for signed overflow on addition, subtraction, multiplication operations in the Travis testing we are more likely to identify problematic code prior to merging it.

Tree-SHA512: 47712da53b4ff451b8f22f16ddc3b53100a09060a3b04cda4b8fbbb74e6f666fc07a9cc7abc64cacb87a0aa3f62dc8e3c91a1a0ed12bf82bb2a5624a5d104389
2022-04-26 13:16:11 -04:00
Wladimir J. van der Laan
b582fbb9a6 Merge #18359: build: fix sysctl() detection on macOS
e90e3e684ffa7b25f0dfb5b45e70bb0c358261fb build: fix sysctl() detection on macOS (fanquake)

Pull request description:

  [`sysctl()` on *BSD](https://www.unix.com/man-page/FreeBSD/3/sysctl/) takes a "const int *name", whereas [`sysctl()` on macOS](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sysctl.3.html)
  it takes an "int *name". So our configure check and `sysctl()` detection on
  macOS currently fails:

  ```bash
  /usr/include/sys/sysctl.h:759:9: note: candidate function not viable:
  	no known conversion from 'const int [2]' to 'int *' for 1st argument
  int     sysctl(int *, u_int, void *, size_t *, void *, size_t);
  ```

  The simplest change seems to be to change the param to a "int *name", which
  will work during configure on macOS and *BSD systems.

  For consistency I've changed both calls, but note that macOS doesn't
  have `KERN_ARND`, so that check will always fail regardless. We can revert/add
  documentation if preferred.

ACKs for top commit:
  laanwj:
    Re-ACK e90e3e684ffa7b25f0dfb5b45e70bb0c358261fb

Tree-SHA512: 29e9348136fc72882f63079bf10d2490e845d7656aae2c003e282bea49dd2778204a7776a67086bd88c2852af9a07dd04ba358eede7e37029e1c10f73c85d6a5
2022-04-25 14:02:48 -05:00
Kittywhiskers Van Gogh
2314ba4c99 merge bitcoin#17265: Remove OpenSSL 2022-04-25 15:29:52 +05:30
Kittywhiskers Van Gogh
946858204f merge bitcoin#17270: Feed environment data into RNG initializers 2022-04-25 15:29:51 +05:30
Kittywhiskers Van Gogh
c7c42fff3d revert dash#4683: remove the ability to opt-out from building openssl
This reverts commit b26eaf6954.
2022-04-25 15:18:55 +05:30
Kittywhiskers Van Gogh
43152b2b35
merge #17165: Remove BIP70 support (#4023)
* compat: remove bswap_* check on macOS

This was originally added in #9366 to fix the gui build, as
Protobuf would also define these macros. Now that we're no-longer
using Protobuf, remove the additional check.

* build: skip building OpenSSL lib_ssl

* build: remove OpenSSL from Qt build

More info available from:
https://doc.qt.io/qt-5/ssl.html#enabling-and-disabling-ssl-support

* build: remove EVP_MD_CTX_new detection

This was added in #9475 to fix LibreSSL compatibility for
BIP70, so is no longer required.

* build: remove SSL lib detection

* gui: update BIP70 support message

* build: remove BIP70 entries from macOS Info.plist

* gui: remove payment request file handling from OpenURI dialog

* gui: remove BIP70 Support

* build: remove protobuf from depends and contrib
2022-04-25 12:01:47 +03:00
pasta
b1f84e5db6 chore: bump version in configure.ac to v18.0.0.0-rc1 2022-04-15 13:01:08 -06:00
fanquake
55bd901c7f Merge bitcoin/bitcoin#24112: build: pass win32-dll to LT_INIT()
80e78b6a0479094cae642726f74a17d09b708ddc build: pass win32-dll to LT_INIT() (fanquake)

Pull request description:

  This is the recommended way to support building PE DLLs with modern mingw
  toolchains and libtool. I made a similar change upstream in the secp256k1
  repo: https://github.com/bitcoin-core/secp256k1/pull/1022. Note that we already
  pass `-no-undefined` to our libtool LDFLAGS.

  > This option should be used if the package has been ported to build clean
  > dlls on win32 platforms.
  > If this macro is not used, libtool will assume that the package libraries
  > are not dll clean and will build only static libraries on win32 hosts.

  See:
  https://www.gnu.org/software/libtool/manual/libtool.html#LT_005fINIT
  https://www.gnu.org/software/gnulib/manual/html_node/Libtool-and-Windows.html
  https://autotools.io/libtool/windows.html
  https://github.com/bitcoin-core/secp256k1/issues/923

  Guix Build:
  ```bash
  bash-5.1# find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
  a504bac1c81818e2fa7e14d4b1e2ddf665b9b79683fff4390ec1d76335157012  guix-build-80e78b6a0479/output/aarch64-linux-gnu/SHA256SUMS.part
  ef9193402c261adb993f6644de3f49858acb6d120002505e0def4827b8772294  guix-build-80e78b6a0479/output/aarch64-linux-gnu/bitcoin-80e78b6a0479-aarch64-linux-gnu-debug.tar.gz
  030961da6966a14d3dd7322dc7559dfdc0bdeb9f39d042f379c41bab98303d28  guix-build-80e78b6a0479/output/aarch64-linux-gnu/bitcoin-80e78b6a0479-aarch64-linux-gnu.tar.gz
  c485e456d325cdd64111eefe36b007e7bcb9e5eb61b1ab752e601023f5853e55  guix-build-80e78b6a0479/output/arm-linux-gnueabihf/SHA256SUMS.part
  ff0481c57a3ab15c9651ead7b77990c37af9360bfbc1f5285ad5f7d0c66f5acc  guix-build-80e78b6a0479/output/arm-linux-gnueabihf/bitcoin-80e78b6a0479-arm-linux-gnueabihf-debug.tar.gz
  5f582e30bbdba9df175bf4c5d4aae64e2a1cf572086390ae6962d3ee9f0325a9  guix-build-80e78b6a0479/output/arm-linux-gnueabihf/bitcoin-80e78b6a0479-arm-linux-gnueabihf.tar.gz
  e96c601af96e851a0351c6f8975feb47623a2dd5e3dd2c15bcdfe8435f845538  guix-build-80e78b6a0479/output/arm64-apple-darwin/SHA256SUMS.part
  a50db7a8a9b6415842807644760110f2e01665b922b2762634d94e2b497cbd4a  guix-build-80e78b6a0479/output/arm64-apple-darwin/bitcoin-80e78b6a0479-arm64-apple-darwin.tar.gz
  0f3707a2423483f84be5edff91f8e657cf71ab097d2550f4369760ac8c6a1644  guix-build-80e78b6a0479/output/arm64-apple-darwin/bitcoin-80e78b6a0479-osx-unsigned.dmg
  33252a9895c013cfbea06444d6372a23cc555831e4675705b4d7d6b065f06cff  guix-build-80e78b6a0479/output/arm64-apple-darwin/bitcoin-80e78b6a0479-osx-unsigned.tar.gz
  2ab70177c80c36e98018d07e2aece084c7d3d604e7dc12d2df2e1a077e06b983  guix-build-80e78b6a0479/output/dist-archive/bitcoin-80e78b6a0479.tar.gz
  cc0237b05948472efa61f7d5a666d8e97b5abeb7f498f3f72d46ff69be38bcf4  guix-build-80e78b6a0479/output/powerpc64-linux-gnu/SHA256SUMS.part
  b3778fd81bf4e432ad1590792673c91d09c8f8f43daef4cbe0852bca49e1ed57  guix-build-80e78b6a0479/output/powerpc64-linux-gnu/bitcoin-80e78b6a0479-powerpc64-linux-gnu-debug.tar.gz
  bebe78f0e6a062d943c99470f12bfc520381acec40e0409915cc8d5dccbe5999  guix-build-80e78b6a0479/output/powerpc64-linux-gnu/bitcoin-80e78b6a0479-powerpc64-linux-gnu.tar.gz
  350f7b22562d8b6642f37afb3e192d36dbcb360a361c8b834d0f7d50401667b8  guix-build-80e78b6a0479/output/powerpc64le-linux-gnu/SHA256SUMS.part
  9a488fbd71c53092feda8dfccecc4ae7d10aa2efe48f99f150cb2322bb28c5e6  guix-build-80e78b6a0479/output/powerpc64le-linux-gnu/bitcoin-80e78b6a0479-powerpc64le-linux-gnu-debug.tar.gz
  06d3c472171124d6ca92f95f7d5cb7fc4a523c25396dbbb9522cab920867d3db  guix-build-80e78b6a0479/output/powerpc64le-linux-gnu/bitcoin-80e78b6a0479-powerpc64le-linux-gnu.tar.gz
  67d591d5f15933d56046d0b8208970dc812ddd240c14a4c3b635cdc256ae5205  guix-build-80e78b6a0479/output/riscv64-linux-gnu/SHA256SUMS.part
  f9a853d703ac153748f3d9f60d4a74a72c75966dc1d3711b688ebd003ff9389c  guix-build-80e78b6a0479/output/riscv64-linux-gnu/bitcoin-80e78b6a0479-riscv64-linux-gnu-debug.tar.gz
  07554223c5ab3b940f53f9483054023e639d4e9902810b3d5c1875fd390064ea  guix-build-80e78b6a0479/output/riscv64-linux-gnu/bitcoin-80e78b6a0479-riscv64-linux-gnu.tar.gz
  294dc1274391b17fb750eac7c76e59c18e972ed3fbf8bccd53ba514843fbc59f  guix-build-80e78b6a0479/output/x86_64-apple-darwin/SHA256SUMS.part
  cc5c1256ca57f80d5ecb93fe2ac477f90945206430545b0463813f7099804f47  guix-build-80e78b6a0479/output/x86_64-apple-darwin/bitcoin-80e78b6a0479-osx-unsigned.dmg
  c5ff5cf7a8119981f8a1aa2306ff9e84c60e5c9845836eb2562941801495c7de  guix-build-80e78b6a0479/output/x86_64-apple-darwin/bitcoin-80e78b6a0479-osx-unsigned.tar.gz
  5951712d82391ba0471f253a7f87701b464dad1a90bb1d91866b0c7c51164a8f  guix-build-80e78b6a0479/output/x86_64-apple-darwin/bitcoin-80e78b6a0479-osx64.tar.gz
  28f84ed57769a642b1679acf90fdaad7ac489d59598d4a8a859021d39a32d878  guix-build-80e78b6a0479/output/x86_64-linux-gnu/SHA256SUMS.part
  f7c37c47ffaec6fbca36c3c4897b2df2fa7dd5327cb860501eec9d9e987ea5c7  guix-build-80e78b6a0479/output/x86_64-linux-gnu/bitcoin-80e78b6a0479-x86_64-linux-gnu-debug.tar.gz
  c7c6db897a604e5a85f37938b763538751a133bbab90e80904d4b7198b227d95  guix-build-80e78b6a0479/output/x86_64-linux-gnu/bitcoin-80e78b6a0479-x86_64-linux-gnu.tar.gz
  80b1e0e249cefe8941ca0e1a563f479c5e4408da6f0aa02c127182a09310dd8c  guix-build-80e78b6a0479/output/x86_64-w64-mingw32/SHA256SUMS.part
  e7f8b2cd0f0f465e80d96338dcc398306b321a9c99556ca1d39f094752702a21  guix-build-80e78b6a0479/output/x86_64-w64-mingw32/bitcoin-80e78b6a0479-win-unsigned.tar.gz
  5191f309c758135fd597df6bc9ef9e2c2746947abb74b38c32e5b6e073fa0995  guix-build-80e78b6a0479/output/x86_64-w64-mingw32/bitcoin-80e78b6a0479-win64-debug.zip
  1569de943ca054841141c700f1d4fca2658228b85eee1f44d201b0c881218ef0  guix-build-80e78b6a0479/output/x86_64-w64-mingw32/bitcoin-80e78b6a0479-win64-setup-unsigned.exe
  c8d78aeedeeaf7af4d325d38fb5e2307965b0080ce08a8cde802afaaa73f157d  guix-build-80e78b6a0479/output/x86_64-w64-mingw32/bitcoin-80e78b6a0479-win64.zip
  ```

ACKs for top commit:
  hebasto:
    ACK 80e78b6a0479094cae642726f74a17d09b708ddc

Tree-SHA512: fb4a6a443288723776491a9795429273b4a454cfd8230e75570d44fcd71037dc784a2061f6a979322ebc8f9b4131dfbb0494146ab3863f94829e72922be4ec07
2022-04-11 09:46:40 -07:00
Kittywhiskers Van Gogh
405b44e211 merge bitcoin#19131: Fix unreachable code in init arg checks 2022-04-07 11:28:43 -05:00
UdjinM6
eb42d8eee4
Merge pull request #4749 from PastaPastaPasta/develop-trivial-2022-04-03-pr2
trivial backports 2022 04 03 pr2
2022-04-07 13:17:05 +03:00
MarcoFalke
353dc403f5 Merge #21080: fuzz: Configure check for main function (take 2)
fac4be30482c21ac330e09ef8756c49e37faa6fa fuzz: Configure check for main function (take 2) (MarcoFalke)

Pull request description:

  Actually fix https://github.com/google/honggfuzz/issues/336#issuecomment-702972138

  Follow-up to #20065

  Steps to test: `honggfuzz` section in doc/fuzzing.md

ACKs for top commit:
  practicalswift:
    cr ACK fac4be30482c21ac330e09ef8756c49e37faa6fa: patch looks correct!

Tree-SHA512: 893768c80439fe5d90b883ade89dc02f5bb80e27637916cf5575b6a9ed0b1c04942ff851342f5bbabb8666e6696715427feeb98f5301ad23c7b87b09e5872f97
2022-04-05 23:10:05 -05:00
fanquake
dd3739543d Merge bitcoin/bitcoin#23282: build: remove build stubs for external leveldb
17ae2601c786e6863cee1bd62297d79521219295 build: remove build stubs for external leveldb (Cory Fields)

Pull request description:

  Presumably these stubs indicate to packagers that external leveldb is meant to be supported in some way. It is not. Remove the stubs to avoid sending any mixed messages.

  For context, this was reported on IRC:

  > \<Talkless> bitcoind fails to start with undefined symbol: _ZTIN7leveldb6LoggerE in Debian Sid after leveldb upgraded from 1.22 to 1.23: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=996486

ACKs for top commit:
  fanquake:
    ACK 17ae2601c786e6863cee1bd62297d79521219295
  hebasto:
    ACK 17ae2601c786e6863cee1bd62297d79521219295. I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 2f1ac2cb30dac64791933a245a2b66ce237bde3955e6f4a6b7ec181248f77a9b1b10597d865d3e2c2b6def696af70de40e905ec274e4ae7cccd1daf461473957
2022-04-03 18:46:47 -05:00
fanquake
87caa91a99 Merge bitcoin/bitcoin#22409: configure: keep relative paths in debug info
0bc666b053b8f4883c3f5de43959e2bbd91b95c5 doc: add info for debugging with relative paths (S3RK)
a8b515c317f0b5560f62c72a8f4eb6560d8f1c75 configure: keep relative paths in debug info (S3RK)

Pull request description:

  This is a follow-up for #20353 that fixes #21885

  It also adds a small section to assist debugging without absolute paths in debug info.

ACKs for top commit:
  kallewoof:
    Tested ACK 0bc666b053b8f4883c3f5de43959e2bbd91b95c5
  Zero-1729:
    Light crACK 0bc666b053b8f4883c3f5de43959e2bbd91b95c5

Tree-SHA512: d4b75183c3d3a0f59fe786841fb230581de87f6fe04cf7224e4b89c520d45513ba729d4ad8c0e62dd1dbaaa7a25741f04d036bc047f92842e76c9cc31ea47fb2
2022-04-03 18:41:33 -05:00
MarcoFalke
c4567ce9d4 Merge #20065: fuzz: Configure check for main function
fae7a1c18803675e70b9bf66575e1e0a6e01f6f6 fuzz: Configure check for main function (MarcoFalke)

Pull request description:

  Instead of the PP jungle, use a proper configure check

  Fixes https://github.com/google/honggfuzz/issues/336#issuecomment-702972138

ACKs for top commit:
  practicalswift:
    ACK fae7a1c18803675e70b9bf66575e1e0a6e01f6f6

Tree-SHA512: 2e55457d01f9ac598bb1e119d8b49dca55a28f88ec164cee6b5f071c29e9791f5a46cc8ee2b801b3a3faf906348da964ce32e7254da981c1104b9210a3508100
2022-04-03 18:09:19 -05:00
UdjinM6
0e38e7ad81
Fix 4692 (#4745)
* Revert unrelated changes

* Fix AM_CONDITIONAL
2022-03-30 21:49:51 +03:00
laanwj
a7a3a93489 Merge bitcoin/bitcoin#24115: ARMv8 SHA2 Intrinsics
aaa1d03d3acebeb44fdd40a302f086aad3d329ce Add optimized sha256d64_arm_shani::Transform_2way (Pieter Wuille)
fe0629852aaf3a26f291bfa535e7e455fe7bea06 Implement sha256_arm_shani::Transform (Pavol Rusnak)
48a72fa81f80c8a3c7c6de8339b5feb361dece1c Add sha256_arm_shani to build system (Pavol Rusnak)
c2b79342506e24e9b7100fb7a6025dc870375ef6 Rename SHANI to X86_SHANI to allow future implementation of ARM_SHANI (Pavol Rusnak)

Pull request description:

  This PR adds support for ARMv8 SHA2 Intrinsics.

  Fixes https://github.com/bitcoin/bitcoin/issues/13401 and https://github.com/bitcoin/bitcoin/issues/17414

  * Integration part was done by me.
  * The original SHA2 NI code comes from https://github.com/noloader/SHA-Intrinsics/blob/master/sha256-arm.c
  * Minor optimizations from https://github.com/rollmeister/bitcoin-armv8/blob/master/src/crypto/sha256.cpp are applied too.
  * The 2-way transform added by @sipa

ACKs for top commit:
  laanwj:
    Code review and lightly tested ACK aaa1d03d3acebeb44fdd40a302f086aad3d329ce

Tree-SHA512: 9689d6390c004269cb1ee79ed05430d7d35a6efef2554a2b6732f7258a11e7e959b3306c04b4e8637a9623fb4c12d1c1b3592da0ff0dc6d737932db302509669

# Conflicts:
#	configure.ac
#	src/Makefile.am
#	src/crypto/sha256.cpp
2022-03-28 13:05:12 -05:00
UdjinM6
39827f9eb4
Merge pull request #4725 from PastaPastaPasta/develop-trivial-2022-03-13
Develop trivial 2022 03 13
2022-03-15 01:08:14 +03:00
UdjinM6
15501fd0d4
Use DEBUG_CORE instead of a more generic DEBUG when compiling with --enable-debug (#4728)
`DEBUG` is unreliable because of bls/relic internals it seems
2022-03-15 00:40:40 +03:00
W. J. van der Laan
d03696ca67 Merge bitcoin/bitcoin#23045: build: Restrict check for CRC32C intrinsic to aarch64
f2747d1602ec4e1128356b861b2167daf66a845b build: Restrict check for CRC32C intrinsic to aarch64 (W. J. van der Laan)

Pull request description:

  `crc32c`'s hardware accelerated code doesn't handle ARM 32-bit at all, but only 64-bit. Make the check in `configure.ac` check for this architecture explicitly. This change does not affect non-ARM architectures.

  For the release binaries, the current `configure.ac` check happens to work: it enables it on aarch64 but disables it for armhf. However some combination of compiler version and settings can cause this check to succeed on armhf (as reported on IRC). So make the 64-bit platform requirement explicit.

  (details: while the check already explicitly checks the `__crc32d` intrinsic, which strictly doesn't exist on 32-bit ARM, this is not enough! gcc happens to helpfully emulate it:
  > These built-in intrinsics for the ARMv8-A CRC32 extension are available when the -march=armv8-a+crc switch is used "uint32_t __crc32d (uint32_t, uint64_t)" Form of expected instruction(s): Two crc32w r0, r0, r0 instructions for AArch32

  )

ACKs for top commit:
  luke-jr:
    re-tACK f2747d1602ec4e1128356b861b2167daf66a845b
  jarolrod:
    ACK f2747d1602ec4e1128356b861b2167daf66a845b

Tree-SHA512: e5f05f05eeec310ac42685621d86862735586be66dc378db404ec9414ac5aaea7c53d76d76d875b15b11924eee6714076120c07b077183fd7af898704fd81823
2022-03-13 14:52:24 -05:00
MarcoFalke
5ac7ca1296 Merge #19846: build: enable unused member function diagnostic
819d03b932134ee91df3b0fe98a481a331ce57bf refactor: took out unused member functions (Zero)
ed69213c2b2a99023bdee5168614cb8b71990f5f build: enable unused member function diagnostic (Zero)

Pull request description:

  This PR enables the `-Wunused-member-function` compiler diagnostic, as discussed in #19702.

  > **Notice**: The `unused-member-function` diagnostic is only available on clang. Therefore, clang should be used to test this PR.

  - [x] Include the `-Wunused-member-function`diagnostic in `./configure.ac`. (ed69213c2b2a99023bdee5168614cb8b71990f5f)
  - [x] Resolve the reported warnings. (819d03b932134ee91df3b0fe98a481a331ce57bf)

  Currently, enabling this flag no longer reports the following warnings:

  > **Note**: output from `make 2>&1 | grep "warning: unused member function" | sort | uniq -c`

  ```
  1 index/blockfilterindex.cpp:54:5: warning: unused member function 'DBHeightKey' [-Wunused-member-function]
  2 script/bitcoinconsensus.cpp:50:9: warning: unused member function 'GetType' [-Wunused-member-function]
  1 test/util_tests.cpp:1975:14: warning: unused member function 'operator=' [-Wunused-member-function]
  ```

  All tests have passed locally (from `make check` & `src/test/test_bitcoin`).

  This PR closes #19702.

ACKs for top commit:
  practicalswift:
    ACK 819d03b932134ee91df3b0fe98a481a331ce57bf - patch still looks correct :)
  MarcoFalke:
    ACK 819d03b932134ee91df3b0fe98a481a331ce57bf
  pox:
    Tested ACK 819d03b932134ee91df3b0fe98a481a331ce57bf with clang after `make clean`. No unused member function warnings.
  theStack:
    tested ACK 819d03b932134ee91df3b0fe98a481a331ce57bf

Tree-SHA512: 5fdfbbb02b3dc618a90a874a5caa5e01e596fc1d14a209e75a6981f01b253f9bca0cfac8fdd758dd7151986609fb76571c3745124a29cfd4f8cbb8d82a07272e
2022-03-05 13:48:08 -06:00
fanquake
89502a18ce Merge #18928: build: don't pass -w when building for Windows
89fea68ffdbd97394d891177e664f896b3e7d1e6 build: don't pass -w when building for Windows (fanquake)

Pull request description:

  This has been around since the introduction of autotools. However at
  this point I'm not sure we'd ever want to suppress all warnings when
  performing a build, and given that CXX FLAGS will have been overriden
  when cross-compiling for Windows (using depends), this would rarely,
  if-ever be used anyways.

  From https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html:
  > -w
  >
  >     Inhibit all warning messages.

ACKs for top commit:
  hebasto:
    ACK 89fea68ffdbd97394d891177e664f896b3e7d1e6

Tree-SHA512: 2b5bdef7fff5c87b28199f5822cab3cdf600c90c01a40db5cd85053eef5dcb5816e2e97ff61a30ff94b4f0c6cb7be22beaef34d82235bdf05ff9da865d40b381
2022-03-05 14:36:25 -05:00
PastaPastaPasta
c67867582d
Merge pull request #4638 from Munkybooty/backports-0.18-pr18
Backports 0.18 pr18
2022-03-05 12:43:14 -06:00