Problem building on NetBSD Alpha - Dynamic link dependency?

I'm trying to build unregistered 6.8.2 on NetBSD Alpha 2.1.0_STABLE -- I have the following problem which seems to be same as this one - http://hackage.haskell.org/trac/ghc/ticket/1860 $ ./configure --enable-hc-boot --enable-hc-boot-unregistered checking build system type... alpha-unknown-netbsd2.1.0. checking host system type... alpha-unknown-netbsd2.1.0. checking target system type... alpha-unknown-netbsd2.1.0. Canonicalised to: alpha-unknown-netbsd checking for ghc... no checking for ghc-pkg matching ... no checking for ghc-pkg... no checking whether ghc has readline package... no checking for nhc... no checking for nhc98... no checking for hbc... no checking for ld... /usr/bin/ld checking for path to top of build tree... ./configure[3201]: -v0: not found ./configure[3203]: utils/pwd/pwd: not found configure: error: cannot determine current directory there is a temporary solution mentioned in Trac; "to link the binaries generated by the bootstrap compiler statically". How do I make my own statically linked versions of pwd, ghc-pkg and anything else involved? (I don't know anything about C.) Thanks, Jim

On Wed, Jan 09, 2008 at 07:42:21PM +0000, jim burton wrote:
I'm trying to build unregistered 6.8.2 on NetBSD Alpha 2.1.0_STABLE -- I have the following problem which seems to be same as this one - http://hackage.haskell.org/trac/ghc/ticket/1860
No, I think it's another problem.
$ ./configure --enable-hc-boot --enable-hc-boot-unregistered [...] checking for ld... /usr/bin/ld checking for path to top of build tree... ./configure[3201]: -v0: not found ./configure[3203]: utils/pwd/pwd: not found configure: error: cannot determine current directory
What happens here is that configure tries to compile some utility program (utils/pwd/pwd) using an existing ghc, which of course is impossible when you're porting ghc a platform not already running ghc. Similar problems are located in libraries and the Cabal-generated GNUmakefiles. For the utils/pwd/pwd problem, I really don't understand why that thing is required at all, since it does little more than get the pwd and add some slash or backslash escaping/quadrupling depending on the argument passed to it. You may try the patch below (and don't forget to re-run autoconf). Note that this is the quick hack I did for OpenBSD. If the forward slash hack of util/pwd is really required (for Windows builds?), something like hardtop=`pwd | tr '\\' /` would be more appropriate. And the other sanity checks I deleted may be necessary in some cases, too, but I really don't see the point in them. Ciao, Kili ps: IMHO, libaries/ifBuildable.hs should die a horrible death, too. It can replaced with a few lines of shell commands.. --- aclocal.m4.orig Mon Dec 10 19:11:31 2007 +++ aclocal.m4 Fri Jan 4 13:58:49 2008 @@ -1098,28 +1098,7 @@ AC_REQUIRE([AC_PROG_CC]) AC_DEFUN([FP_FIND_ROOT],[ AC_MSG_CHECKING(for path to top of build tree) -dnl This would be -dnl make -C utils/pwd clean && make -C utils/pwd -dnl except we don't want to have to know what make is called. Sigh. -if test ! -f utils/pwd/pwd && test ! -f utils/pwd/pwd.exe; then - cd utils/pwd - rm -f *.o - rm -f *.hi - rm -f pwd - rm -f pwd.exe - $WithGhc -v0 --make pwd -o pwd - cd ../.. -fi - -hardtop=`utils/pwd/pwd forwardslash` - -if ! test -d "$hardtop"; then - AC_MSG_ERROR([cannot determine current directory]) -fi - -dnl Remove common automounter nonsense -dnl -hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|'` +hardtop=`pwd` AC_SUBST(hardtop)

Thanks for that, the configure script gets to the end with that help. Following the instructions at http://hackage.haskell.org/trac/ghc/wiki/Building/Porting#PortingGHCtoanewpl... , I then try to make includes but get a big stream of errors from make. Why is this? $ cd includes $ make make: "/arpa/j/jim/ghc-6.8.2/includes/../mk/boilerplate.mk" line 38: Need an operator make: "/arpa/j/jim/ghc-6.8.2/includes/../mk/boilerplate.mk" line 41: Need an operator [...] make: "../mk/../mk/../mk/recurse.mk" line 90: Need an operator make: "../mk/../mk/../mk/recurse.mk" line 91: Need an operator make: "../mk/../mk/../mk/recurse.mk" line 97: Need an operator make: "../mk/../mk/../mk/recurse.mk" line 100: Need an operator make: Fatal errors encountered -- cannot continue Thanks, On Wed, 2008-01-09 at 22:00 +0100, Matthias Kilian wrote:
On Wed, Jan 09, 2008 at 07:42:21PM +0000, jim burton wrote:
I'm trying to build unregistered 6.8.2 on NetBSD Alpha 2.1.0_STABLE -- I have the following problem which seems to be same as this one - http://hackage.haskell.org/trac/ghc/ticket/1860
No, I think it's another problem.
$ ./configure --enable-hc-boot --enable-hc-boot-unregistered [...] checking for ld... /usr/bin/ld checking for path to top of build tree... ./configure[3201]: -v0: not found ./configure[3203]: utils/pwd/pwd: not found configure: error: cannot determine current directory
What happens here is that configure tries to compile some utility program (utils/pwd/pwd) using an existing ghc, which of course is impossible when you're porting ghc a platform not already running ghc. Similar problems are located in libraries and the Cabal-generated GNUmakefiles.
For the utils/pwd/pwd problem, I really don't understand why that thing is required at all, since it does little more than get the pwd and add some slash or backslash escaping/quadrupling depending on the argument passed to it.
You may try the patch below (and don't forget to re-run autoconf).
Note that this is the quick hack I did for OpenBSD. If the forward slash hack of util/pwd is really required (for Windows builds?), something like
hardtop=`pwd | tr '\\' /`
would be more appropriate. And the other sanity checks I deleted may be necessary in some cases, too, but I really don't see the point in them.
Ciao, Kili
ps: IMHO, libaries/ifBuildable.hs should die a horrible death, too. It can replaced with a few lines of shell commands..
--- aclocal.m4.orig Mon Dec 10 19:11:31 2007 +++ aclocal.m4 Fri Jan 4 13:58:49 2008 @@ -1098,28 +1098,7 @@ AC_REQUIRE([AC_PROG_CC]) AC_DEFUN([FP_FIND_ROOT],[ AC_MSG_CHECKING(for path to top of build tree)
-dnl This would be -dnl make -C utils/pwd clean && make -C utils/pwd -dnl except we don't want to have to know what make is called. Sigh. -if test ! -f utils/pwd/pwd && test ! -f utils/pwd/pwd.exe; then - cd utils/pwd - rm -f *.o - rm -f *.hi - rm -f pwd - rm -f pwd.exe - $WithGhc -v0 --make pwd -o pwd - cd ../.. -fi - -hardtop=`utils/pwd/pwd forwardslash` - -if ! test -d "$hardtop"; then - AC_MSG_ERROR([cannot determine current directory]) -fi - -dnl Remove common automounter nonsense -dnl -hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|'` +hardtop=`pwd`
AC_SUBST(hardtop)
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On Wed, Jan 09, 2008 at 10:41:23PM +0000, jim burton wrote:
Thanks for that, the configure script gets to the end with that help. Following the instructions at http://hackage.haskell.org/trac/ghc/wiki/Building/Porting#PortingGHCtoanewpl... , I then try to make includes but get a big stream of errors from make. Why is this?
The GHC build backs on gmake(1). Ciao, Kili

Thanks Kili. I'm afraid I need rather a lot of hand-holding with this and immediately run into the next problem jim@droog:jim/ghc-6.8.2/includes$ gmake Creating ghcautoconf.h... Done. gcc -O -I/arpa/j/jim/ghc-6.8.2/includes -I/arpa/j/jim/ghc-6.8.2/libraries/base/include -I/arpa/j/jim/ghc-6.8.2/libraries/unix/include -I/arpa/j/jim/ghc-6.8.2/libraries/parsec/include -DNO_REGS -DUSE_MINIINTERPRETER -I. -I../rts -I../gmp/gmpbuild -DNOSMP -c mkDerivedConstants.c -o mkDerivedConstants.o In file included from Stg.h:150, from Rts.h:19, from mkDerivedConstants.c:23: Regs.h:30:45: gmp.h: No such file or directory In file included from Stg.h:150, from Rts.h:19, from mkDerivedConstants.c:23: I thought this might mean gmp was missing, but it is installed. There is no ../gmp/gmpbuild however. What now? Thanks! On Thu, 2008-01-10 at 23:47 +0100, Matthias Kilian wrote:
On Wed, Jan 09, 2008 at 10:41:23PM +0000, jim burton wrote:
Thanks for that, the configure script gets to the end with that help. Following the instructions at http://hackage.haskell.org/trac/ghc/wiki/Building/Porting#PortingGHCtoanewpl... , I then try to make includes but get a big stream of errors from make. Why is this?
The GHC build backs on gmake(1).
Ciao, Kili _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On Fri, Jan 11, 2008 at 11:06:57AM +0000, Jim Burton wrote:
In file included from Stg.h:150, from Rts.h:19, from mkDerivedConstants.c:23: Regs.h:30:45: gmp.h: No such file or directory
For a starter, look at http://hackage.haskell.org/trac/ghc/ticket/2009 No idea wether it fixes your problem; you may have to add some more similar changes. Ciao, Kili

Thanks. I also needed to make gmp on the target. Would this generally be true as I think it would? I tried to update the wiki but don't have privileges. Jim On Fri, 2008-01-11 at 23:25 +0100, Matthias Kilian wrote:
On Fri, Jan 11, 2008 at 11:06:57AM +0000, Jim Burton wrote:
In file included from Stg.h:150, from Rts.h:19, from mkDerivedConstants.c:23: Regs.h:30:45: gmp.h: No such file or directory
For a starter, look at http://hackage.haskell.org/trac/ghc/ticket/2009
No idea wether it fixes your problem; you may have to add some more similar changes.
Ciao, Kili _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (4)
-
jb162ï¼ brighton.ac.uk
-
jim burton
-
Jim Burton
-
Matthias Kilian