[M3devel] help booting CM3 on FreeBSD 4.11?

Mika Nystrom mika at async.caltech.edu
Sat Apr 25 05:38:17 CEST 2009


Jay (and others),

Success!  I think.... I was able to build the compiler, after much
experimentation, by using Jay's build order and linking with -libc_r.
Mentor works, and that's usually a good sign.

Jay, your assembly worked too!  And as you say, it's much easier to
bootstrap with that than to do what I was trying to do (but I did
both, several times, just to make sure).

I don't know why I was having linking problems with -libc_r earlier.
Now it just seems to work.  So, pthreads on FreeBSD 4.

If I use user threads, it's a different story (which is probably too bad,
as I know that user threads work absolutely fine in my old version of CM3):

I can build a compiler fine, but the bootstrapped cm3 crashes in
the user thread code.  Note that exactly the same thing happens whether
I bootstrap with the assembly version from Jay or from v. 5.3.4, which
I think is what I had.  Here we go:

Starting program: /usr/local/cm3/pkg/cm3/FreeBSD4/cm3 

Program received signal SIGSEGV, Segmentation fault.
16_82568bb in RTHooks.PushEFrame (frame=16_bfbff3f4) at ../src/thread/POSIX/ThreadPosix.m3:1599
1599        f.next := self.context.handlers;
(gdb) where
#0  16_82568bb in RTHooks.PushEFrame (frame=16_bfbff3f4) at ../src/thread/POSIX/ThreadPosix.m3:1599
#1  16_824c91e in RTType.Calloc (n=1024, n_bytes=4) at ../src/runtime/common/RTType.m3:815
#2  16_824c39a in RTType.Expand (m=RECORD name = 16_82f0e50; is_equal = 16_824c6a6; rehash = 16_824c6e8; 
    initial_size = 1024; full = 512; cnt = 0; max = 1024; mask = 1023; map = NIL;  END)
    at ../src/runtime/common/RTType.m3:724
#3  16_824c26f in RTType.FindSlot (m=RECORD name = 16_82f0e50; is_equal = 16_824c6a6; rehash = 16_824c6e8; 
    initial_size = 1024; full = 512; cnt = 0; max = 1024; mask = 1023; map = NIL;  END, key=-1025633461, aux=NIL)
    at ../src/runtime/common/RTType.m3:699
#4  16_824b007 in RTTypeSRC.AddTypecell (def=16_82eb8b4, m=16_82eb880) at ../src/runtime/common/RTType.m3:163
#5  16_8244d89 in RTLinker.DeclareModuleTypes (m=16_82eb880) at ../src/runtime/common/RTLinker.m3:280
#6  16_8244b52 in RTLinker.FixTypes () at ../src/runtime/common/RTLinker.m3:234
#7  16_82446f9 in RTLinker.AddUnitI (m=16_82eefa0) at ../src/runtime/common/RTLinker.m3:112
#8  16_824478f in RTLinker.AddUnit (b=16_82443e0) at ../src/runtime/common/RTLinker.m3:122
#9  16_8244493 in RTLinker.InitRuntime (p_argc=1, p_argv=16_bfbff68c, p_envp=16_bfbff694, p_instance=NIL)
    at ../src/runtime/common/RTLinker.m3:42
module "_m3main": missing debug info for global data

I'm not able to print self in m3gdb, for some reason.

     Mika


Jay writes:
>
>>
>> Would help if you had pthreads though.
>
> 
>IF you have a working-enough pthreads, no matter what library they are in, take a look at:
> 
> 
> http://modula3.elegosoft.com/cm3/uploaded-archives/cm3-boot-FreeBSD4-1.tar.gz 
> 
> 
>It's a little gross -- one directory with LOTS of files.
>And a few subdirectories you don't need.
> 
> 
>Be sure to look at the start of the Makefile and possibly adjust it.
>There are some *.sh files, redundant with the Makefile.
> 
> 
>The output of this is just cm3.
>You can use that to then build up the system from the bottom of the dependeny tree and on up -- m3cc, m3core, libm3, etc. do-cm3-core.sh/do-cm3-core.py should do that.
>This is different than "upgrade", which uses an existing m3core/libm3.
> 
>This is how I do cross builds, both to existing systems and new systems.
>It has worked several times for me. Most often from a Cygwin host but maybe not always, and it isn't Cygwin specific.
> 
> 
> 
>If you really don't have a working pthreads, well, I'd just have to rebuild this with one edit...maybe I can do that quickly (it'll be -2 if so..), maybe it'll work...maybe...
> 
> 
> - Jay



More information about the M3devel mailing list