[Vm-dev] Cog FreeBSD patches

Frank Shearar frank.shearar at angband.za.org
Wed Mar 23 21:32:52 UTC 2011


On 2011/03/23 21:17, David T. Lewis wrote:
>
> On Wed, Mar 23, 2011 at 08:51:08PM +0100, Igor Stasenko wrote:
>>
>> On 23 March 2011 20:47, Frank Shearar<frank.shearar at angband.za.org>  wrote:
>>>
>>> Yes, I think. Well, I just blindly followed your instructions on a 64 bit
>>> machine :)
>>>
>> JIT won't run on 64 bits.
>> But you can try building StackVM
>>
>
> You should be able to build the 32-bit JIT on a 64-bit machine. On Linux
> I was able to do it with Eliot's build as follows:
>
> ../platforms/unix/config/configure CC="gcc -m32" CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=0" LDFLAGS="-m32" LIBS=-lpthread
>
> The problem (on Linux at least) was just that libtool insists on linking
> to 64-bit libraries regardless of what you do with CFLAGS and LDFLAGS,
> so you have to trick it into submission with the CC="gcc -m32" hack.
>
> It was not me that figured this out, but I can't recall who gets
> the credit.
>
> The libtool issues go away with Ian's CMake build, and that may be
> the case with the new CMake build procedures also. In any case it
> certainly is possible to build and run Cog on 64-bit machines.

Sorry, I should know this. We spoke about this in December, in fact:

http://lists.squeakfoundation.org/pipermail/vm-dev/2010-December/006008.html

I think it was Pierce Ng who found out the final magic recipe.

It's not just the "gcc -m32" bit - which gets you far enough to hit the 
"C compiler cannot create executables" problem - you have to say "gcc 
-m32 -B/usr/lib32", at which point I get new errors:

/usr/home/frank/temp/cogvm-64/platforms/unix/vm/sqUnixMain.c:60:23: 
error: execinfo.h: No such file or directory
/usr/home/frank/temp/cogvm-64/platforms/unix/vm/sqUnixMain.c: In 
function 'reportStackState':
/usr/home/frank/temp/cogvm-64/platforms/unix/vm/sqUnixMain.c:784: error: 
'mcontext_t' has no member named 'mc_ebp'
/usr/home/frank/temp/cogvm-64/platforms/unix/vm/sqUnixMain.c:785: error: 
'mcontext_t' has no member named 'mc_esp'
/usr/home/frank/temp/cogvm-64/platforms/unix/vm/sqUnixMain.c: In 
function 'main':
/usr/home/frank/temp/cogvm-64/platforms/unix/vm/sqUnixMain.c:1718: 
warning: assignment from incompatible pointer type
/usr/home/frank/temp/cogvm-64/platforms/unix/vm/sqUnixMain.c:1723: 
warning: assignment from incompatible pointer type
*** Error code 1

frank


More information about the Vm-dev mailing list