hsc2hs's C compiler invocations are problematic
Currently hsc2hs
invokes ld
and cc
itself, allowing the commands and arguments to be specified via its --cc
, --cflag
, --ld
, and --ldflag
options. This design is problematic since it introduces the possibility for inconsistency between the toolchain used by hsc2hs
and that used by GHC itself. This has already bitten us in the case of Darwin (see !6236 (closed)) and will certainly bite us further once we have #19877 (closed).
Frankly, I don't see why hsc2hs
should be calling cc
at all; it seems like it would be generally easier if it rather simply used GHC to drive compilation and linking, giving us a single point of configuration.