Commit Graph

549 Commits

Author SHA1 Message Date
merge-script
fe5e2a6319 Merge bitcoin/bitcoin#32162: depends: Switch from multilib to platform-specific toolchains
de9b436ba3 depends: Switch from multilib to platform-specific toolchains (Hennadii Stepanov)

Pull request description:

  Using the multilib GCC toolchain, as currently documented in [`depends/README.md`](4c1906a500/depends/README.md), has several issues, such as:

  1. The [`g++-multilib`](https://packages.ubuntu.com/noble/g++-multilib) package conflicts with platform-specific cross-compiler packages. This means it is not possible to cross compile for `i686` and other platforms using the same set of installed packages.

  2. The [`g++-multilib`](https://packages.ubuntu.com/noble/g++-multilib) package is not available for `arm64`:
  ```sh
  $ sudo apt install g++-multilib
  Reading package lists... Done
  Building dependency tree... Done
  Reading state information... Done
  E: Unable to locate package g++-multilib
  ```

  3. Managing the multilib GCC toolchain requires additional code in both depends and Guix scripts.

  This PR addresses all the issues mentioned above by switching from multilib to platform-specific toolchains.

  Also see https://github.com/bitcoin/bitcoin/pull/22456.

  ---

  Here are examples of building for different scenarions:

  - Linux, `x86_64` or `arm64`, building with depends natively:
  ```sh
  $ gmake -C depends -j $(nproc)
  $ cmake -B build --toolchain depends/$(./depends/config.sub $(./depends/config.guess))/toolchain.cmake
  $ cmake --build build -j $(nproc)
  ```

  - Linux, `x86_64` or `arm64`, cross compiling for `i686-pc-linux-gnu`:
  ```sh
  $ sudo apt install g++-i686-linux-gnu binutils-i686-linux-gnu
  $ export HOST=i686-linux-gnu
  $ gmake -C depends -j $(nproc)
  $ cmake -B build-${HOST} --toolchain depends/${HOST}/toolchain.cmake
  $ cmake --build build-${HOST} -j $(nproc)
  ```

  - Linux, `x86_64`, cross compiling for `arm64`:
  ```sh
  $ sudo apt install g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
  $ export HOST=aarch64-linux-gnu
  $ gmake -C depends -j $(nproc)
  $ cmake -B build-${HOST} --toolchain depends/${HOST}/toolchain.cmake
  $ cmake --build build-${HOST} -j $(nproc)
  ```

  - Linux, `arm64`, cross compiling for `x86_64`:
  ```sh
  $ sudo apt install g++-x86-64-linux-gnu binutils-x86-64-linux-gnu
  $ export HOST=x86_64-linux-gnu
  $ gmake -C depends -j $(nproc)
  $ cmake -B build-${HOST} --toolchain depends/${HOST}/toolchain.cmake
  $ cmake --build build-${HOST} -j $(nproc)
  ```

ACKs for top commit:
  fanquake:
    ACK de9b436ba3
  BrandonOdiwuor:
    ACK de9b436ba3

Tree-SHA512: 453b4744974cdf56d6edfdbe93bb11e3bae3f9bc9cd99b9c57aee74e65fcdd3ac011a1dcc19f485ea3be427f4e9c6c6b0d704881369f719620f0cb299123e561
2026-08-19 14:19:47 +01:00
fanquake
5548818115 guix: build glibc with --enable-kernel=3.17.0 2026-08-17 12:29:15 +01:00
fanquake
b75eb938a0 guix: move python-minimal to GUI build 2026-08-03 14:47:39 +01:00
fanquake
101400b28f guix: remove -Werror=dev
Otherwise the build will fail with warnings about missing Python (removed
in the next commit). However the non-gui build does not need Python.

Note that #25573 contains the same change, because the use of -static-pie
causes warnings when combined with our/CMakes own PIE handling.
2026-08-03 13:32:07 +01:00
fanquake
594a02c3ae lint: re-add guix scripts to mypy linting
These were no-longer being linted after #32458.

suppress `[union-attr]` warning. i.e:
```bash
contrib/guix/symbol-check.py:309: error: Item "None" of "lief.PE.Binary | lief.ELF.Binary | lief.MachO.Binary | lief.COFF.Binary | None" has no attribute "format"  [union-attr]
contrib/guix/security-check.py:284: error: Item "lief.COFF.Binary" of "lief.PE.Binary | lief.ELF.Binary | lief.MachO.Binary | lief.COFF.Binary | None" has no attribute "abstract"  [union-attr]
```
2026-08-03 11:52:14 +01:00
fanquake
683ae4c520 guix: consolidate config flags 2026-07-29 11:16:58 +01:00
fanquake
665f11d04a guix: consolidate gcc toolchain setup 2026-07-29 11:16:58 +01:00
fanquake
288f76ed0f guix: consolidate mingw-w64 toolchain setup 2026-07-29 11:16:58 +01:00
fanquake
cc9b0f2266 guix: consolidate LLVM toolchain setup 2026-07-29 11:16:58 +01:00
fanquake
b12a70f330 guix: turn linux/win linker warnings into errors
Can do this now that the GUI has been split out.

riscv64-linux-gnu failus due to
https://github.com/boostorg/test/issues/345:
```bash
[102%] Linking CXX executable ../../bin/test_bitcoin
/gnu/store/r03804zpq5i6wsalx0yaqrr5jb7pqrmv-binutils-cross-riscv64-linux-gnu-2.46.0/bin/riscv64-linux-gnu-ld: CMakeFiles/test_bitcoin.dir/main.cpp.o: in function `boost::fpe::disable(unsigned int)':
/bitcoin/depends/riscv64-linux-gnu/boost/include/boost/test/impl/execution_monitor.ipp:1538:(.text+0x9dc8): warning: fedisableexcept is not implemented and will always fail
/gnu/store/r03804zpq5i6wsalx0yaqrr5jb7pqrmv-binutils-cross-riscv64-linux-gnu-2.46.0/bin/riscv64-linux-gnu-ld: CMakeFiles/test_bitcoin.dir/main.cpp.o: in function `boost::fpe::enable(unsigned int)':
/bitcoin/depends/riscv64-linux-gnu/boost/include/boost/test/impl/execution_monitor.ipp:1502:(.text+0x9d76): warning: feenableexcept is not implemented and will always fail
collect2: error: ld returned 1 exit status
```

Darwin could be done after something like
https://github.com/bitcoin/bitcoin/pull/35756.
2026-07-29 11:16:58 +01:00
merge-script
a2aab6df97 Merge bitcoin/bitcoin#35810: guix: Drop unused (guix licenses) import from manifest_build.scm
a92e93429e guix: Drop unused `(guix licenses)` import from `manifest_build.scm` (Hennadii Stepanov)

Pull request description:

  This was overlooked in bitcoin/bitcoin#34948.

ACKs for top commit:
  fanquake:
    ACK a92e93429e

Tree-SHA512: ab1ff63b49da104b21c4731ea06d3a4db009712be7c50f907cd46d0ad2936f7a236915bbe436801f02ea32bd781dfb5f38d349dda0a99a563701bef1089f35a6
2026-07-27 12:00:49 +01:00
Hennadii Stepanov
a92e93429e guix: Drop unused (guix licenses) import from manifest_build.scm
This was overlooked in bitcoin/bitcoin#34948.
2026-07-26 15:42:53 +01:00
fanquake
baa5a2ce43 guix: pass --disable-tm-clone-registry to base GCC
We don't need support for transactional memory.

> Disable TM clone registry in libgcc. It is enabled in libgcc by default.
> This option helps to reduce code size for embedded targets which do
> not use transactional memory.

https://gcc.gnu.org/install/configure.html
2026-07-24 10:26:22 +01:00
fanquake
9c2589630f guix: mirror some arguments from linux-gcc to mingw-w64-gcc 2026-07-24 10:26:22 +01:00
fanquake
e0b8fbde89 guix: disable-nls in *-base-gcc 2026-07-24 10:26:22 +01:00
fanquake
7dc87f8e1e guix: disable-lto in *-base-gcc 2026-07-24 10:26:22 +01:00
fanquake
9ed3d6ef2a guix: modernise style in *-base-gcc 2026-07-24 10:26:21 +01:00
merge-script
290cb2f17e Merge bitcoin/bitcoin#35775: scripted-diff: Use C.UTF-8 locale in Guix scripts
2cb3bfa8df scripted-diff: Use long form of shell options in Guix scripts (Hennadii Stepanov)
711eb10f08 guix: Add copyright headers to Guix scripts (Hennadii Stepanov)
80f831494e guix: Fix `glibc` version in comment (Hennadii Stepanov)
8916f7967e scripted-diff: Use C.UTF-8 locale in Guix scripts (Hennadii Stepanov)

Pull request description:

  The C.UTF-8 locale is set by default in `guix shell`, and there is no reason to avoid it nowadays. This PR also silences superfluous warnings from Qt tools, making build logs cleaner and other issues easier to spot. For example:
  ```
  Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
  Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
  If this causes problems, reconfigure your locale. See the locale(1) manual
  for more information.
  ```

  Locales in the `guix-*` launch scripts have been updated as well for consistency with the rest of the codebase.

  Additionally, the headers of the Guix scripts have been adjusted for [uniformity](https://github.com/bitcoin/bitcoin/pull/35775#discussion_r3636959268).

ACKs for top commit:
  fanquake:
    ACK 2cb3bfa8df

Tree-SHA512: 9e21d4ad50f5d583efdd8f79d9f96d45a92f1982ea3a422565bceea38aa50bbd9a9360972b37a1b49907e67523d68f3d1f889cb26179ce735453eb4fae4d3fa4
2026-07-23 14:33:55 +01:00
Hennadii Stepanov
2cb3bfa8df scripted-diff: Use long form of shell options in Guix scripts
This improves readability and consistency across all Guix scripts.

-BEGIN VERIFY SCRIPT-

sed -i "s/^set -e\>/set -o errexit/g" \
 $( git grep -l "set -e" ./contrib/guix )

-END VERIFY SCRIPT-
2026-07-23 12:31:31 +01:00
Hennadii Stepanov
711eb10f08 guix: Add copyright headers to Guix scripts 2026-07-23 11:13:22 +01:00
Hennadii Stepanov
8a90c7cd97 guix: Build for macOS using LLVM toolchain only 2026-07-22 20:20:10 +01:00
Hennadii Stepanov
80f831494e guix: Fix glibc version in comment
At the current time-machine commit
c5eee3336cc1d10a3cc1c97fde2809c3451624d3, the default `glibc` package
version is 2.41.
2026-07-22 15:29:26 +01:00
Hennadii Stepanov
8916f7967e scripted-diff: Use C.UTF-8 locale in Guix scripts
The C.UTF-8 locale is set by default in `guix shell`, and there is no
reason to avoid it nowadays. This change also silences superfluous
warnings from Qt tools, making build logs cleaner and other issues
easier to spot.

Locales in the `guix-*` launch scripts have been updated as well for
consistency with the rest of the codebase.

-BEGIN VERIFY SCRIPT-

sed -i "s/\<export LC_ALL=C\>/export LC_ALL=C.UTF-8/g" \
 $( git grep -l "export LC_ALL=C" ./contrib/guix/* )

-END VERIFY SCRIPT-
2026-07-22 15:29:18 +01:00
Hennadii Stepanov
7e1a750d45 guix, refactor: Use target variable instead of hardcoded value 2026-07-21 13:52:46 +01:00
Hennadii Stepanov
de9b436ba3 depends: Switch from multilib to platform-specific toolchains 2026-07-21 13:33:24 +01:00
fanquake
0b0785daa0 guix: split macOS and win builds
Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
2026-07-20 09:28:35 +01:00
fanquake
008a3e29c8 guix: split builds into Linux(gui) and macOS/Windows 2026-07-20 09:28:29 +01:00
Hennadii Stepanov
059edf1908 guix: Fix "Ignoring empty string" CMake warning for non-Linux hosts
Using shell parameter expansion ensures that on non-Linux hosts the
build script won't pass an empty string argument to CMake. This resolves
the "Ignoring empty string" warning.
2026-06-15 15:38:07 +01:00
Hennadii Stepanov
2d86083fd4 guix: Drop redundant CMake --verbose options
CMake's verbose output is already controlled by the `VERBOSE`
environment variable, which has been exported since commit 85f4a4b082.
2026-06-15 15:38:01 +01:00
fanquake
9bfdde74b5 guix: add package.sh
Split out packaging code, so that it can be re-used by
build scripts.
2026-06-12 12:03:55 +02:00
fanquake
54de023a7c guix: add setup.sh
Split out setup & tarball creation code, so that it can be re-used by
build scripts.
2026-06-04 10:09:19 +01:00
Hennadii Stepanov
53388773af guix: Remove redundant ShellCheck source directives 2026-05-28 12:26:48 +01:00
Hennadii Stepanov
62cf7bc53f guix, refactor: Add BASE argument to *_for_host functions 2026-05-28 12:21:37 +01:00
Hennadii Stepanov
5d46429e32 guix, refactor: Move distsrc_for_host() to prelude.bash
The `distsrc_for_host()` function now accepts a second optional
argument, `SUFFIX`, making it consistent with other similar functions.
2026-05-28 12:17:55 +01:00
Hennadii Stepanov
cab65ea9c6 guix, refactor: Move duplicated profiledir_for_host() to prelude.bash 2026-05-28 12:17:19 +01:00
Hennadii Stepanov
faa9d4345f guix, refactor: Move duplicated outdir_for_host() to prelude.bash 2026-05-28 12:16:23 +01:00
Hennadii Stepanov
6b59fd6b8c guix, refactor: Remove contains() function 2026-05-28 12:13:46 +01:00
Hennadii Stepanov
d4c69a7224 guix, refactor: Remove unused out_name() function 2026-05-28 12:12:47 +01:00
Hennadii Stepanov
d846444d01 guix: Split manifest into build and codesign manifests 2026-05-26 20:53:20 +01:00
Hennadii Stepanov
0b9e10ad40 guix: Update python-signapple and wrap with OpenSSL paths 2026-05-26 20:40:58 +01:00
fanquake
19e99be011 guix: remove riscv exclusion from symbol check 2026-04-06 15:29:49 +08:00
fanquake
47b7a9f666 guix: binutils 2.46.0 2026-04-06 15:29:45 +08:00
Hennadii Stepanov
325f743eed guix: Clean up module list in manifest
These modules are no longer in use:
1. `cmake-build-system` since bitcoin/bitcoin#34550.
2. `gnu-build-system` since bitcoin/bitcoin#34627.
3. `download` since bitcoin/bitcoin#34550.
4. `cc-for-target` from `utils` since bitcoin/bitcoin#34627.
2026-03-30 11:29:43 +01:00
Ava Chow
93e8bcc077 Merge bitcoin/bitcoin#32442: doc: guix: Troubleshooting zdiff3 issue and uninstalling.
e76e886581 guix: doc: zdiff3 doesn't work (David Gumberg)
ea1be38677 guix: doc: Suggest guix-install.sh --uninstall (David Gumberg)

Pull request description:

  Add a note about guix issues with git `merge.conflictstyle` being set to `zdiff3`, and add information about how to uninstall for users of `guix-install.sh`

ACKs for top commit:
  achow101:
    ACK e76e886581
  hebasto:
    ACK e76e886581.
  sedited:
    utACK e76e886581

Tree-SHA512: e9edc49851579c52e7ac762221d0bb51c928da4dff5566ece766af7f7eb75466831a76f885ccc5a26207c84b846e3f42bae26e80ddece3df1611de2c2320c28a
2026-03-19 16:32:53 -07:00
fanquake
3293e9a61f guix: document when GCC SSA gen patch can be removed 2026-03-17 22:47:15 +08:00
fanquake
978023fd9e guix: use latest glibc 2.31
https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/release/2.31/master.
2026-03-17 22:47:15 +08:00
fanquake
ab9a98b1e4 guix: combine gcc-libgcc-patches with base-gcc 2026-03-17 22:47:15 +08:00
fanquake
2276426bb1 guix: switch to upstream python-oscrypto package 2026-03-17 22:47:14 +08:00
fanquake
feea2a850e ci: use LIEF 0.17.5 in lint job 2026-03-17 22:47:14 +08:00
fanquake
a7524f57ba guix: switch to upstream python-lief package 2026-03-17 22:47:14 +08:00