aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorChristoph Müllner <christoph.muellner@vrull.eu>2024-02-06 10:21:22 +0100
committerChristoph Müllner <christophm30@gmail.com>2024-02-29 08:33:56 +0100
commit19464804adf3a8ec03de55a29de984e053f6cb3a (patch)
treec5f8dc59d25472e31052928701ac57b039cc1710 /README.md
parentaac79d6ff2a89922e1bf6260444ae8839729304f (diff)
downloadriscv-gnu-toolchain-19464804adf3a8ec03de55a29de984e053f6cb3a.zip
riscv-gnu-toolchain-19464804adf3a8ec03de55a29de984e053f6cb3a.tar.gz
riscv-gnu-toolchain-19464804adf3a8ec03de55a29de984e053f6cb3a.tar.bz2
Add support to build a host GCC for building the toolchain
A significant amount of users of this project are using it for toolchain development. These users need to ensure that their code is warning free before submitting it upstream. Let's support this use case by adding a configure flag '--enable-host-gcc', which does exactly that: * build a host GCC before building other components * setting PATH such that this new GCC is used to build the cross toolchain * enable -Werror for the GCC build This patch was tested on a Fedora 39 machine (GCC 13), with the following modification in a GCC source file: #if __GNUC__ == 13 #error Host compiler in use! #endif This fails when building without the new flag and does not fail when building with latest upstream/master (GCC 14 prerelease). The '--enable-werror-always' was tested with a warning that showed up recently in upstream GCC. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7aab3c1..c306338 100644
--- a/README.md
+++ b/README.md
@@ -447,3 +447,13 @@ Here is the list of configure option for specify source tree:
--with-pk-src
--with-qemu-src
--with-spike-src
+
+#### Build host GCC to check for compiler warnings
+
+GCC contributions have to meet several requirements to qualify for upstream
+inclusion. Warning free compilation with a compiler build from the same
+sources is among them. The flag `--enable-host-gcc` does exaclty that:
+
+* Initially a host GCC will be built
+* This host GCC is then used to build the cross compiler
+* The cross compiler will be built with `-Werror` to identify code issues