From 4c07cf87e2288d4a8b0174ad64e52f455de9029e Mon Sep 17 00:00:00 2001 From: will Date: Wed, 11 Mar 2026 11:55:48 +0000 Subject: [PATCH] doc: document depends compiler configuration CC/CXX only override compilers for target (host) packages. Native build tool packages (native_capnp, native_qt, etc.) use separate build_CC/build_CXX variables, which default to gcc/g++ on Linux. On systems without gcc (e.g. Nix, Chimera Linux), native package builds fail unless build_CC/build_CXX are also set explicitly. Document how to override both sets of compilers. --- depends/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/depends/README.md b/depends/README.md index 706c3db0d95..b12df1354e5 100644 --- a/depends/README.md +++ b/depends/README.md @@ -108,6 +108,18 @@ The following can be set when running make: `make FOO=bar` If some packages are not built, for example `make NO_WALLET=1`, the appropriate CMake cache variables will be set when generating the Bitcoin Core buildsystem. In this case, `-DENABLE_WALLET=OFF`. +## Compiler Configuration + +`CC` and `CXX` control target compilers. `build_CC` and `build_CXX` control +compilers for native build tools (e.g. `native_capnp`, `native_qt`), which +default to `gcc`/`g++` on Linux and `clang`/`clang++` on macOS/FreeBSD/OpenBSD +(see `./depends/builders/*.mk`). + +On a system where the default build compiler is not available (e.g. Linux +without gcc/g++), you could use the following to build all packages using clang: + + make -C depends build_CC=clang build_CXX=clang++ CC=clang CXX=clang++ + ## Cross compilation To build for another arch/OS: