
Michael Jones
I am having problems building a GHC cross compiler for Linux (Yocto on a Wandboard) running on a Cortex A9, and need some advice on how to debug it.
Sorry for the delay, almost overlooked this one!
The cross compiler produces an executable that runs on the Target, but fails to print. So I need help coming up with a strategy to narrow down the root cause.
Some details:
The application:
main = do putStrLn "Haskell start"
The command line options work. The program runs, and I can step through assembly. Debug data is printed to the console. But putStrLn fails, and program enters an infinite loop.
Hmmm, very peculiar. I would probably begin by compiling with `-auto-all -caf-all -prof` and run the resulting executable with `+RTS -xc`. SIGINT the process after a second or so and see what the backtrace looks like. While worth trying, this probably won't help too much as your problem is likely RTS-related. You might try stracing the executable and see if it is ever even trying a syscall. Unfortunately, I doubt it is as the program appears to be hitting heap and stack overflows. This is quite perplexing. I'm going to try to reproduce the issue on my end. Cheers, - Ben