Commit Graph

691 Commits

Author SHA1 Message Date
fanquake
d6d402bd2b
build: remove x-prefix comparisons
Very old shells suffered from bugs which meant that prefixing variables
with an "x" to ensure that the lefthand side of a comparison always
started with an alphanumeric character was needed. Modern shells don't
suffer from this issue (i.e Bash was fixed in 1996).

In any case, we've already got unprefixed checks used in our codebase,
i.e https://github.com/bitcoin/bitcoin/blob/master/configure.ac#L292,
and have dependencies (in depends) that also use unprefixed comparisons.

I think it's time that we can consolidate on not using the x-prefix
workaround. At best it's mostly just confusing.

More info:
https://github.com/koalaman/shellcheck/wiki/SC2268
https://www.vidarholen.net/contents/blog/?p=1035
2021-12-03 21:03:35 +08:00
Hennadii Stepanov
1732eaba4f
build, qt: Fix regression in rendering on macOS Big Sur 2021-12-03 14:07:12 +08:00
fanquake
c870027cc2
build: qt 5.15.2 2021-12-03 14:07:12 +08:00
fanquake
904ba2aa40
build: add libxcb_util_wm 0.4.1
Required for xcb_icccm.
2021-12-03 14:07:12 +08:00
fanquake
0e2ca89a78
build: add libxcb_util_image 0.4.0 2021-12-03 14:07:11 +08:00
fanquake
36af9b6c94
build: add libxcb_util_keysyms 0.4.0 2021-12-03 14:07:11 +08:00
fanquake
b3cfbf5af2
build: add libxcb_util_render 0.3.9 2021-12-03 14:07:11 +08:00
fanquake
e545b56dc5
build: add libxcb_util 0.4.0 2021-12-03 14:07:11 +08:00
fanquake
937b36b5f0
build: libxcb 1.14
Minimum required libxcb to build qt 5.15.x is 1.11.

https://codereview.qt.nokia.com/c/qt/qtbase/+/253905

Some plugins have been re-enabled as they are required by Qt.
2021-12-03 14:07:10 +08:00
fanquake
01544dd78c
build: freetype 2.11.0
Co-authored-by: mammix2 <mammix2@hotmail.com>
2021-12-03 14:07:10 +08:00
fanquake
10ac182f4c
build: expat 2.4.1 2021-12-03 14:07:10 +08:00
fanquake
d3d547c545
build: xcb_proto 1.14.1 2021-12-03 14:07:10 +08:00
fanquake
fc65127244
build: libXau 1.0.9 2021-12-03 14:07:10 +08:00
fanquake
0697557321
build: xproto 7.0.31 2021-12-03 14:07:09 +08:00
fanquake
29074ba836
Merge bitcoin/bitcoin#23618: build, qt: Ditch no_sdk_version_check.patch
855bd75503 build, qt: Ditch `no_sdk_version_check.patch` (Hennadii Stepanov)

Pull request description:

  Since Qt 5.12.2 (see 5d181961ea) it is possible to control whether to check macOS SDK with the `QT_MAC_SDK_NO_VERSION_CHECK` variable.

ACKs for top commit:
  fanquake:
    ACK 855bd75503

Tree-SHA512: e490f22da9c37d25b58418ca62e65d2303cfbd83139f4abea4b67c37fa97e9a882ccc9d484b49cd2bb3a8851ea35e63123d3c6db7f804d6b50f41b10bd10c10b
2021-11-30 16:50:50 +08:00
Hennadii Stepanov
855bd75503
build, qt: Ditch no_sdk_version_check.patch 2021-11-28 20:56:54 +02:00
Hennadii Stepanov
83c08ba0c9
doc: Fix typos in packages.md 2021-11-28 18:13:52 +02:00
Hennadii Stepanov
19f3896c9a
build: Fix x86_64 <-> arm64 cross-compiling for macOS 2021-11-26 14:19:27 +02:00
fanquake
05cdceb19d
build: don't set PORT=no in config.site
This should have been a part of dropping macports support in #15175.
2021-11-25 21:40:50 +08:00
Hennadii Stepanov
d0204199d6
Revert "doc: Install Rosetta on M1-macOS for qt in depends"
This reverts commit cdb41d5573.

It is no longer required because of the previous commit.
2021-11-25 09:35:25 +02:00
Hennadii Stepanov
f6e2781675
build, qt, macOS: Don't pass -device-option when building natively 2021-11-25 09:35:24 +02:00
Hennadii Stepanov
667f0689ca
build, qt, macOS: Don't hard-code x86_64 as the arch when using qmake
This change fixes qt build on M1 Apple Silicon
2021-11-25 09:35:17 +02:00
Hennadii Stepanov
2f356a0ca8
scripted-diff: Drop Darwin version for better maintainability
-BEGIN VERIFY SCRIPT-
sed -i 's/darwin19/darwin/g' $(git grep --files-with-matches 'darwin19')
-END VERIFY SCRIPT-
2021-11-25 01:12:46 +02:00
Kittywhiskers Van Gogh
8196b0a2bc build: patch qt to explicitly define previously implicit header include
macOS Monterey has refactored some includes such that implicitly defined headers were no longer exposed and that in turns breaks building Qt on macOS 12.

Additional Resources:
 - https://bugreports.qt.io/browse/QTBUG-97855
 - https://codereview.qt-project.org/c/qt/qtbase/+/378706
 - https://code.qt.io/cgit/qt/qtbase.git/commit/src/plugins/platforms/cocoa?id=dece6f5840463ae2ddf927d65eb1b3680e34a547
2021-11-24 14:03:12 +05:30
fanquake
0445e1a1a5
build: use -fcf-protection=full when building Windows Boost in depends 2021-11-17 16:12:47 +08:00
fanquake
6780759a01
Merge bitcoin/bitcoin#23478: build: Add support for Android NDK r23 LTS
4ba492052e doc: Add minimum supported Android NDK version (Hennadii Stepanov)
6393bdcd53 doc: Move Android dependencies guide into `build-android.md` (Hennadii Stepanov)
ac323a7222 build: Switch to llvm buinutils for Android builds (Hennadii Stepanov)

