<br><br><div class="gmail_quote">On Tue, Aug 28, 2012 at 3:05 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks, Eliot.<br>
Guillermo started working on that thing, and i really hope with our<br>
help he will manage to do it.<br>
And then once we will have 64-bit stack VM working, it will open a<br>
straight road to 64-bit jit implementation.<br></blockquote><div><br></div><div>Right, cool.  But remember one can (and should) develop the code generator in Smalltalk/VMMaker above a BochsIA64Plugin, which should be straight-forward to derive from Bochs by configuring it for IA64/x86-64.  Good luck!</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
<br>
On 28 August 2012 20:44, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Aug 28, 2012 at 8:47 AM, Guillermo Polito &lt;<a href="mailto:guillermopolito@gmail.com">guillermopolito@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; the rest is COMPILED<br>
&gt;&gt; this is the only thing which prevents from linking StackVM and getting a binary on Mac OSX.<br>
&gt;&gt; Since x86 are similar to x64. i expect this can be done without much changes in assembler code.<br>
&gt;&gt;<br>
&gt;&gt; Please help/advice.<br>
&gt;&gt;<br>
&gt;&gt; Undefined symbols for architecture x86_64:<br>
&gt;&gt;   &quot;_sqLowLevelMFence&quot;, referenced from:<br>
&gt;&gt;       _forceInterruptCheck in gcc3x-interp.c.o<br>
&gt;&gt;       _primitiveLongRunningPrimitiveSemaphore in gcc3x-interp.c.o<br>
&gt;&gt;       _markAndTraceInterpreterOops in gcc3x-interp.c.o<br>
&gt;&gt;       _primitiveDoPrimitiveWithArgs in gcc3x-interp.c.o<br>
&gt;&gt;       _beRootIfOld in gcc3x-interp.c.o<br>
&gt;&gt;       _updatePointersInRangeFromto in gcc3x-interp.c.o<br>
&gt;&gt;       _setInterruptPending in gcc3x-interp.c.o<br>
&gt;&gt;       ...<br>
&gt;&gt;   &quot;_sqCompareAndSwapRes&quot;, referenced from:<br>
&gt;&gt;       _signalSemaphoreWithIndex in sqExternalSemaphores.c.o<br>
&gt;<br>
&gt;<br>
&gt; this line in platforms/Cross/vm/sqMemoryFence.h should work fine:<br>
&gt;<br>
&gt;  #   define sqLowLevelMFence() asm volatile (&quot;mfence&quot;)<br>
&gt;<br>
&gt;&gt; ld: symbol(s) not found for architecture x86_64<br>
&gt;&gt; collect2: ld returned 1 exit status<br>
&gt;&gt; make[2]: *** [/Users/guillermopolito/Pharo/vm/self-compiled/blessed/results/StackVM.app/Contents/MacOS/StackVM] Error 1<br>
&gt;&gt; make[1]: *** [CMakeFiles/StackVM.dir/all] Error 2<br>
&gt;&gt; make: *** [all] Error 2<br>
&gt;&gt;<br>
&gt;<br>
&gt; again the macro definitions in platforms/Cross/vm/sqAtomicOps.h shoild be fine:<br>
&gt;<br>
&gt; # define sqCompareAndSwap(var,old,new) \<br>
&gt;     asm volatile (&quot;movl %1, %%eax; lock cmpxchg %2, %0&quot; \<br>
&gt;                     : &quot;=m&quot;(var) \<br>
&gt;                     : &quot;g&quot;(old), &quot;r&quot;(new), &quot;m&quot;(var)\<br>
&gt;                     : &quot;memory&quot;, &quot;%eax&quot;)<br>
&gt;<br>
&gt; # define sqCompareAndSwapRes(var,old,new,res) \<br>
&gt;     asm volatile (&quot;movl %2, %%eax; lock cmpxchg %3, %0; movl %%eax, %1&quot; \<br>
&gt;                     : &quot;=m&quot;(var), &quot;=g&quot;(res) \<br>
&gt;                     : &quot;g&quot;(old), &quot;r&quot;(new), &quot;m&quot;(var) \<br>
&gt;                     : &quot;memory&quot;, &quot;%eax&quot;)<br>
&gt;<br>
&gt; All you have to do is take these definitions and add them in a separate arm for x86-64, e.g.<br>
&gt;<br>
&gt; #if defined(__GNUC__) &amp;&amp; (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_))<br>
&gt; ....existing definitions...<br>
&gt; #else<br>
&gt; ...<br>
&gt;<br>
&gt; becomes<br>
&gt;<br>
&gt; #if defined(__GNUC__)<br>
&gt; #   if defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_))<br>
&gt; ....existing definitions...<br>
&gt; #   elif defined(x64) /* or whatever else x86-64 is called */<br>
&gt; ....copy of x86 definitions that use assembler (i.e. *not*  asm volatile (&quot;.byte 0x0f;.byte 0xae;.byte 0xf0&quot;)) ...<br>
&gt; #   endif<br>
&gt; #else<br>
&gt; ...<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; best,<br>
&gt; Eliot<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Best regards,<br>
Igor Stasenko.<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>