[Vm-dev] Re: Having trouble with 4.2 on Linux

Ken Causey ken at kencausey.com
Wed May 25 16:00:45 UTC 2011


Levente said:

>The error message is correct, you should specify the return type as long. 
>There's no int type in FFI, probably because it's ambiguous (even in C) 
>and unnecessary.

Thank you Levente.  This was enough to get me farther and have the
method compile.  If I were planning to do anything serious with this I
would certainly use trunk and take advantage of your fix, thanks for
that also.

I've fiddled with it a bit and the best result I have gotten so far is
if I implement my AnFFITest class as a subclass of ExternalObject and
put my method on the class side:

testRand
	"simplest test I could think of"
	<cdecl: long 'rand' ()>
	^self externalCallFailed

This fails with 'unable to find function address'.  Perhaps rand isn't a
function or I need to do something more to indicate that the function is
a libc function, or I've made some other mistake.

Separately David has suggested that for my self-built VM I specify -m32
but if I do that with cmake/configure -CFLAGS=-m32 configure fails with
'no suitable type found' with the top of the stack 'vm/config.cmake:71
(TEST_BIG_ENDIAN).  In all likelihood I'm not doing this right and I
will continue to look around.  However even with the normal build cmake
gives a stern warning that we are using an accidental and deprecated
feature (The source directory .../unix/npsqueak does not contain a
CMakeLists.txt file).  I'm using cmake 2.8.4 and I wonder if cmake has
moved beyond our currently cmake configuration.

I'll continue to mess with it and I welcome any suggestions anyone has.

Ken



More information about the Vm-dev mailing list