<br><br><div class="gmail_quote">On Tue, Aug 28, 2012 at 8:47 AM, Guillermo Polito <span dir="ltr">&lt;<a href="mailto:guillermopolito@gmail.com" target="_blank">guillermopolito@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>the rest is COMPILED <div>this is the only thing which prevents from linking StackVM and getting a binary on Mac OSX.</div><div>Since x86 are similar to x64. i expect this can be done without much changes in assembler code.</div>

<div><br></div><div>Please help/advice.<br><div><br></div><div><div>Undefined symbols for architecture x86_64:</div><div>  &quot;_sqLowLevelMFence&quot;, referenced from:</div><div>      _forceInterruptCheck in gcc3x-interp.c.o</div>

<div>      _primitiveLongRunningPrimitiveSemaphore in gcc3x-interp.c.o</div><div>      _markAndTraceInterpreterOops in gcc3x-interp.c.o</div><div>      _primitiveDoPrimitiveWithArgs in gcc3x-interp.c.o</div><div>      _beRootIfOld in gcc3x-interp.c.o</div>

<div>      _updatePointersInRangeFromto in gcc3x-interp.c.o</div><div>      _setInterruptPending in gcc3x-interp.c.o</div><div>      ...</div><div>  &quot;_sqCompareAndSwapRes&quot;, referenced from:</div><div>      _signalSemaphoreWithIndex in sqExternalSemaphores.c.o</div>
</div></div></blockquote><div><br></div><div>this line in platforms/Cross/vm/sqMemoryFence.h should work fine:</div><div><br></div><div> #   define sqLowLevelMFence() asm volatile (&quot;mfence&quot;)</div><div><br></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<div>ld: symbol(s) not found for architecture x86_64</div><div>collect2: ld returned 1 exit status</div><div>make[2]: *** [/Users/guillermopolito/Pharo/vm/self-compiled/blessed/results/StackVM.app/Contents/MacOS/StackVM] Error 1</div>

<div>make[1]: *** [CMakeFiles/StackVM.dir/all] Error 2</div><div>make: *** [all] Error 2</div></div></div>
<br></blockquote></div><div><br></div>again the macro definitions in platforms/Cross/vm/sqAtomicOps.h shoild be fine:<div><br></div><div><div># define sqCompareAndSwap(var,old,new) \</div><div>    asm volatile (&quot;movl %1, %%eax; lock cmpxchg %2, %0&quot; \</div>
<div>                    : &quot;=m&quot;(var) \</div><div>                    : &quot;g&quot;(old), &quot;r&quot;(new), &quot;m&quot;(var)\</div><div>                    : &quot;memory&quot;, &quot;%eax&quot;)</div><div>
<br></div><div># define sqCompareAndSwapRes(var,old,new,res) \</div><div>    asm volatile (&quot;movl %2, %%eax; lock cmpxchg %3, %0; movl %%eax, %1&quot; \</div><div>                    : &quot;=m&quot;(var), &quot;=g&quot;(res) \</div>
<div>                    : &quot;g&quot;(old), &quot;r&quot;(new), &quot;m&quot;(var) \</div><div>                    : &quot;memory&quot;, &quot;%eax&quot;)</div><div><br></div><div>All you have to do is take these definitions and add them in a separate arm for x86-64, e.g.</div>
<div><br></div><div>#if defined(__GNUC__) &amp;&amp; (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_))</div><div>....existing definitions...</div><div>#else</div><div>...</div><div><br></div><div>becomes</div>
<div><br></div><div><div>#if defined(__GNUC__)</div><div>#   if defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_))</div></div>....existing definitions...<div>#   elif defined(x64) /* or whatever else x86-64 is called */</div>
....copy of x86 definitions that use assembler (i.e. *not*  asm volatile (&quot;.byte 0x0f;.byte 0xae;.byte 0xf0&quot;)) ...<div>#   endif</div><div>#else</div><div>...</div><br clear="all"><div><br></div>-- <br>best,<div>
Eliot</div><br>
</div>