[Vm-dev] Suspicious typing in Cog VM

Eliot Miranda eliot.miranda at gmail.com
Wed Dec 8 17:08:12 UTC 2010


On Wed, Dec 8, 2010 at 12:30 AM, Aleksej Saushev <asau at inbox.ru> wrote:

>
>  Hello!
>
> Types are inconsistent along the source, does Cog VM work on LP64
> platforms?
>

Please read unixbuild/HowToBuild:

3d. If you're building the VM on a 64-bit OS, you'll need a compiler which
can
compile and link to 32-bit binaries. On most Linuxes the gcc-multilib
package
provides the 32-bit compiler and the ia32-libs provides the 32-bit
libraries.
You'll also have to add the -m32 switch to all gcc & g++ invocations.  The
easiest way to do this is to add CC="gcc -m32" & CXX="g++ -m32" to the
configure
script:
     ../../platforms/unix/config/configure CC="gcc -m32" CXX="g++ -m32"
CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -DNDEBUG -DITIMER_HEARTBEAT=1
-DNO_VM_PROFILE=1 -DCOGMTVM=0" LIBS=-lpthread
To run a 32-bit VM on a 64-bit OS, you'll also need the 32-bit libraries
provided by the ia32-libs package.


According to Paul DeBruicker  the following packages need to be installed to
compile in 32-bt mode on 64-bit ubuntu.  YMMV.

lib32asound2-dev
libgl1-mesa-dev
libglu1-mesa-dev
build-essential
ia32-libs
gcc-multilib
g++multilib


>
> I need this to make it build on NetBSD/i386:
>
> --- platforms/unix/plugins/SoundPlugin/sqUnixSound.c.orig       2010-12-07
> 17:40:51.000000000 +0000
> +++ platforms/unix/plugins/SoundPlugin/sqUnixSound.c
> @@ -99,12 +99,12 @@ int snd_AvailableSpace(void)
>   return snd->snd_AvailableSpace();
>  }
>
> -int snd_InsertSamplesFromLeadTime(int frameCount, int srcBufPtr, int
> samplesOfLeadTime)
> +sqInt snd_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr,
> sqInt samplesOfLeadTime)
>  {
>   return snd->snd_InsertSamplesFromLeadTime(frameCount, srcBufPtr,
> samplesOfLeadTime);
>  }
>
> -int snd_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int
> startIndex)
> +sqInt snd_PlaySamplesFromAtLength(sqInt frameCount, void *arrayIndex,
> sqInt startIndex)
>  {
>   return snd->snd_PlaySamplesFromAtLength(frameCount, arrayIndex,
> startIndex);
>  }
> @@ -141,7 +141,7 @@ double snd_GetRecordingSampleRate(void)
>   return snd->snd_GetRecordingSampleRate();
>  }
>
> -int snd_RecordSamplesIntoAtLength(int buf, int startSliceIndex, int
> bufferSizeInBytes)
> +sqInt snd_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex,
> sqInt bufferSizeInBytes)
>  {
>   return snd->snd_RecordSamplesIntoAtLength(buf, startSliceIndex,
> bufferSizeInBytes);
>  }
> @@ -150,7 +150,7 @@ int snd_RecordSamplesIntoAtLength(int bu
>
>  void snd_Volume(double *left, double *right)                   {
>  snd->snd_Volume(left, right); }
>  void snd_SetVolume(double left, double right)                  {
>  snd->snd_SetVolume(left, right); }
> -int  snd_SetRecordLevel(int level)                             { return
> snd->snd_SetRecordLevel(level); }
> +void snd_SetRecordLevel(sqInt level)                           { return
> snd->snd_SetRecordLevel(level); }
>  int  snd_GetSwitch(int id, int captureFlag, int channel)       { return
> snd->snd_GetSwitch(id, captureFlag, channel); }
>  int  snd_SetSwitch(int id, int captureFlag, int parameter)     { return
> snd->snd_SetSwitch(id, captureFlag, parameter); }
>  int  snd_SetDevice(int id, char *name)                         { return
> snd->snd_SetDevice(id, name); }
> --- src/vm/gcc3x-cointerp.c.orig        2010-12-07 18:00:09.000000000 +0000
> +++ src/vm/gcc3x-cointerp.c
> @@ -975,7 +975,7 @@ sqInt quickPrimitiveInstVarIndexFor(sqIn
>  sqInt rawHeaderOf(sqInt methodPointer);
>  void rawHeaderOfput(sqInt methodOop, void *cogMethod);
>  sqInt readableFormat(sqInt imageVersion);
> -sqInt readImageFromFileHeapSizeStartingAt(sqImageFile  f, sqInt
> desiredHeapSize, squeakFileOffsetType  imageOffset);
> +sqInt readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt
> desiredHeapSize, squeakFileOffsetType imageOffset);
>  sqInt remap(sqInt oop);
>  static sqInt removeFirstLinkOfList(sqInt aList);
>  EXPORT(sqInt) removeGCRoot(sqInt *varLoc);
> @@ -37959,7 +37959,7 @@ readableFormat(sqInt imageVersion) {
>  */
>
>  sqInt
> -readImageFromFileHeapSizeStartingAt(sqImageFile  f, sqInt desiredHeapSize,
> squeakFileOffsetType  imageOffset) {
> +readImageFromFileHeapSizeStartingAt(sqImageFile  f, usqInt
> desiredHeapSize, squeakFileOffsetType  imageOffset) {
>  DECL_MAYBE_SQ_GLOBAL_STRUCT
>     sqInt anObject;
>     sqInt aValue;
>
>
>
> --
> HE CE3OH...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101208/bc475c12/attachment.htm


More information about the Vm-dev mailing list