How do you build base with your own compiler?
chrisdone at gmail.com
Thu Jun 28 17:08:41 UTC 2018
I've built the GHC compiler along with libraries/base in the canonical way.
Now, I want to compile base with my own compiler frontend which will
do some analysis. Here's what I've done so far:
1) I've compiled my frontend with the ghc-stage2 compiler and
registered it. That works.
2) I've found the right GHC invocation which looks like this:
"inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -O0
-H64m -Wall -this-unit-id base-126.96.36.199 -hide-all-packages -i
-package-id ghc-prim-0.5.0.0 -package-id integer-gmp-188.8.131.52
-package-id rts -this-unit-id base -XHaskell2010 -O0
-no-user-package-db -rtsopts -Wno-trustworthy-safe
-Wno-deprecated-flags -Wnoncanonical-monad-instances -odir
libraries/base/dist-install/build -dynamic-too $hsfile
(1) changed stage1 to stage2, so that I could use plugins,
(2) simply added --frontend GhcFrontendPlugin -package frontend and
ran that on every file under base/ in a loop:
That seems to work. I basically have what I wanted.
But I'd rather be able to invoke make with e.g.
GHC_COMPILER=inplace/ghc/stage2 and EXTRA_HC_OPTS=" --frontend
GhcFrontendPlugin -package frontend". Is there an easy flag to do
If not, can someone point me where in the makefile I could tweak this?
More information about the ghc-devs