Creating this to document a bug I discovered and have now fixed.
The issue is that we were passing in --ghc-options to Cabal, even when using ghcjs. Cabal will accept --ghc-options even when doing a build with ghcjs. Turns out we need to pass --ghcjs-options instead for them to actually get passed along to the compiler.