Skip to content

Hadrian: Use gcc to compile C files directly where reasonable.

Motivation

Currently hadrian compiles C files by invoking GHC, which itself invokes gcc.

This is especially true for the RTS which many invocations of the sort: | Run Ghc CompileCWithGhc Stage1: rts/HsFFI.c => _quick/stage1/rts/build/c/HsFFI.debug_o

This works, but causes overhead when modifying GHC. Any minor change to GHC results in a change of the ghc binary.
This means we have to rebuild all of the RTS since one of it's dependencies has changed.

Proposal

I assume many (most?) of the C files in the RTS could be compiled by gcc (or clang) directly.

So we should compile those by invoking gcc directly which avoids rebuilding them when making changes to GHC.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information