[M3devel] strange errors...

Tony Hosking hosking at cs.purdue.edu
Mon Jun 25 05:40:21 CEST 2007


cm3 should not segfault if you simply install a new cm3cg, since all  
it does is exec cm3cg.

On Jun 24, 2007, at 10:53 PM, Mika Nystrom wrote:

> Tony Hosking writes:
> ...
>>
>> Install the bootstrap compiler as you did originally:
>>
>>> rm -rf /usr/local/cm3/*
>>>
>>> cd ~/cm3-cvs
>>> mkdir boot
>>> cd boot
>>> tar xzvf ../cm3-min-POSIX-FreeBSD4-d5.3.1-2005-10-05.tgz
>>> ./cminstall
>>
>> Now you will have some kind of cm3 installed, presumably in /usr/
>> local/cm3/bin/cm3.
>>
>> Make sure you have a fresh CVS checkout in directory cm3 (let's
>> assume this is in your home directory ~/cm3).  Also, make sure you
>> have an up-to-date version of the CM3 backend compiler cm3cg
>> installed by executing the following:
>>
>> STEP 0:
>>
>> export CM3=/usr/local/cm3/bin/cm3
>> cd ~/cm3/m3-sys/m3cc
>> $CM3
>> $CM3 -ship
>>
>> You can skip this last step if you know your backend compiler is up
>> to date.
>
> Ok, I did a completely fresh checkout (into an empty directory) and
> proceeded in accordance with the above instructions.  At this point
> (that is, after shipping the new cm3cg), I have a segfaulting cm3.
>
> This is on the following system:
>
> (130)rover:~/cm3-cvs/fresh/cm3/m3-libs/m3core>uname -a
> FreeBSD rover 5.5-RELEASE FreeBSD 5.5-RELEASE #3: Sat May 12  
> 14:03:45 PDT 2007     mika at rover:/usr/src/sys/i386/compile/ROVER  i386
> (131)rover:~/cm3-cvs/fresh/cm3/m3-libs/m3core>gcc -v
> Using built-in specs.
> Configured with: FreeBSD/i386 system compiler
> Thread model: posix
> gcc version 3.4.2 [FreeBSD] 20040728
> (132)rover:~/cm3-cvs/fresh/cm3/m3-libs/m3core>cm3 -version
> Critical Mass Modula-3 version d5.3.1
>   last updated: 2005-10-05
>   configuration: /usr/local/cm3/bin/cm3.cfg
>
> I'm trying it on Darwin too, but as usual that machine is a couple
> of steps behind...
>
>       Mika
>
>
>>
>> Now, let's build the new compiler from scratch (this is the sequence
>> I use regularly to test changes to the run-time system whenever I
>> make them):
>>
>> STEP 1:
>>
>> cd ~/cm3/m3-libs/m3core
>> $CM3
>> $CM3 -ship
>> cd ~/cm3/m3-libs/libm3
>> $CM3
>> $CM3 -ship
>> cd ~/cm3/m3-sys/m3middle
>> $CM3
>> $CM3 -ship
>> cd ~/cm3/m3-sys/m3linker
>> $CM3
>> $CM3 -ship
>> cd ~/cm3/m3-sys/m3front
>> $CM3
>> $CM3 -ship
>> cd ~/cm3/m3-sys/m3quake
>> $CM3
>> $CM3 -ship
>> cd ~/cm3/m3-sys/cm3
>> $CM3
>> $CM3 -ship
>>
>> At this point you should have a bootstrapped version of cm3 installed
>> in the directory /usr/local/cm3/pkg/cm3/TARGET/cm3 (where TARGET is
>> the CM3 target platform you are building on -- e.g., LINUXLIBC6,
>> PPC_DARWIN, ...).  Note that this did not overwrite your original
>> installed compiler in /usr/local/cm3/bin/cm3.  We
>> are now going to test the new compiler, which was built using the old
>> compiler, by bootstrapping it one more time.
>>
>> From here on out, please replace TARGET with your target platform as
>> appropriate.
>>
>> STEP 2:
>>
>> export CM3=/usr/local/cm3/pkg/cm3/TARGET/cm3
>> cd ~/cm3/scripts
>> ./do-cm3-std.sh realclean
>> REPEAT STEP 1 to rebuild the libraries and the compiler using the
>> STEP 1 bootstrap compiler.
>>
>> Now you have a STEP 2 bootstrap compiler installed in /usr/local/cm3/
>> pkg/cm3/TARGET/cm3.  Let's assume the new compiler now works properly
>> since it successfully bootstrapped itself, but to be sure we can now
>> use it to rebuild the world:
>>
>> cd ~/cm3/scripts
>> ./do-cm3-std.sh realclean
>> ./do-cm3-std.sh buildship
>>
>> Assuming this succeeded then we can be pretty sure /usr/local/cm3/ 
>> pkg/
>> cm3/TARGET/cm3 is good, so we can make it our default compiler by
>> replacing the original /usr/local/cm3/bin/cm3:
>>
>> cp $CM3 /usr/local/cm3/bin/cm3
>>
>> On Jun 23, 2007, at 2:38 PM, Mika Nystrom wrote:
>>
>>> Ok, I'm sorry if I seem a bit dimwitted in the morning like this,
>>> but how exactly does one get started?  I wish there were a file  
>>> called
>>> "GETTING_STARTED" or something like that in scripts...
>>>
>>> My Mac is very slow so I switched to my FreeBSD/i386 system  
>>> (which has
>>> PM3 happily installed on it) and tried to install CM3 from scratch.
> ...




More information about the M3devel mailing list