Simon,

Thanks, the debugging hints helped a lot (which tutorial did I miss
this time? :)



Short story
===========

I reconfigured gmp so that it falls back to the pure C implementation,
and the problem disappeared.  Is the gmp stuff in ghc maintained at
Glasgow, or are you syncing your code with the official distribution?
In the former case I think this is still a valid bug, at least in the
configure rules.


Long story
==========

Very mysterious things were happening when I tried your shortcuts.
E.g., cpp being invoked with hsc-options and hsc being invoked in a
command line starting with `o hsc', so I just built everything from
scratch with debugging enabled (as described in you earlier posting).

Then I noticed that there is some unknown-netbsd assembler code in
gmp, and removed it after ./configure:

cd ghc/rts/gmp/mpn ; ./configure --target=unknown  # was i386-unknown-bsd
cd ../.. ; <mkdepenedC>

I copied the <mkdependC> thing from `gmake boot`.  To be more precise,
it was:

 ../../glafp-utils/mkdependC/mkdependC -f .depend -I. -I../includes -- \
-optc-g -- Adjustor.c Assembler.c BlockAlloc.c ClosureFlags.c \
Disassembler.c Evaluator.c ForeignCall.c GC.c Hash.c Itimer.c MBlock.c \
Main.c Prelude.c Printer.c ProfHeap.c Profiling.c Proftimer.c RtsAPI.c \
RtsFlags.c RtsStartup.c RtsUtils.c Sanity.c Schedule.c Select.c \
Signals.c Sparks.c Stable.c Stats.c StgCRun.c StgLongLong.c \
StgPrimFloat.c Storage.c StrHash.c Ticky.c Weak.c hooks/ErrorHdr.c \
hooks/FlagDefaults.c hooks/InitEachPE.c hooks/MallocFail.c \
hooks/NoRunnableThreads.c hooks/OnExit.c hooks/OutOfHeap.c \
hooks/PatErrorHdr.c hooks/StackOverflow.c hooks/Trace.c \
parallel/0Hash.c parallel/0Unpack.c parallel/Global.c \
parallel/GranSim.c parallel/HLComms.c parallel/LLComms.c \
parallel/Pack.c parallel/ParInit.c parallel/Parallel.c \
parallel/ParallelDebug.c parallel/RBH.c Exception.hc HeapStackCheck.hc \
PrimOps.hc StgMiscClosures.hc StgStartup.hc StgStdThunks.hc Updates.hc \
parallel/FetchMe.hc universal_call_c.S

Then, I did everything as written down in distrib/hc-build, and ended
up with a working ghc inplace executable.  If you are still interested
in the gdb output, please tell me and I will mail it to you as soon as
I have a spare minute.

Since NetBSD 1.3.2 is fairly old and people should be encouraged to
update, I consider this procedure an acceptable workaround.  This
assumes however that there is a binary for NetBSD 1.5.  (Working on
it.)


  Thanks again,
 Matthias





"Simon Marlow" <[EMAIL PROTECTED]> writes:

> > "Simon Marlow" <[EMAIL PROTECTED]> writes:
> > 
> > > Try the script in fptools/distrib/hc-build, which should be able to
> > > bootstrap the compiler from .hc files automatically.  In particular,
> > > it'll make sure that hslibs/lang is built before trying to build the
> > > compiler.
> > 
> > Thanks for the prompt reply.  Now that I had the name I found it in
> > the documentation again.  Sorry, I am stupid.  Anyway, now ghc fails
> > to build ghc/lib/std (SIGSEGV):
> 
> oh dear.  To debug this, you need to:
> 
>       - re-compile the RTS with debugging support.  You need to
>         copy a couple of lines from mk/config.mk.in into mk/build.mk,
>         and uncomment them.  Search for 'GhcRtsHcOpts'.  Then go
>         into fptools/ghc/rts and 'make clean boot && make all'.  You
>         might need to re-configure with --enable-hc-boot first, because
>         the bootstrap was in the post-hc-boot stage.
> 
>       - re-link the compiler: cd fptools/ghc/compiler && rm hsc && make.
>       
>       - Run gdb on the compiler.  In order to do this, go into 
>         fptools/ghc/lib/std, type 'make EXTRA_HC_OPTS=-v', then ^Z to
>         suspend it.  Cut-n-paste the command line used to run the compiler,
>         and run it in gdb.  
> 
>       - See where it crashes, and send us the 'where' output from gdb. We'll
>         see where to go from there.
> 
> Cheers,
>       Simon
> 
> _______________________________________________
> Glasgow-haskell-bugs mailing list
> [EMAIL PROTECTED]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
> 

-- 
Matthias Fischmann | Research Engineer               | +358 (9) 8565 7474
[EMAIL PROTECTED]         | SSH Communication Security Corp | +358 (40) 752 5291

_______________________________________________
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to