On Mon, Mar 24, 2003 at 12:00:40AM -0800, Kirsten Chevalier wrote:
> I'm using the latest version of GHC and gcc 2.96 on a Linux machine, and
> I get the following weird behavior when trying to compile programs for
> profiling and generate external Core:
>
> $ ghc -fglasgow-exts -fno-code -fext-core -prof -auto-all hello.hs
> $ ghc -o hello -prof -auto-all hello.hcr
> /tmp/ghc24088.hc:6: `NULL' undeclared here (not in a function)
> /tmp/ghc24088.hc:6: initializer element is not constant
> /tmp/ghc24088.hc:6: (near initialization for `Main_CAFs_cc_ccs[0].prevStack')
> /tmp/ghc24088.hc:6: `NULL' undeclared here (not in a function)
> /tmp/ghc24088.hc:6: initializer element is not constant
> /tmp/ghc24088.hc:6: (near initialization for `Main_CAFs_cc_ccs[0].indexTable')
> /tmp/ghc24088.hc:15: `NULL' undeclared here (not in a function)
> /tmp/ghc24088.hc:15: initializer element is not constant
> /tmp/ghc24088.hc:15: (near initialization for `Main_main_closure.header.prof.hp\.rs')
> /tmp/ghc24088.hc:63: `NULL' undeclared here (not in a function)
> /tmp/ghc24088.hc:63: initializer element is not constant
> /tmp/ghc24088.hc:63: (near initialization for
> `Main_zdmain_closure.header.prof.\hp.rs')
>
> This happens no matter what program I try to compile, and it doesn't happen
> if I don't use -prof -auto-all.
>
In case anyone is wondering, this particular problem seems to be fixed after
doing a cvs update, but then, any External Core program that was compiled for
profiling would segfault. I was able to fix this by modifying the EnterFunCCS
function in rts/Profiling.c to change the line:
if (ccsfn->root->is_caf == CC_IS_CAF) {
to
if ((ccsfn->root != NULL) && (ccsfn->root->is_caf == CC_IS_CAF)) {
I don't know whether that's the right solution, but it seems to work for me.
--
Kirsten Chevalier * [EMAIL PROTECTED] * Often in error, never in doubt
"Oh wait, there's more to being girly than porn and underwear, right?"
-- Erika Reinfeld
http://www.cs.berkeley.edu/~krc/
_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs