Description
Describe the bug
Cabal uses a peculiar c program to check if LD supports and should use -x. To do this, it shells out to GHC to compiler the C file. This however requires that GHC will not bail out, yet cabal does not pass --package-db flags to this GHC invocation, and as such we can run into situations where GHC bails out, especially during GHC bootstrap phases where not all boot packages are available.
To Reproduce
Steps to reproduce the behavior:
Kill GHC's --package-db (including it's shipped one).
then try to build anything.
$ cabal build ...
Expected behavior
cabal doesn't bail out trying to configure ld, but ghc fails during the configuration step.
=> Cabal should use GCC not GHC to test C features.