Pull request description:

  The new Long Term Support release of the Android NDK is [available](https://groups.google.com/g/android-ndk-announce/c/MS6Qoub0DKE/m/Zfp5Ys8eAAAJ) since 2021-08-11:

  > As r23 is the new LTS, the support windows for r21 and r22 have now ended.

  On master (8ae4ba481c), dependency build fails because it expects GNU Binutils are present in the Android NDK. In [fact](https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#binutils):
  > GNU Binutils remains available up to and including r22. All binutils tools with the exception of the assembler (GAS) were removed in r23. GAS was removed in r24.

  This PR switches our depends build system to llvm binutils. The usage of `llvm-ar` and `llvm-ranlib` tools effectively makes r21 the minimum supported version of NDK.

  With this PR:
  - building depends against NDK r23 LTS now is possible with `NO_QT=1`
  - building the `qt` package in depends against NDK r23 LTS still fails:
  ```
  Creating qmake...
  ...

  ERROR: Cannot detect Android NDK toolchain.
  Please use -android-toolchain-version to specify it.
  ```

  The issue with the `qt` package is going to be addressed in another PR.

ACKs for top commit:
  fanquake:
    ACK 4ba492052e

Tree-SHA512: cdc8f95ff9a3ad7f12eb55b9ea18b6b6b800d4cceff7e0321985be6e39d15a2b2ea5b1592972307d76d111292a0ed58fd287e5ca285e2f6868b42a286536d310
2021-11-16 10:05:17 +08:00
MarcoFalke
9d2895157e
Merge bitcoin/bitcoin#23500: doc: fix typos
2de1ceb2e9 depends, wallet: fix typos (Dimitris Apostolou)

Pull request description:

ACKs for top commit:
  hebasto:
    ACK 2de1ceb2e9

Tree-SHA512: e33deef3ebd8cda69dd0f2c0e8d0fd5c39375eb014685318b2f131c7a700584d9b9e173e95ff290b1fe3b2dc88922583f2607750445baedf0c97a330a9ff35f2
2021-11-14 08:38:28 +01:00
Dimitris Apostolou
2de1ceb2e9
depends, wallet: fix typos 2021-11-13 20:05:56 +02:00
fanquake
e734847c1f
build: remove duplicate -fvisibility=hidden from Boost build
Boost already sets this by default.
2021-11-12 19:04:35 +08:00
fanquake
32659e5897
build: don't install Boost cmake config files 2021-11-12 19:04:22 +08:00
Hennadii Stepanov
6393bdcd53
doc: Move Android dependencies guide into build-android.md 2021-11-10 18:51:33 +02:00
Hennadii Stepanov
ac323a7222
build: Switch to llvm buinutils for Android builds
GNU Binutils with the exception of the assembler were removed in NDK r23
LTS.
2021-11-10 18:51:33 +02:00
fanquake
927c2c4f87
Merge bitcoin/bitcoin#22783: build: Cleanup depends build system
539ca409c9 build: Remove unneeded share/man directory from libXau package (Hennadii Stepanov)
6c25c83050 build: Remove unneeded share/man directory from freetype package (Hennadii Stepanov)
9067c6c451 build: Remove empty var/cache/fontconfig directory from fontconfig (Hennadii Stepanov)
4a37c268db build: Remove unneeded share/doc directory from expat package (Hennadii Stepanov)
acb9400ab6 build: Drop non-existent share/pkgconfig directory (Hennadii Stepanov)

Pull request description:

  This PR:
  - removes non-existent `share/pkgconfig` path from `PKG_CONFIG_PATH`. This change, actually, make `PKG_CONFIG_PATH` unused in the depends build system
  - removes `doc`,  `man` and empty directories from the built packages

ACKs for top commit:
  fanquake:
    ACK 539ca409c9

Tree-SHA512: 41ffd5cea962f7533cb5d66ff9e8fd71a3dd7a8d9568b1bb63fc68e7070d7e416f6db02a0f8ab4d94063ee7f6370f00d62a5791b44f0d21c10666af590268c36
2021-10-19 15:51:41 +08:00
Hennadii Stepanov
539ca409c9
build: Remove unneeded share/man directory from libXau package 2021-10-18 14:43:26 +03:00
Hennadii Stepanov
6c25c83050
build: Remove unneeded share/man directory from freetype package 2021-10-18 14:43:26 +03:00
Hennadii Stepanov
9067c6c451
build: Remove empty var/cache/fontconfig directory from fontconfig 2021-10-18 14:43:26 +03:00
Hennadii Stepanov
4a37c268db
build: Remove unneeded share/doc directory from expat package 2021-10-18 14:43:25 +03:00
Hennadii Stepanov
acb9400ab6
build: Drop non-existent share/pkgconfig directory 2021-10-18 14:43:13 +03:00
Hennadii Stepanov
33796a964a
build: Add ability to build qt in depends with -stdlib=libc++ 2021-09-28 09:13:19 +03:00
fanquake
a43b8e9555
build: set OSX_MIN_VERSION to 10.15
This is required to use std::filesystem on macOS as support for it only
landed in the libc++ dylib shipped with 10.15.

See also: https://developer.apple.com/documentation/xcode-release-notes/xcode-11-release-notes

Clang now supports the C++17 <filesystem> library for iOS 13, macOS 10.15, watchOS 6, and tvOS 13.
2021-09-16 17:50:19 +08:00
fanquake
76f031b050
build: fix unoptimized libraries in depends
We need to append-to rather than set CXXFLAGS, otherwise we loose -O2 &
-pipe. Currently this results in zeromq being built without optimizations
at all (or whatever the compiler would default too, essentially always -O0).

Bdb is the same, for the CXX portion of its code. C code has been built
with -O2.

Boost has actually been uneffected because it receives -O3 from it's own
build flags.
2021-08-31 11:43:48 +08:00
fanquake
5985f098ea
depends: use latest config.guess and config.sub for sqlite 2021-07-22 11:10:29 +08:00
fanquake
35d082c500
depends: use latest config.guess and config.sub for cctools 2021-07-22 11:10:21 +08:00
fanquake
bda0b637b2
depends: use latest config.guess and config.sub for libevent 2021-07-22 11:10:13 +08:00
fanquake
7fc9a45f47
Merge bitcoin/bitcoin#22469: build: Add support for Android NDK r22+
acaac6e86a ci: Bump Android NDK to r22 which supports std::filesystem (Hennadii Stepanov)
cac7890386 build: Add support for Android NDK r22+ (Hennadii Stepanov)

Pull request description:

  This is required to support [`std::filesystem`](https://github.com/android/ndk/wiki/Changelog-r22#changes) on Android (see #20744).

  Fixes #22074.

ACKs for top commit:
  icota:
    re-tACK acaac6e86a

Tree-SHA512: ecbec374ee590c4cb30012210f1422d469e7e8b68989f9eb53d36b5feee150d31e6bd10e1fc4a2056fbf4f8f8513e435b446e5feaf21a3a4d09dfc561fb22e73
2021-07-21 15:36:03 +08:00
fanquake
5c8820b399
Merge bitcoin/bitcoin#22436: build: use aarch64 Clang if cross-compiling for darwin on aarch64
54c7754f31 build: use aarch64 Clang if cross-compiling for darwin on aarch64 (fanquake)

Pull request description:

  If we're cross-compiling for darwin on aarch64 hardware, we need to
  use a Clang that will run on that hardware.

  Only tested in a Linux Docker container (aarch64-unknown-linux-gnu),
  running on an Apple M1 mac-mini (aarch64-apple-darwin20.5.0).

ACKs for top commit:
  hebasto:
    ACK 54c7754f31, I agree it can be merged (fix in #22448 is orthogonal to this one).

Tree-SHA512: 66c530097a5dc072a0a00dc22eb3d4a7d923dfa8ab8160f7c3e395cbe58da324f367548d673c0510606f5225d5d37bb5607a76b1703b8b03ac7d2cceeccbd542
2021-07-20 18:23:35 +08:00
Dmitry Goncharov
8494dcae0e Replace $(AT) with .SILENCE.
This reduces the amount of syntax noise in the makefiles.
2021-07-19 08:10:11 -04:00
Hennadii Stepanov
cac7890386
build: Add support for Android NDK r22+ 2021-07-18 12:10:01 +03:00
fanquake
4315dc02a1
Merge bitcoin/bitcoin#20641: depends: Use Qt top-level build facilities
1155978d8f build, qt: Do not install *.prl files (Hennadii Stepanov)
763793b60e build, qt: Fix wrong cross-compiling detection on macOS (Hennadii Stepanov)
30982721ab build, qt: Force bootstrap while building linguist tools (Hennadii Stepanov)
689320e307 build, qt: Drop translations.pro hack (Hennadii Stepanov)
6a1f98f253 build, qt: Drop lrelease dependency patch (Hennadii Stepanov)
39e561e087 build, qt: Add linguist_tools list (Hennadii Stepanov)
27d3def1c6 build: Use Qt top-level build facilities (Hennadii Stepanov)

Pull request description:

  This PR:
  - uses Qt top-level build facilities without the need to download all-in-one archive
  - is based on **BlockMechanic**'s [idea](https://github.com/bitcoin/bitcoin/pull/20600), and is an alternative to #20600
  - makes it easy to integrate [new modules](https://github.com/bitcoin/bitcoin/pull/16883) into static builds
  - has the minimal diff
  - makes the qt package build process streamlined by dropping some patches and hacks (an alternative to  #21420 and #20642)

  Fixes #18536 (a non-intrusive alternative to #21589 and #19785).

  Fixes #14648.

  Fixes #21588 (a non-intrusive alternative to #21591).

  Required for adding [Wayland support](https://github.com/bitcoin/bitcoin/issues/19950) on Linux.

  ---

  **Note for reviewers**: With 9046de8a4cbc3899fed9eae084115f423e7ac5bd from #21995 it is easy to verify that there are no changes in the resulted `qt` package archive on the per commit basis. For example, for `HOST=i686-pc-linux-gnu` no commit in this PR introduces any changes.

ACKs for top commit:
  fanquake:
    ACK 1155978d8f

Tree-SHA512: 667b06b72cb7ff26d68b9b88e8dddb51084783ca9e3d80b3392710794c1dc7fd77bbcc3ccf4ccece9919d33b9bf8fce13c5059502bd228021dc7c93fdb87ca7a
2021-07-18 14:05:39 +08:00
fanquake
b5889611c7
Merge bitcoin/bitcoin#22234: build: Mark print-% target as phony.
fb7be92b09 Mark print-% target as phony. (Dmitry Goncharov)

Pull request description:

  .PHONY does not take patterns (such as print-%) as prerequisites.
  Have print-% depend on force and mark force as phony.

  This change ensures print-% rule works even when there is a file that matches the target.

  ```
  $ # on master
  $ make print-host
  host=x86_64-pc-linux-gnu
  $ touch print-host
  $ make print-host
  make: 'print-host' is up to date.
  $
  $ git co mark_print_as_phony
  Switched to branch 'mark_print_as_phony'
  $ make print-host
  host=x86_64-pc-linux-gnu
  $ touch force
  $ make print-host
  host=x86_64-pc-linux-gnu
  ```

ACKs for top commit:
  hebasto:
    ACK fb7be92b09, tested on Linux Mint 20.2 (x86_64).

Tree-SHA512: b89ae66aa8c7aa6a7ab5f0956f9eb3b3ef9d56994b60dc2a97d498d4c1bba537845c190723e8a10310280b1b35df2cd935cc30aeb76735cac2dc621ad7823772
2021-07-18 13:41:24 +08:00
fanquake
54c7754f31
build: use aarch64 Clang if cross-compiling for darwin on aarch64
If we're cross-compiling for darwin on aarch64 hardware, we need need to
use a Clang that will run on that hardware.

Only tested in a Linux Docker container (aarch64-unknown-linux-gnu),
running on an Apple M1 mac-mini (aarch64-apple-darwin20.5.0).
2021-07-13 20:21:58 +08:00
Hennadii Stepanov
cdb41d5573
doc: Install Rosetta on M1-macOS for qt in depends 2021-07-05 13:42:14 +03:00
Dmitry Goncharov
fb7be92b09 Mark print-% target as phony.
.PHONY does not take patterns (such as print-%) as prerequisites.
Have print-% depend on FORCE and mark FORCE as phony.

$ # on master
$ make print-host
host=x86_64-pc-linux-gnu
$ touch print-host
$ make print-host
make: 'print-host' is up to date.
$
$ git co mark_print_as_phony
Switched to branch 'mark_print_as_phony'
$ make print-host
host=x86_64-pc-linux-gnu
$ touch FORCE
$ make print-host
host=x86_64-pc-linux-gnu
2021-06-24 23:08:26 -04:00
Hennadii Stepanov
1155978d8f
build, qt: Do not install *.prl files 2021-06-16 02:23:29 +03:00
Hennadii Stepanov
763793b60e
build, qt: Fix wrong cross-compiling detection on macOS 2021-06-15 22:36:43 +03:00
Hennadii Stepanov
30982721ab
build, qt: Force bootstrap while building linguist tools
Qt lrelease tool depends on the xml module. This change guarantees that
it is always available after being bootstrapped.
2021-06-15 22:36:28 +03:00
Hennadii Stepanov
689320e307
build, qt: Drop translations.pro hack
It is no longer required after switching to Qt top-level build.
2021-06-15 21:32:07 +03:00
Hennadii Stepanov
6a1f98f253
build, qt: Drop lrelease dependency patch
It is no longer required after switching to Qt top-level build.
2021-06-15 21:31:09 +03:00
Hennadii Stepanov
39e561e087
build, qt: Add linguist_tools list 2021-06-15 21:23:16 +03:00
Hennadii Stepanov
27d3def1c6
build: Use Qt top-level build facilities 2021-06-15 21:23:16 +03:00
Hennadii Stepanov
d1d1cc9831
build, qt: Fix compiling qt package in depends with GCC 11 2021-06-08 04:16:36 +03:00
fanquake
8837f1ebde
Merge bitcoin/bitcoin#21654: build, qt: Make Qt rcc output always deterministic
a58868d201 build: Makes rcc output always deterministic (Hennadii Stepanov)

Pull request description:

  The Qt Resource Compiler ([rcc](https://doc.qt.io/qt-5/rcc.html)) has a command-line option `--format-version` which has the [default value](https://code.qt.io/cgit/qt/qtbase.git/tree/src/tools/rcc/main.cpp?h=5.12.10#n172) 2.

  The only difference from `--format-version 1` is adding a [last modified timestamp](https://code.qt.io/cgit/qt/qtbase.git/tree/src/tools/rcc/rcc.cpp?h=5.12.10#n207) to the output file ([credits](https://github.com/bitcoin/bitcoin/pull/21654#issuecomment-819198228) to **fanquake**). That, in turn, forces us to use `QT_RCC_SOURCE_DATE_OVERRIDE=1` to get deterministic builds (#13732).

  This change makes rcc output always deterministic by using `--format-version 1` option that makes usage of the
  `QT_RCC_SOURCE_DATE_OVERRIDE` needless.

  ---

  Also it improves interaction with ccache:

  On master (f6c44e999b):
  ```
  $ make && make clean && ccache --zero-stats && make && ccache --show-stats
  ...
  cache directory                     /home/hebasto/.ccache
  primary config                      /home/hebasto/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats updated                       Sun Apr 11 15:45:43 2021
  stats zeroed                        Sun Apr 11 15:45:05 2021
  cache hit (direct)                   638
  cache hit (preprocessed)               0
  cache miss                             1
  cache hit rate                     99.84 %
  called for link                       10
  cleanups performed                     0
  files in cache                     20023
  cache size                          13.2 GB
  max cache size                      15.0 GB
  ```

  The missed file is always `qt/libbitcoinqt_a-qrc_bitcoin_locale.o`.

  With this PR:
  ```
  $ make && make clean && ccache --zero-stats && make && ccache --show-stats
  ...
  cache directory                     /home/hebasto/.ccache
  primary config                      /home/hebasto/.ccache/ccache.conf
  secondary config      (readonly)    /etc/ccache.conf
  stats updated                       Sun Apr 11 15:28:46 2021
  stats zeroed                        Sun Apr 11 15:28:21 2021
  cache hit (direct)                   639
  cache hit (preprocessed)               0
  cache miss                             0
  cache hit rate                    100.00 %
  called for link                       10
  cleanups performed                     0
  files in cache                     20012
  cache size                          13.2 GB
  max cache size                      15.0 GB
  ```

ACKs for top commit:
  fanquake:
    ACK a58868d201

Tree-SHA512: 52f4a3267f41883d13025c0de79b6da22e92d60c729e01b986935c6812bbfe7fadc40b742bd715bfdf09df94af6838d4fbbe8208c6123f366108e38c8e1121c5
2021-06-03 21:25:30 +08:00
Hennadii Stepanov
f09ed92be1
build: Try posix-specific CXX first for mingw32 host 2021-06-02 18:04:24 +03:00
João Barbosa
3b36395b96 depends: Fix qt.mk for mac arm64 2021-06-02 10:02:33 +01:00
fanquake
a83bbf02c7
Merge bitcoin/bitcoin#22054: depends: Bump Qt version to 5.12.11
fa416cea84 depends: Bump Qt version to 5.12.11 (Hennadii Stepanov)

Pull request description:

  Qt 5.12.11:
  - [fixes](c5d904639d) macOS related [QTBUG-87014](https://bugreports.qt.io/browse/QTBUG-87014), and the `fix_bigsur_drawing.patch` (which is our workaround for QTBUG-87014) could be dropped
  - [upgrades](00326c9dc1) supported macOS SDK to 11.0, and removes related warnings
  - fixes tab widget rendering on macOS Big Sur ([here](4d6832d03f) and [here](28b015342d)):
    - master (5.12.10)
  ![DeepinScreenshot_select-area_20210525122725](https://user-images.githubusercontent.com/32963518/119474470-dd24a180-bd54-11eb-82e6-ca4d39b0b177.png)
  ![DeepinScreenshot_select-area_20210525123634](https://user-images.githubusercontent.com/32963518/119475548-ebbf8880-bd55-11eb-9c13-477016f8c23b.png)
    - this PR (5.12.11)
  ![Screenshot from 2021-05-25 12-28-02](https://user-images.githubusercontent.com/32963518/119474537-ed3c8100-bd54-11eb-8efe-7fe5ccae8a98.png)

  Closes https://github.com/bitcoin-core/gui/issues/136.

ACKs for top commit:
  goums:
    ACK fa416cea84
  fanquake:
    ACK fa416cea84 - merging this now to move it out of the way of other Qt related changes.

Tree-SHA512: 4e621b214f05d12a060757fadf2fa103c09b594d7b1c2ad9200f550e55c1e1fdf66f2f830550e724b9277448e5480be256cb0003f4597902944400e16c4a68b8
2021-06-02 12:12:33 +08:00
fanquake
619e930aa1
Merge bitcoin/bitcoin#22070: build: don't use cf-protection when targeting arm-apple-darwin
3caedb4c03 build: don't use cf-protection when targeting arm-apple-darwin (fanquake)

Pull request description:

  After two reports on IRC of issues building depends on an Apple M1 machine, this option (obviously) can't be used when targeting `arm-apple-darwin`.  For now, just use it for `x86_64-apple-darwin`.

  ```bash
  Apple clang version 12.0.5 (clang-1205.0.22.9)
  Target: x86_64-apple-darwin20.4.0

  error: option 'cf-protection=return' cannot be specified on this target
  error: option 'cf-protection=branch' cannot be specified on this target
  2 errors generated.
  ```

ACKs for top commit:
  promag:
    Tested ACK 3caedb4c03.

Tree-SHA512: 8763a5b94000016b0c2f0438e66002fdfcd2cbafd9d2d2acc1972f0c6f707e820186711dbd9d3f72673c179718da75588acb4732f8d84b85f0c1dfc862b6e944
2021-05-31 10:05:55 +08:00
Hennadii Stepanov
fa416cea84
depends: Bump Qt version to 5.12.11 2021-05-27 14:53:18 +03:00
fanquake
7e2a9890e5
depends: latest config.sub (2021-04-30) 2021-05-26 13:30:18 +08:00
fanquake
f16d4cd8c5
depends: latest config.guess (2021-05-24) 2021-05-26 13:28:47 +08:00
fanquake
3caedb4c03
build: don't use cf-protection when targeting arm-apple-darwin
After two reports on IRC of issues building depends on an Apple M1
machine, it turns out that this option can't be used when targeting
arm-apple-darwin. For now, just use it for x86_64-apple-darwin.

```bash
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: x86_64-apple-darwin20.4.0

error: option 'cf-protection=return' cannot be specified on this target
error: option 'cf-protection=branch' cannot be specified on this target
2 errors generated.
```
2021-05-26 13:08:16 +08:00
fanquake
f152c1ac66
build: libevent 2.1.12-stable 2021-05-18 10:19:10 +08:00
W. J. van der Laan
ecf5f2c1a0
Merge bitcoin/bitcoin#21889: macho: check for control flow instrumentation
42b589d18f scripts: test for MACHO control flow instrumentation (fanquake)
469a5bc4fa build: build Boost with -fcf-protection when targeting Darwin (fanquake)

Pull request description:

  Addresses the macOS portion of #21888.

  Build Boost with `-fcf-protection` when targeting Darwin. This should be ok, because our cross-compiler (Clang 10) supports the option, and I'd expect all versions of Apple Clang being used to compile Core would also support it. Building Boost with this option is required so that the `main` provided to `test_bitcoin` has instrumentation.

  Note that the presence of instrumentation does not mean it will be used, as that is determined at runtime by the CPU.
  From the Intel control flow enforcement documentation:

  > The ENDBR32 and ENDBR64 instructions will have the same effect as the NOP instruction on Intel 64 processors that do not support CET. On processors supporting CET, these instructions do not change register or flag state. This allows CET instrumented programs to execute on processors that do not support CET. Even when CET is supported and enabled, these NOP–like instructions do not affect the execution state of the program, do not cause any additional register pressure, and are minimally intrusive from power and performance perspectives.

  Follow up from #21135.

  Guix builds:
  ```bash
  663df8471400f06d4da739e39a886aa17f56a36d66e0ff7cc290686294ef39c9  guix-build-42b589d18fed/output/dist-archive/bitcoin-42b589d18fed.tar.gz
  45e841661e1659a634468b6f8c9fb0a7956c31ba296f1fd0c02cd880736d6127  guix-build-42b589d18fed/output/x86_64-apple-darwin18/bitcoin-42b589d18fed-osx-unsigned.dmg
  0ea85c99fef35429a5048fa14850bce6b900eaa887aeea419b019852f8d2be78  guix-build-42b589d18fed/output/x86_64-apple-darwin18/bitcoin-42b589d18fed-osx-unsigned.tar.gz
  85857a5a4a5d4d3a172d6c361c12c4a94f6505fc12b527ea63b75bfe54ee1001  guix-build-42b589d18fed/output/x86_64-apple-darwin18/bitcoin-42b589d18fed-osx64.tar.gz
  ```

  Gitian builds:
  ```bash
  # macOS:
  bdfd677a6b88273a741b433e1e7f554af50cc76b3342d44ab0c441e2b40efc96  bitcoin-42b589d18fed-osx-unsigned.dmg
  f3b2d09f3bea7a5cc489b02e8e53dd76a9922338500fae79cad0506655af56f9  bitcoin-42b589d18fed-osx-unsigned.tar.gz
  29d5ad5e46bc9fb0056922a8b47c026e5e9f71e6cf447203b74644587d6fb6f7  bitcoin-42b589d18fed-osx64.tar.gz
  663df8471400f06d4da739e39a886aa17f56a36d66e0ff7cc290686294ef39c9  src/bitcoin-42b589d18fed.tar.gz
  366f8d7a2fc1f3e22cb1018043099126a71ce65380cc27b1c3280cce42d06c98  bitcoin-core-osx-22-res.yml
  ```

ACKs for top commit:
  laanwj:
    Code review ACK 42b589d18f

Tree-SHA512: 12cb8d462d64d845b9fe48c5c6978892adff8bf5b5572bb29f35df1f6176e47b32a68bcb6e4883c7d9454e76e8868851005a7325916852a2d0d32659ac7dae3f
2021-05-14 12:26:38 +02:00
fanquake
03e16cb027
Merge bitcoin/bitcoin#21593: build, qt, refactor: Get rid of some sed command instances
b95f7f8ac0 build, qt, refactor: Drop sed commands for win32-g++/qmake.conf (Hennadii Stepanov)

Pull request description:

  Such possibility is [available](https://codereview.qt-project.org/c/qt/qtbase/+/165348) since Qt 5.8.0.

ACKs for top commit:
  fanquake:
    ACK b95f7f8ac0

Tree-SHA512: e56a3d208a6bd5d42c722f8b344010fe7d1b6f7a28486613dfcb03f0403a47cee8476e2366eeaac401a19836cd09f782e8741a1e781ab4d78f72c500a30e4929
2021-05-12 14:24:47 +10:00
Hennadii Stepanov
a58868d201
build: Makes rcc output always deterministic
The Qt Resource Compiler (rcc) has a command-line option
`--format-version` which has the default value 2.

The only difference from `--format-version 1` is adding a last modified
timestamp to the output file. That, in turn, forces us to use
`QT_RCC_SOURCE_DATE_OVERRIDE=1` to get deterministic builds.

This change makes rcc output always deterministic by using
`--format-version 1` option that makes usage of the
`QT_RCC_SOURCE_DATE_OVERRIDE` needless. Also it improves interaction
with ccache.

Co-authored-by: fanquake <fanquake@gmail.com>
2021-05-10 18:31:49 +03:00
W. J. van der Laan
1a60c547fd
Merge bitcoin/bitcoin#21749: test: Bump shellcheck version
08f3dbb1b0 test: Bump shellcheck version (Hennadii Stepanov)

Pull request description:

  The changelog for v0.7.2 is available [here](https://github.com/koalaman/shellcheck/blob/v0.7.2/CHANGELOG.md).

  Only [SC2268](https://github.com/koalaman/shellcheck/wiki/SC2268) requires to update our code.

ACKs for top commit:
  jarolrod:
    ACK  08f3dbb1b0

Tree-SHA512: 4585cd1f4d9def2fbaafe5a2a57761288d432781eb8c6c6d37064727d7ca8fc3f35c552e6a2ffdf0820d753d4bde2c8e43e5f3f57d242f5f57591a9b1b03558d
2021-05-10 13:49:50 +02:00
fanquake
469a5bc4fa
build: build Boost with -fcf-protection when targeting Darwin
The LLVM Clang we use for cross-compilation supports this option, and it's expected
that any builders on macOS will also be using an Apple Clang that supports it.
2021-05-09 13:38:48 +08:00
MarcoFalke
fa9249aacc
depends: Add missing -D_LIBCPP_DEBUG=1 to debug flags 2021-05-06 07:47:27 +02:00
W. J. van der Laan
df21e500d6
Merge bitcoin/bitcoin#21427: depends: Fix id_string invocations
fa872c9af3 depends: Fix id_string invocations (Carl Dong)

Pull request description:

  Closes: #21242

  ```
  Reproduced from depends/Makefile comment:

  When invoking a shell, GNU Make special-cases exit code 127 (command not
  found) by not capturing the output but instead passing it through. This
  is not done for any other exit code.

  Therefore, we require a "|| true" to avoid this behaviour when in an
  environment where the build_* or host_* may not exist yet.
  ```

ACKs for top commit:
  laanwj:
    Concept and light code review ACK fa872c9af3

Tree-SHA512: 9ce88381aec579d956572cf70c4f69dc5a3873f0d2af14a71cf24814192a89452b8280258bed8cca804e4bd2644db056d213ab733df46a10560a47079524d8ac
2021-05-05 14:32:12 +02:00
W. J. van der Laan
cdcf82622d
Merge bitcoin/bitcoin#21629: build: fix configuring when building depends with NO_BDB=1
a5491882a0 build: fix configuring when building depends with NO_BDB=1 (fanquake)

Pull request description:

  Currently, if you build depends using `NO_BDB=1` (only sqlite wallets), `./configure` will fail as it still tries to find bdb. i.e:
  ```bash
  make -C depends/ NO_QT=1 NO_BDB=1 NO_UPNP=1 NO_ZMQ=1 NO_NATPMP=1 -j8
  ...
  copying packages: native_b2 boost libevent sqlite

  ./autogen.sh
  ./configure --prefix=/home/ubuntu/bitcoin/depends/x86_64-pc-linux-gnu
  ...
  checking for Berkeley DB C++ headers... default
  configure: error: Found Berkeley DB other than 4.8, required for portable BDB wallets (--with-incompatible-bdb to ignore or --without-bdb to disable BDB wallet support)
  ```

  This PR fixes the build such that you can build depends, opting out of bdb, without opting out of wallets entirely, and still configure successfully. I think I've tested across most potential configurations. i.e:
  ```bash
   ./configure (bdb and sqlite on system)
  bdb & sqlite are both are available

  ./configure --without-bdb  (bdb and sqlite on system)
  only sqlite

  ./configure --without-sqlite  (bdb and sqlite on system)
  only bdb

  ./configure --disable-wallet  (bdb and sqlite on system)
  neither bdb or sqlite

  depends NO_WALLET=1
  ./configure --prefix=/bitcoin/depends/x86_64-apple-darwin19.6.0
  neither bdb or sqlite

  depends NO_BDB=1
  ./configure --prefix=/bitcoin/depends/x86_64-apple-darwin19.6.0
  only sqlite

  depends NO_SQLITE=1
  ./configure --prefix=/bitcoin/depends/x86_64-apple-darwin19.6.0
  only bdb

  depends
  ./configure --prefix=/bitcoin/depends/x86_64-apple-darwin19.6.0
  bdb and sqlite
  ```

ACKs for top commit:
  laanwj:
    Code review ACK a5491882a0
  jarolrod:
    ACK a5491882a0

Tree-SHA512: baf7d2543a401db0d846095415ff449c04ecfb4a74c734dc51e79453702f9051210daeef686970f11fcffd32cdfadbc58acd54f0706aceecfb3edb0ff17310d7
2021-05-05 13:29:05 +02:00
MarcoFalke
8e1c06846e
Merge bitcoin/bitcoin#21662: build: update Boost download URL
36c10b9f4b build,boost: update download url. (fdov)

Pull request description:

  - bintray is closing.
      - updated to jfrog.io.

  For reference:
  https://github.com/boostorg/boost/issues/502

ACKs for top commit:
  Sjors:
    ACK 36c10b9
  hebasto:
    ACK 36c10b9f4b

Tree-SHA512: 6746781296c3f395a2824750cf1a578ef9a2d6b8d5c4da196a8da5d084aea01f7f2583b41b2aade7bb94dd02be71efcfd6edf7491a1a25f2d36240b18322a68e
2021-05-03 19:57:43 +02:00
fanquake
a5550f877a
build: use -stdlib++-isystem with Clang 10 2021-05-01 13:40:50 +08:00
fanquake
b80a6af9e5
build: no longer patch threading out of ld64
Changes introduced in ld64-450.3 have likely removed the need for us to
patch out pthreads. See:
https://opensource.apple.com/source/ld64/ld64-450.3/src/ld/InputFiles.cpp.auto.html.
2021-05-01 13:39:45 +08:00
fanquake
c29cba44b3
build: Xcode 12.1, macOS SDK 10.15.6 2021-05-01 13:39:45 +08:00
fanquake
9ed2f19d38
build: native cctools 973.0.1, ld64 609 2021-05-01 13:39:44 +08:00
Hennadii Stepanov
f48f187cce
build: Clang 10.0.1
LLVM 8 has inherent nondeterminism in the compiler, fixed in LLVM 9+.
2021-05-01 13:39:44 +08:00
fanquake
9b193cd2a3
build: libtapi 1100.0.11 2021-05-01 13:39:44 +08:00
fanquake
bb11a988fa
Merge bitcoin/bitcoin#21793: build: use -isysroot over --sysroot on macOS
cf971c9ea0 build: use -isysroot over --sysroot on macOS (fanquake)

Pull request description:

  Not only does this seem to be the more correct behaviour when targeting Darwin, but if you use `-isysroot`, Clangs Darwin driver will [infer the deployment target](3e037f8f0e/clang/lib/Driver/ToolChains/Darwin.cpp (L1652)) from the SDK and use other SDK info when parsing arguments to the linker. In the case of [`-platform_version`](3e037f8f0e/clang/lib/Driver/ToolChains/Darwin.cpp (L2656)), which is added if the linker is [new enough](3e037f8f0e/clang/lib/Driver/ToolChains/Darwin.cpp (L342)), the version tuple is constructed from the SDKInfo, and SDKInfo, as far as I can tell, only exists when `-isysroot` has been passed, see [parseSDKSettings](3e037f8f0e/clang/lib/Driver/ToolChains/Darwin.cpp (L1785))

  As a result, the SDK version field in the `LC_BUILD_VERSION` command is filled out. i.e when building master:
  ```bash
        cmd LC_BUILD_VERSION
    cmdsize 32
   platform 1
      minos 10.14
        sdk n/a
     ntools 1
       tool 3
    version 650.9
  ```
  vs this PR:
  ```bash
        cmd LC_BUILD_VERSION
    cmdsize 32
   platform 1
      minos 10.14
        sdk 11.3
     ntools 1
       tool 3
    version 650.9
  ```

  This, from what I understand, will fix the issue we are having with Qt deciding wether or not to enable features like "Dark mode" on macOS, see #21771, however I have not tested that. Thus this is an alternative to #21782.

  Our usage of `--sysroot` was added in #17118.

  ```bash
  -isysroot <dir>         Set the system root directory (usually /)
  ```

ACKs for top commit:
  Sjors:
    tACK cf971c9ea0
  hebasto:
    re-ACK cf971c9ea0, only rebased and addressed comments since my [previous](https://github.com/bitcoin/bitcoin/pull/21793#pullrequestreview-647321518) review.

Tree-SHA512: f01138179fb85083b5505bbaa48810451098ffa4da5d3c9b673785448790aa76f2e64b2aab6e698f6ee378a21f70626445a3fabee7c61dbfc44e96f3e3964656
2021-05-01 13:38:43 +08:00
fanquake
16d0051c6a
Merge bitcoin/bitcoin#21688: doc: note on SDK for macOS depends cross-compile
5e7d1997fc doc: note on SDK for macOS depends cross-compile (Jarol Rodriguez)

Pull request description:

  This PR adds a friendly note for those who are unfamiliar with our depends build system that an extracted SDK is needed before proceeding with a macOS cross-compile. Additionally, it refers a builder to look at [macdeploy](https://github.com/bitcoin/bitcoin/tree/master/contrib/macdeploy#sdk-extraction) for instructions on obtaining the SDK and provides context to where this SDK should reside.

  **Master:** [render](https://github.com/bitcoin/bitcoin/blob/master/depends/README.md#for-macos-cross-compilation)
  **PR:** [render](241c4017ed/depends/README.md (for-macos-cross-compilation))

ACKs for top commit:
  jonatack:
    ACK  5e7d1997fc
  Sjors:
    ACK 5e7d199
  hebasto:
    re-ACK 5e7d1997fc

Tree-SHA512: bbdff4f6ea1dfae03bca7fd30dfba543c4d130960075195e42695875382f13b93ea02128f80686fa4d1b5c3bd3703ac600f8ba07356ea0caf0fec09b7dbd081e
2021-04-29 18:56:49 +08:00
fanquake
cf971c9ea0
build: use -isysroot over --sysroot on macOS 2021-04-29 17:40:45 +08:00
fanquake
2cbb4ab7a9
Merge bitcoin/bitcoin#21658: build: fix make deploy for arm64-darwin
b353633bf4 build: mac_alias 2.2.0 (sgulls)

Pull request description:

  Fix make deploy for arm64-darwin

  Accidentally [closed](https://github.com/bitcoin/bitcoin/pull/21555) the PR

ACKs for top commit:
  promag:
    Tested ACK b353633bf4.

Tree-SHA512: 08043792d63894b6738ea93d076cecace1d8b30a623b944170a34492c3838269da87e09878164c760cf321663fb72641a7295070a847ad67d91fc9970ebe5c6a
2021-04-29 09:12:15 +08:00
Russell Yanofsky
5d62d7f6cd Update libmultiprocess library
Fix "Disable GCC suggest-override warnings for proxy clients" https://github.com/chaincodelabs/libmultiprocess/pull/40 is needed to prevent cirrus GCC failure https://cirrus-ci.com/task/6000489311502336?command=ci#L4294

This also includes other recent changes

https://github.com/chaincodelabs/libmultiprocess/pull/35 Fix README.md markdown
https://github.com/chaincodelabs/libmultiprocess/pull/37 Add "make check" target to build and run tests
https://github.com/chaincodelabs/libmultiprocess/pull/38 Add "extends" inherited method support
https://github.com/chaincodelabs/libmultiprocess/pull/41 Avoid depending on argument default constructors
https://github.com/chaincodelabs/libmultiprocess/pull/42 Support attaching custom cleanup functions to proxy client and server classes
https://github.com/chaincodelabs/libmultiprocess/pull/43 Drop hardcoded #include lines in generated files
2021-04-23 03:02:50 -05:00
Jarol Rodriguez
5e7d1997fc doc: note on SDK for macOS depends cross-compile 2021-04-22 16:14:06 -04:00
Hennadii Stepanov
08f3dbb1b0
test: Bump shellcheck version 2021-04-22 12:14:05 +03:00
fanquake
e16f8720dc
Merge #21655: build, qt: No longer need to set QT_RCC_TEST=1 for determinism
c799a19b4b build, qt: No longer need to set QT_RCC_TEST=1 for determinism (Hennadii Stepanov)

Pull request description:

  The Qt Resource Compiler (rcc) output order relies on [`QHash`](https://doc.qt.io/qt-5/qhash.html):
  > This randomization of `QHash` is enabled by default. Even though programs should never depend on a particular `QHash` ordering, there may be situations where you temporarily need deterministic behavior, for example for debugging or regression testing. To disable the randomization, define the environment variable `QT_HASH_SEED` to have the value 0.

  Since #3620 we use `QT_RCC_TEST=1` to achieve a deterministic output.

  Since Qt 5.3.1 hash seeding is disabled for all of the bootstrapped tools, including rcc. Therefore, `QT_RCC_TEST=1` is no longer needed.
  See commit [5283a6c87beac5a43f612786fefd6e43f2c70bf6](5283a6c87b).

ACKs for top commit:
  fanquake:
    ACK c799a19b4b

Tree-SHA512: 9d116ac1e8c605ee3e8ed7f618586f0de85d8b06bbbb70fe8c298939ce203d2a7e97264a9afac037179993ab54c5f69a65ebb9ab27ca7f45acb963011bd45743
2021-04-21 15:16:47 +08:00
Hennadii Stepanov
f959b75e8c
build: Add Qt lconvert tool to depends 2021-04-20 15:49:45 +03:00
fdov
36c10b9f4b
build,boost: update download url.
- bintray is closing.
    - updated to jfrog.io.
2021-04-12 20:11:11 +02:00
sgulls
b353633bf4 build: mac_alias 2.2.0
Fix make deploy for arm64-darwin
2021-04-11 16:38:33 -04:00
Hennadii Stepanov
c799a19b4b
build, qt: No longer need to set QT_RCC_TEST=1 for determinism
Since Qt 5.3.1 hash seeding is disabled for rcc.
See commit 5283a6c87beac5a43f612786fefd6e43f2c70bf6.
2021-04-11 17:29:15 +03:00
Hennadii Stepanov
223b1ba7d9
doc: Use CONFIG_SITE instead of --prefix 2021-04-09 12:25:18 +03:00
Carl Dong
fa872c9af3 depends: Fix id_string invocations
We now use a script named gen_id to generate the base build_id/host_id.
This solves 2 problems:

1. GNU Make special-casing exit code 127 (command not found) meant that
   warnings about missing tools would propagate to the user's terminal
   and broke our opportunistic build_id construction.
2. This change ensures that we don't have arbitrary characters in our
   make variables that would be misinterpreted by Make.

See comments in depends/Makefile and depends/gen_id for more
information.
2021-04-08 20:17:20 -04:00