Support C compilation with an empty package db
Summary
Currently GHC doesn't support compiling C code with an empty package db. That's because it looks up the ghcversion.h
file in the RTS package and raises an error if there is none. We should support this. It is particularly useful to bootstrap the RTS.
Steps to reproduce
> touch foo.c
> ghc -c foo.c -clear-package-db
ghc-9.12.2: ghcversion.h missing; tried:
Expected behavior
It should just work.
Environment
- GHC versions used: 8.4 to 9.12 at least