[bitc-dev] Compiling on FreeBSD 6.1
Jonathan S. Shapiro
shap at eros-os.org
Fri May 19 15:38:50 EDT 2006
On Fri, 2006-05-19 at 13:18 -0600, Christopher Nelson wrote:
> The run hangs with the -h, and I haven't tried the -s yet. Seems to be
> somewhere in the GC init, so I'm looking down that path. It actually
> gets stuck in a routine called nanosleep... Which I'm guessing is part
> of the FreeBSD environment, probably in libc? Thanks, and I'll let you
> know what I find.
Oh yes. I remember now.
This error occurs when allocation is performed before the boehm-gc
allocator has initialized. It is almost certainly the case that
something is calling malloc() from within a constructor initialization,
and the .init call that initializes the boehm-gc hasn't been called yet.
If you dig in to the Boehm code, you will discover that this is a known
issue, and that the semantics of dynamic library initialization doesn't
really permit a solution. One thing that you might consider is to try
linking it statically.
It is fairly straightforward (though time consuming) from where we are
to switch to Fergus's method and just adopt a precise GC system. We
won't be doing this in the bootstrap compiler, but it should be possible
to do it from the self-hosted compiler.
You can check this by running under GDB. Put a breakpoint on main before
saying "run". My bet is that you will find that you never actually make
it to main.
shap
More information about the bitc-dev
mailing list