<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Ben,<div><br></div><div>I ran into a snag trying to use the options you suggested. First, I was not sure where to use the flags, so I pasted a piece of my build.mk. You can correct it if I have it wrong.</div><div><br></div><div>I also get a compile error that I pasted after the build.mk text.</div><div><br></div><div>I have not made any changes except in aclocal.m4 so that my configure can recognize the target. It can’t figure out the tools, so I add options for all of them. The tools are for the target. That was my interpretation of the wiki. It finds the host tools on its own.</div><div><br></div><div>add eabi support in aclocal.m4...</div><div><div>autoreconf</div><div>./configure --target=arm-linux-gnueabi --with-gcc=arm-poky-linux-gnueabi-gcc --with-ld=arm-poky-linux-gnueabi-ld --with-nm=arm-poky-linux-gnueabi-nm --with-ar=arm-poky-linux-gnueabi-ar --with-ranlib=arm-poky-linux-gnueabi-ranlib</div></div><div><br></div><div><div># -------- A Fast build configured for cross-compilation ----------------------</div><div><br></div><div>ifeq "$(BuildFlavour)" "quick-cross"</div><div><br></div><div>SRC_HC_OPTS        = -H64m -O0 -auto-all -caf-all -prof</div><div>GhcStage1HcOpts    = -O -fllvm -auto-all -caf-all -prof</div><div>GhcStage2HcOpts    = -O0 -fllvm</div><div>GhcLibHcOpts       = -O -fllvm -auto-all -caf-all -prof</div><div>SplitObjs          = NO</div><div>HADDOCK_DOCS       = NO</div><div>BUILD_DOCBOOK_HTML = NO</div><div>BUILD_DOCBOOK_PS   = NO</div><div>BUILD_DOCBOOK_PDF  = NO</div><div>INTEGER_LIBRARY    = integer-simple</div><div>Stage1Only         = YES</div><div><br></div><div>DYNAMIC_BY_DEFAULT   = NO</div><div>DYNAMIC_GHC_PROGRAMS = NO</div><div><br></div><div>endif</div></div><div><br></div><div><div>echo "compiler_stage1_depfile_haskell_EXISTS = YES" >> compiler/stage1/build/.depend-v.haskell.tmp</div><div>for dir in compiler/stage1/build/./ compiler/stage1/build/CodeGen/ compiler/stage1/build/CodeGen/Platform/ compiler/stage1/build/Hoopl/ compiler/stage1/build/Llvm/ compiler/stage1/build/LlvmCodeGen/ compiler/stage1/build/PPC/ compiler/stage1/build/RegAlloc/ compiler/stage1/build/RegAlloc/Graph/ compiler/stage1/build/RegAlloc/Linear/ compiler/stage1/build/RegAlloc/Linear/PPC/ compiler/stage1/build/RegAlloc/Linear/SPARC/ compiler/stage1/build/RegAlloc/Linear/X86/ compiler/stage1/build/RegAlloc/Linear/X86_64/ compiler/stage1/build/SPARC/ compiler/stage1/build/SPARC/CodeGen/ compiler/stage1/build/Vectorise/ compiler/stage1/build/Vectorise/Builtins/ compiler/stage1/build/Vectorise/Generic/ compiler/stage1/build/Vectorise/Monad/ compiler/stage1/build/Vectorise/Type/ compiler/stage1/build/Vectorise/Utils/ compiler/stage1/build/X86/; do if test ! -d $dir; then mkdir -p $dir; fi done</div><div>grep -v ' : [a-zA-Z]:/' compiler/stage1/build/.depend-v.haskell.tmp > compiler/stage1/build/.depend-v.haskell.tmp2</div><div>sed -e '/hs$/ p' -e '/hs$/ s/o /hi /g' -e '/hs$/ s/:/ : %hi: %o /' -e '/hs$/ s/^/$(eval $(call hi-rule,/' -e '/hs$/ s/$/))/' -e '/hs-boot$/ p' -e '/hs-boot$/ s/o-boot /hi-boot /g' -e '/hs-boot$/ s/:/ : %hi-boot: %o-boot /' -e '/hs-boot$/ s/^/$(eval $(call hi-rule,/' -e '/hs-boot$/ s/$/))/' compiler/stage1/build/.depend-v.haskell.tmp2 > compiler/stage1/build/.depend-v.haskell</div><div>utils/ghc-pkg/ghc.mk:46: warning: overriding commands for target `install_utils/ghc-pkg_dist_wrapper'</div><div>utils/ghc-pkg/ghc.mk:37: warning: ignoring old commands for target `install_utils/ghc-pkg_dist_wrapper'</div><div>make[1]: *** No rule to make target `libraries/terminfo/dist-boot/build/System/Console/Terminfo.p_hi', needed by `utils/ghc-pkg/dist/build/Main.o'.  Stop.</div></div><div><br></div><div><br></div><div><br><div><div>On Jul 9, 2014, at 2:27 PM, Ben Gamari <<a href="mailto:bgamari.foss@gmail.com">bgamari.foss@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Michael Jones <<a href="mailto:mike@proclivis.com">mike@proclivis.com</a>> writes:<br><br><blockquote type="cite">I am having problems building a GHC cross compiler for Linux (Yocto on<br>a Wandboard) running on a Cortex A9, and need some advice on how to<br>debug it.<br><br></blockquote>Sorry for the delay, almost overlooked this one!<br><br><blockquote type="cite">The cross compiler produces an executable that runs on the Target, but<br>fails to print. So I need help coming up with a strategy to narrow<br>down the root cause.<br><br>Some details:<br><br>The application:<br><br>main = do<br>   putStrLn "Haskell start"<br><br><br>The command line options work. The program runs, and I can step<br>through assembly. Debug data is printed to the console. But putStrLn<br>fails, and program enters an infinite loop.<br><br></blockquote>Hmmm, very peculiar. I would probably begin by compiling with `-auto-all<br>-caf-all -prof` and run the resulting executable with `+RTS -xc`. SIGINT<br>the process after a second or so and see what the backtrace looks like.<br><br>While worth trying, this probably won't help too much as your problem is<br>likely RTS-related. You might try stracing the executable and see if it<br>is ever even trying a syscall.<br><br>Unfortunately, I doubt it is as the program appears to be hitting heap<br>and stack overflows. This is quite perplexing. I'm going to try to<br>reproduce the issue on my end.<br><br>Cheers,<br><br>- Ben</div></blockquote></div><br></div></body></html>