
Dear all, I am working on porting GHC to [native client]( https://developer.chrome.com/native-client), which has some degree of POSIX-compliance. I was thinking about building just the minimal/most essential parts of GHC that is enough to compile simple Haskell programs. I wanted to ask which parts of GHC are the most essential and sufficient enough to compile a simple Haskell program, for instance to compile `main = putStrLn "Hello, world!"`? I also wanted to ask how to force a GHC build without a particular package that comes by default, for instance how to build GHC without the `unix` package? Best wishes, Jakub

Hi Jakub -
You will find that many of these questions are things we’ve had to address in the HaLVM (http://github.com/GaloisInc/HaLVM http://github.com/GaloisInc/HaLVM). You may want to look in that code base for information on what we considered minimal and how we got around some of the build system and other issues a minimal build requires.
- Adam
On Jul 2, 2015, at 1:20 PM, Jakub Zalewski
Dear all, I am working on porting GHC to [native client](https://developer.chrome.com/native-client https://developer.chrome.com/native-client), which has some degree of POSIX-compliance.
I was thinking about building just the minimal/most essential parts of GHC that is enough to compile simple Haskell programs.
I wanted to ask which parts of GHC are the most essential and sufficient enough to compile a simple Haskell program, for instance to compile `main = putStrLn "Hello, world!"`?
I also wanted to ask how to force a GHC build without a particular package that comes by default, for instance how to build GHC without the `unix` package?
Best wishes, Jakub _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Hi Adam,
thank you for your reply; I've looked into HaLVM code and it is really
helpful.
After disabling some incompatible packages (in a similar fashion to HaLVM)
from ghc.mk I got to an issue that configure for ghc stage2 requires those
packages.
How did you solve that problem in HaLVM? Is it solved by calling parts of
the ghc build system from within the top Makefile in the HaLVM repository?
Best wishes,
Jakub
On Fri, Jul 3, 2015 at 12:07 AM Adam Wick
Hi Jakub -
You will find that many of these questions are things we’ve had to address in the HaLVM (http://github.com/GaloisInc/HaLVM). You may want to look in that code base for information on what we considered minimal and how we got around some of the build system and other issues a minimal build requires.
- Adam
On Jul 2, 2015, at 1:20 PM, Jakub Zalewski
wrote: Dear all, I am working on porting GHC to [native client]( https://developer.chrome.com/native-client), which has some degree of POSIX-compliance.
I was thinking about building just the minimal/most essential parts of GHC that is enough to compile simple Haskell programs.
I wanted to ask which parts of GHC are the most essential and sufficient enough to compile a simple Haskell program, for instance to compile `main = putStrLn "Hello, world!"`?
I also wanted to ask how to force a GHC build without a particular package that comes by default, for instance how to build GHC without the `unix` package?
Best wishes, Jakub
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Well, for the HaLVM (and maybe native client), a stage2 compiler doesn’t really make sense. So the HaLVM’s compiler is simply a stage1 compiler, somewhat extended. We do some tricks via the top level Makefile, yes, but it’s mostly a standard build for a different target, stopped at the end of the stage1 process. - Adam
On Jul 7, 2015, at 7:06 AM, Jakub Zalewski
wrote: Hi Adam, thank you for your reply; I've looked into HaLVM code and it is really helpful.
After disabling some incompatible packages (in a similar fashion to HaLVM) from ghc.mk http://ghc.mk/ I got to an issue that configure for ghc stage2 requires those packages.
How did you solve that problem in HaLVM? Is it solved by calling parts of the ghc build system from within the top Makefile in the HaLVM repository?
Best wishes, Jakub
On Fri, Jul 3, 2015 at 12:07 AM Adam Wick
mailto:awick@galois.com> wrote: Hi Jakub - You will find that many of these questions are things we’ve had to address in the HaLVM (http://github.com/GaloisInc/HaLVM http://github.com/GaloisInc/HaLVM). You may want to look in that code base for information on what we considered minimal and how we got around some of the build system and other issues a minimal build requires.
- Adam
On Jul 2, 2015, at 1:20 PM, Jakub Zalewski
mailto:jakzale@gmail.com> wrote: Dear all, I am working on porting GHC to [native client](https://developer.chrome.com/native-client https://developer.chrome.com/native-client), which has some degree of POSIX-compliance.
I was thinking about building just the minimal/most essential parts of GHC that is enough to compile simple Haskell programs.
I wanted to ask which parts of GHC are the most essential and sufficient enough to compile a simple Haskell program, for instance to compile `main = putStrLn "Hello, world!"`?
I also wanted to ask how to force a GHC build without a particular package that comes by default, for instance how to build GHC without the `unix` package?
Best wishes, Jakub
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org mailto:ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (2)
-
Adam Wick
-
Jakub Zalewski