
On 20 April 2005 17:34, Thomas Schwinge wrote:
On Sun, Apr 10, 2005 at 10:39:08PM +0100, Simon Marlow wrote:
On 10 April 2005 14:20, Thomas Schwinge wrote:
Is someone aware of any efforts to port the GHC to GNU/Hurd? If not, I'd like to give that a try.
No, and good luck!
I should be able to get it going using .hc files from i386-linux. Correct? But where can I find these files or how can I create them myself? I was not (yet) able to find instructions about creating them in the "porting guide" and a web search also didn't reveal anything useful, yet.
Just follow the instructions in section 10.2 of the Building Guide: http://www.haskell.org/ghc/docs/latest/html/building/sec-porting-ghc.htm l#unregisterised-porting that tells you how to build the .hc files and bootstrap from them on the target machine. Cheers, Simon

On 10 April 2005 14:20, I wrote:
Is someone aware of any efforts to port the GHC to GNU/Hurd? If not, I'd like to give that a try.
I succeeded. :-) I did the bootstrap using a ghc-6-4-branch checkout, dated 20050422T204743Z. On Thu, Apr 21, 2005 at 10:44:18AM +0100, Simon Marlow wrote:
Just follow the instructions in section 10.2 of the Building Guide:
The rest of this email are my notes of the bootstrapping process and a few tiny patches. I was following URL:http://www.haskell.org/ghc/docs/latest/html/building/sec-porting-ghc.htm... and distrib/hc_build to get the first build done. I had to patch configure.ac using the attached configure.ac.patch and regenerate configure to make it recognize the system. Should HostOS_CPP perhaps be set to 'GNU/Hurd' (or similar) instead of 'gnu'? host system #v+ $ make hc-file-bundle Project=Ghc [...] echo ghc-6.4/ghc/compiler/main/ParsePkgConf.hs >> hc-files-to-go echo ghc-6.4/libraries/haskell-src/Language/Haskell/Parser.hs >> hc-files-to-go tar czf ghc-6.4-i386-unknown-gnu-hc.tar.gz `cat hc-files-to-go` tar: ghc-6.4/ghc/rts/AutoApply_thr_p.hc: Cannot stat: No such file or directory tar: ghc-6.4/ghc/rts/AutoApply_thr.hc: Cannot stat: No such file or directory tar: ghc-6.4/ghc/rts/AutoApply_debug.hc: Cannot stat: No such file or directory tar: ghc-6.4/libraries/haskell-src/Language/Haskell/Parser.hs: Cannot stat: No such file or directory tar: Error exit delayed from previous errors make: *** [hc-file-bundle] Error 2 #v- I continued with the incomplete tarball of .hc files and didn't have any problems related to that (AFAICT), apart from having to unpack happy-1.15/happy into the build tree, reconfigure and run 'make -C happy boot all' somewhen later (see below). target system #v+ $ make -C ghc boot [...] mkdir stage1/iface mkdir stage1/cmm Creating main/Config.hs ... done. Creating stage1/ghc_boot_platform.h... Done. g cmm/CmmLex.x make[1]: g: Command not found make[1]: [cmm/CmmLex.hs] Error 127 (ignored) RTS -K2m -RTS -agc cmm/CmmParse.y make[1]: RTS: Command not found make[1]: *** [cmm/CmmParse.hs] Error 127 make: *** [boot] Error 1 make: Leaving directory `/var/tmp/build/ghc/ghc-6.4-branch/ghc' #v- I set HAPPY and ALEX to /bin/true in mk/config.mk to work around that. #v+ $ make -C ghc all [...] gcc -o stage1/ghc-6.4 -fno-defer-pop -fomit-frame-pointer -DNO_REGS -DUSE_MINIINTERPRETER -DDONT_WANT_WIN32_DLL_SUPPORT -D__GLASGOW_HASKELL__=604 -O -I/var/tmp/build/ghc/ghc-6.4-branch/ghc/includes -I/var/tmp/build/ghc/ghc-6.4-branch/libraries/base/include -I/var/tmp/build/ghc/ghc-6.4-branch/libraries/unix/include -I/var/tmp/build/ghc/ghc-6.4-branch/libraries/parsec/include -fno-defer-pop -fomit-frame-pointer -DNO_REGS -DUSE_MINIINTERPRETER -DDONT_WANT_WIN32_DLL_SUPPORT -D__GLASGOW_HASKELL__=604 -Iparser -I. -O -D__GLASGOW_HASKELL__=604 -L/var/tmp/build/ghc/ghc-6.4-branch/ghc/rts -L/var/tmp/build/ghc/ghc-6.4-branch/libraries/base -L/var/tmp/build/ghc/ghc-6.4-branch/libraries/base/cbits -L/var/tmp/build/ghc/ghc-6.4-branch/libraries/haskell98 -u "GHCziBase_Izh_static_info" [...] stage1/utils/OrdList.o stage1/utils/Outputable.o stage1/utils/Panic.o stage1/utils/Pretty.o stage1/utils/PrimPacked.o stage1/utils/StringBuffer.o stage1/utils/UnicodeUtil.o stage1/utils/UniqFM.o stage1/utils/UniqSet.o stage1/utils/Util.o stage1/parser/hschooks.o -lHSCabal -lHShaskell98 -lHSbase -lHSbase_cbits -lHSparsec -lHSrts -lgmp -lm -ldl /bin/ld: cannot find -lHSCabal collect2: ld returned 1 exit status make[1]: *** [stage1/ghc-6.4] Error 1 make: *** [all] Error 1 #v- I created the attached mk_bootstrap.mk_HC_BOOT_LIBS.patch to work around that. #v+ $ make -C ghc all [...] gcc -O -I/var/tmp/build/ghc/ghc-6.4-branch/ghc/includes -I/var/tmp/build/ghc/ghc-6.4-branch/libraries/base/include -I/var/tmp/build/ghc/ghc-6.4-branch/libraries/unix/include -I/var/tmp/build/ghc/ghc-6.4-branch/libraries/parsec/include -fno-defer-pop -fomit-frame-pointer -DNO_REGS -DUSE_MINIINTERPRETER -DDONT_WANT_WIN32_DLL_SUPPORT -D__GLASGOW_HASKELL__=604 -c cbits/directory.c -o cbits/directory.o cbits/directory.c:11:23: directory.h: No such file or directory make[2]: *** [cbits/directory.o] Error 1 make[1]: *** [all] Error 1 make: *** [all] Error 1 make: Leaving directory `/var/tmp/build/ghc/ghc-6.4-branch/ghc' #v- I created the attached ghc_lib_compat_Makefile_SRC_CC_OPTS.patch to work around that. #v+ $ HappyCmd=`pwd`/distrib/fake-happy ./configure --with-ghc=`pwd`/ghc/compiler/ghc-inplace [...] checking for ghc-pkg... no checking for happy... /var/tmp/build/ghc/ghc-6.4-branch/distrib/fake-happy checking for version of happy... 1.10 checking for haddock... no checking for alex... no checking for version of alex... grep: ./alex/mk/version.mk: No such file or directory configure: error: Alex version 2.0 or later is required to compile GHC. #v- I put alex-2.0.1/alex and happy-1.15/happy into my build tree and reconfigured without having HappyCmd set. #v+ $ make -C libraries boot [...] ../../ghc/utils/hsc2hs/hsc2hs-inplace -Iinclude -I. Network/BSD.hsc BSD.hsc: In function `main': BSD.hsc:558: error: `PATH_MAX' undeclared (first use in this function) BSD.hsc:558: error: (Each undeclared identifier is reported only once BSD.hsc:558: error: for each function it appears in.) make: *** [Network/BSD.hs] Error 1 make: Leaving directory `/var/tmp/build/ghc/ghc-6.4-branch/libraries' #v- ... which is correct as the Hurd does not limit the length of paths and thus doesn't have PATH_MAX defined. Someone writing GHC code also was aware of that, see ghc/lib/compat/cbits/directory.c and libraries/base/include/HsBase.h. The correct solution, however, is not to hard-limit PATH_MAX to 4096 in that case, but decide / allocate arrays / etc. dynamically where needed. Unfortunately I'm not able to fix that as I don't know any Haskell, yet. I created the attached libraries_network_Network_BSD.hsc.patch to work around that. The same applies to the attached libraries_unix_System_Posix_Files.hsc.patch. Creating the attached ghc_driver_mangler_ghc-asm.lprl.patch, I made the mangler work (I think, at least). I rebuilt GHC from clean sources and used that new version to build darcs URL:http://darcs.net/--it's working perfectly. Regards, Thomas
participants (2)
-
Simon Marlow
-
Thomas Schwinge