haskell / hsc2hs

Pre-processor for .hsc files
http://hackage.haskell.org/package/hsc2hs
Other
38 stars 23 forks source link

hsc2hs shouldn't call cc directly #66

Open bgamari opened 2 years ago

bgamari commented 2 years ago

Currently hsc2hs calls cc directly when it needs to compile C. However, in general it doesn't have enough information about the build context to do so robustly, especially when GHC becomes runtime-retargetable (since the choice of which C compiler is used is going to depend upon the GHC profile). This is already starting to affect us as hsc2hs isn't benefitting from upstream GHC changes like https://gitlab.haskell.org/ghc/ghc/-/issues/20162.

I propose that hsc2hs should consistently rely on ghc to invoke the C compiler, centralizing build configuration in GHC.