porting to uClibc-based 686 Linux

Dubiousjim lists+haskell-glasgow at jimpryor.net
Mon Apr 1 23:41:38 CEST 2013


On Mon, Apr 01, 2013 at 01:11:20PM -0400, Dubiousjim wrote:
>   However, this fails at the following point:
> 
>       ""  -fno-stack-protector -DNO_REGS -DUSE_MINIINTERPRETER
>       -D__GLASGOW_HASKELL__=704 -Iincludes -DNO_REGS
>       -DUSE_MINIINTERPRETER
>       -Iincludes -Iincludes/dist-derivedconstants/header
>       -Iincludes/dist-ghcconstants/header -Irts -DNOSMP -c
>       includes/mkDerivedConstants.c -o
>       includes/dist-derivedconstants/build/mkDerivedConstants.o
>       /bin/sh: : Permission denied
>       make[1]: ***
>       [includes/dist-derivedconstants/build/mkDerivedConstants.o]
>       Error 127
>       make: *** [bootstrapping-files] Error 2
> 
>   I don't know if it's a variable that's supposed to point to $CC that's
>   coming up "", or one that's supposed to point to ghc. I'm guessing the
>   latter. I can't proceed with the porting instructions at this point
>   because includes/dist-derivedconstants is empty (just an empty build
>   dir), and includes/dist-ghcconstants doesn't exist yet.
> 
> 
> Any advice on how to proceed further using either of the strategies I
> described (cross-compiling, or bootstrapping using using unregisterised
> intermediate C files), would be welcomed.


I got past that point by re-entering the failing command line by hand,
and changing the leading "" to "gcc". I had to do that a couple of times
(four). Then I can proceed to copy some include files to the host, run
make on the host, make a tarball of various generated files. (One
problem here:
the instructions say to add compiler/main/Config.hs to the tarball, but
that doesn't exist in this sourcetree. I'm guessing they meant
compiler/stage2/build/Config.hs.) Then we untar that tarball back on the
target machine, and proceed with the instructions.

I come across a bunch more of the weird commands starting with "". A few
of them have the form:

    "" configure ...

At first I thought that was trying to be "sh configure ..." but the
configure script complains that it doesn't recognize all the passed
flags. Perhaps it should be not the configure script in the topmost
directory, but one in a subdirectory? In any case, by running these
commands:

    $ touch compiler/stage1/package-data.mk
    $ touch ghc/stage1/package-data.mk

I can avoid those invocations. Not sure if there is something here I
should be building but am missing.

There are a lot more commands that make tries to run that start with ""
and which seem to be trying to invoke gcc. (Plenty of times make *does*
invoke "/usr/bin/gcc", as it ought to. But there are a bunch of times
that it misses, and instead says "". Weird.) By correcting these all to
"gcc", I'm able to get a lot further in the process.

Here's where I'm stuck now. The instructions at
http://hackage.haskell.org/trac/ghc/wiki/Building/Porting
say to run these from the sourcetree on the target system:

    $ make all_ghc_stage2      2>&1 | tee c.log
    $ make inplace/bin/ghc-pkg 2>&1 | tee gp.log
    $ make inplace/lib/unlit
    
    NOTE: building inplace/bin/ghc-pkg currently fails. This has to be
    fixed. 


Here's how far I've gotten, with all my fiddling:

    $ make all_ghc_stage2
    ===--- building final phase
    make -r --no-print-directory -f ghc.mk phase=final all_ghc_stage2
    find: libraries/haskell98/dist-install/build: No such file or
    directory
    find: libraries/haskell98/dist-install/build: No such file or
    directory
    find: libraries/haskell2010/dist-install/build: No such file or
    directory
    find: libraries/haskell2010/dist-install/build: No such file or
    directory
    "cp" -p includes/dist-ghcconstants/build/tmp/mkGHCConstants
    inplace/bin/mkGHCConstants
    make[1]: *** No rule to make target
    `libraries/Cabal/Cabal/dist-install/build/Paths_Cabal.o', needed by
    `libraries/Cabal/Cabal/dist-install/build/libHSCabal-1.14.0.a'. 
    Stop.
    make: *** [all_ghc_stage2] Error 2
    
    $ make inplace/bin/ghc-pkg
    ===--- building final phase
    make -r --no-print-directory -f ghc.mk phase=final
    inplace/bin/ghc-pkg
    find: libraries/haskell98/dist-install/build: No such file or
    directory
    find: libraries/haskell98/dist-install/build: No such file or
    directory
    find: libraries/haskell2010/dist-install/build: No such file or
    directory
    find: libraries/haskell2010/dist-install/build: No such file or
    directory
    make[1]: *** No rule to make target
    `libraries/Cabal/Cabal/dist-install/build/Paths_Cabal.o', needed by
    `libraries/Cabal/Cabal/dist-install/build/libHSCabal-1.14.0.a'. 
    Stop.
    make: *** [inplace/bin/ghc-pkg] Error 2
    
    $ make inplace/lib/unlit
    ===--- building final phase
    make -r --no-print-directory -f ghc.mk phase=final inplace/lib/unlit
    find: libraries/haskell98/dist-install/build: No such file or
    directory
    find: libraries/haskell98/dist-install/build: No such file or
    directory
    find: libraries/haskell2010/dist-install/build: No such file or
    directory
    find: libraries/haskell2010/dist-install/build: No such file or
    directory
    "cp" -p utils/unlit/dist/build/tmp/unlit inplace/lib/unlit
    

Looks like until I build Paths_Cabal.o (how?), I'm still not going to
get a working stage2 ghc or a ghc-pkg.

As before, any advice would be very welcome.

-- 
dubiousjim at gmail.com




More information about the Glasgow-haskell-users mailing list