From 24e3388cf3bb50c1d4b762aed63b63de036ffd96 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Tue, 19 Aug 2025 16:56:25 +0100 Subject: [PATCH] Clarify use of CC and friends for file generation Add more detail around how generation of configuration-independent files chooses a C compiler. Mention that setting HOSTCC or CC is recommended where there are multiple toolchains. Mention that the fallback location is the cc executable, which may help users troubleshooting when the file generation picks up the wrong toolchain (as in Mbed-TLS/mbedtls#10360). Signed-off-by: David Horstmann --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fc1536e23c..7981a0236d 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,13 @@ The following tools are required: Depending on your Python installation, you may need to invoke `python` instead of `python3`. To install the packages system-wide, omit the `--user` option. * A C compiler for the host platform, for some test data. -If you are cross-compiling, you must set the `CC` environment variable to a C compiler for the host platform when generating the configuration-independent files. +The scripts that generate the configuration-independent files will look for a host C compiler in the following places (in order of preference): + +1. The `HOSTCC` environment variable. This can be used if `CC` is pointing to a cross-compiler. +2. The `CC` environment variable. +3. An executable called `cc` in the current path. + +Note: If you have multiple toolchains installed, it is recommended to set `CC` or `HOSTCC` to the intended host compiler before generating the files. Any of the following methods are available to generate the configuration-independent files: