Before the errors I have a warning:
Warning: -rtsopts and -with-rtsopts have no effect with -no-hs-main.
Call hs_init_ghc() from your main() function to set these options.
The only change I made is fixing some simple type errors in utils/ghc-cabal/Main.hs that stopped compilation.