<br><br><div class="gmail_quote">On Thu, Jul 15, 2010 at 4:49 PM, Rob Withers <span dir="ltr"><<a href="mailto:reefedjib@yahoo.com">reefedjib@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<div style="padding-left:10px;padding-right:10px;padding-top:15px" name="Compose message area">
<div><font size="2" face="Arial">I get the following:</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial"><a title="mailto:vawhigso@vawhigs.org
CTRL + Click to follow link" href="mailto:vawhigso@vawhigs.org" target="_blank">vawhigso@vawhigs.org</a>
[~/public_html/squeakelib/Cog]# gcc -m32 -E -dM
platforms/Cross/vm/sqMemoryFence.h | egrep "86|GNUC"<br>#define
__GNUC_PATCHLEVEL__ 2<br>#define __GNUC__ 4<br>#define __DBL_MAX__
1.7976931348623157e+308<br>#define __i386 1<br>#define i386 1<br>#define
__i386__ 1<br>#define __GNUC_RH_RELEASE__ 48<br>#define __GNUC_MINOR__
1<br>#define __GNUC_GNU_INLINE__ 1<br></font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial"><a href="mailto:vawhigso@vawhigs.org" target="_blank">vawhigso@vawhigs.org</a>
[~/public_html/squeakelib/Cog]# gcc -m64 -E -dM
platforms/Cross/vm/sqMemoryFence.h | egrep "86|GNUC"<br>#define __GNUC__
4<br>#define __DBL_MAX__ 1.7976931348623157e+308<br>#define __x86_64
1<br>#define __GNUC_RH_RELEASE__ 48<br>#define __x86_64__ 1<br>#define
__GNUC_PATCHLEVEL__ 2<br>#define __GNUC_MINOR__ 1<br>#define __GNUC_GNU_INLINE__
1<br></font></div>
<div><font size="2" face="Arial">It looks like I match the incantation, as both 32
and 64. Not sure what to change.</font></div></div></blockquote><div><br></div><div>You need to figure out why, when sqMemoryFence.h is included by sqExternalSemaphores.c and sqTicker.c, the following macro in sqMemoryFence.h is not being defined or not being expanded:</div>
<div><br></div><div><div>#if defined(__GNUC__) && (defined(i386) || defined(__i386) || defined(__i386__) || defined(_X86_))</div><div># if defined(__MINGW32__) && !__SSE2__</div><div> /* Andreas is fond of the gcc 2.95 MINGW but it lacks sse2 support */</div>
<div># define sqLowLevelMFence() asm volatile (".byte 0x0f;.byte 0xae;.byte 0xf0")</div><div># else</div><div># define sqLowLevelMFence() asm volatile ("mfence")</div><div># endif</div><div>#else</div>
<div># if !defined(sqLowLevelMFence)</div><div>extern void sqLowLevelMFence(void);</div><div># endif</div><div>#endif</div></div><div><br></div><div>i.e. from the above </div><div><div># define sqLowLevelMFence() asm volatile ("mfence")</div>
</div><div>should be live and hence in sqExternalSemaphores.c and sqTicker.c sqLowLevelMFence() should expand to asm volatile ("mfence").</div><div><br></div><div>gcc -E or gcc -P will run the preprocessor, so run the make capturing the compile commands for these two and retry the command deleting -c thefile and adding -E. Then look at the output and see what files are included (is sqMemoryFence.h being included?) and then if it is find out why, if as the -dM output above indicates, the macro isn't being defined given the above tests for both __GNUC__ and __i386__.</div>
<div><br></div><div>HTH</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="padding-left:10px;padding-right:10px;padding-top:15px" name="Compose message area">
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">Rob</font></div>
<div style="font:10pt Tahoma">
<div><br></div>
<div style="background:#f5f5f5">
<div><b>From:</b> <a title="mailto:eliot.miranda@gmail.com
CTRL + Click to follow link" href="mailto:eliot.miranda@gmail.com" target="_blank">Eliot Miranda</a> </div>
<div><b>Sent:</b> Thursday, July 15, 2010 6:27 PM</div>
<div><b>To:</b> <a title="vm-dev@lists.squeakfoundation.org" href="mailto:vm-dev@lists.squeakfoundation.org" target="_blank">Squeak Virtual Machine
Development Discussion</a> </div>
<div><b>Subject:</b> Re: [Vm-dev] Cog on linux</div></div></div>
<div><br></div>
<p>
</p><hr>
<p></p><br><br>
<div class="gmail_quote">On Thu, Jul 15, 2010 at 2:54 PM, Rob Withers <span dir="ltr"><<a href="mailto:reefedjib@yahoo.com" target="_blank">reefedjib@yahoo.com</a>></span> wrote:<br>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote"><br>(I am having trouble quoting Eliot's email as well.
Plain text is best)<br></blockquote>
<div><br></div>
<div>OK.</div>
<div><br></div>
<div> </div>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote"><br>I finally figured out how to specify to configure to use
-m32 on the CFLAGS entries. It is a part of the invocation of
configure.<br><br>../../platforms/unix/config/configure CFLAGS="-m32 -g -O2
-msse2 -D_GNU_SOURCE -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1
-DCOGMTVM=0" LIBS=-lpthread<br><br>I seem to have gotten past the problem with
sqUnixHeartbeat.c and now I have a new
problem:<br><br>vm/vm.a(sqExternalSemaphores.o): In function
`doSignalExternalSemaphores':<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:198:
undefined reference to `sqLowLevelMFence'<br></blockquote>
<div><br></div>
<div>gcc -E -dM should print predefined macros. e.g.</div>
<div><br></div>
<div>
<div>
<div>McStalker.oscogvm$ gcc -m32 -E -dM platforms/Cross/vm/sqMemoryFence.h |
egrep "86|GNUC"</div>
<div>#define __GNUC__ 4</div>
<div>#define __DBL_MAX__ 1.7976931348623157e+308</div>
<div>#define __i386 1</div>
<div>#define i386 1</div>
<div>#define __i386__ 1</div>
<div>#define __GNUC_PATCHLEVEL__ 1</div>
<div>#define __GNUC_MINOR__ 2</div>
<div>#define __GNUC_GNU_INLINE__ 1</div>
<div>McStalker.oscogvm$ gcc -m64 -E -dM platforms/Cross/vm/sqMemoryFence.h |
egrep "86|GNUC"</div>
<div>#define __GNUC__ 4</div>
<div>#define __DBL_MAX__ 1.7976931348623157e+308</div>
<div>#define __x86_64 1</div>
<div>#define __x86_64__ 1</div>
<div>#define __GNUC_PATCHLEVEL__ 1</div>
<div>#define __GNUC_MINOR__ 2</div>
<div>#define __GNUC_GNU_INLINE__ 1</div></div></div>
<div><br></div>
<div>You'll then see what names are given to define x86/IA32 on your system.
You can then edit the following incantation to include your configuration
(and let me know what it is).</div>
<div><br></div>
<div> #if defined(__GNUC__) && (defined(i386) || defined(__i386) ||
defined(__i386__) || defined(_X86_))</div>
<div><br></div>
<div>HTH</div>
<div>Eliot</div>
<div><br></div>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:213:
undefined reference to
`sqLowLevelMFence'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:184:
undefined reference to `sqLowLevelMFence'<br>vm/vm.a(sqExternalSemaphores.o):
In function
`signalSemaphoreWithIndex':<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:130:
undefined reference to
`sqLowLevelMFence'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:131:
undefined reference to
`sqAtomicAddConst'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:147:
undefined reference to
`sqLowLevelMFence'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:148:
undefined reference to
`sqCompareAndSwap'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:152:
undefined reference to
`sqLowLevelMFence'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:153:
undefined reference to
`sqCompareAndSwap'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:135:
undefined reference to
`sqLowLevelMFence'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:136:
undefined reference to
`sqCompareAndSwap'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:140:
undefined reference to
`sqLowLevelMFence'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqExternalSemaphores.c:141:
undefined reference to `sqCompareAndSwap'<br>vm/vm.a(sqTicker.o): In function
`checkHighPriorityTickees':<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqTicker.c:211:
undefined reference to
`sqLowLevelMFence'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqTicker.c:217:
undefined reference to
`sqCompareAndSwapRes'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqTicker.c:227:
undefined reference to `sqLowLevelMFence'<br>vm/vm.a(sqTicker.o): In function
`addHighPriorityTickee':<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqTicker.c:185:
undefined reference to `sqLowLevelMFence'<br>vm/vm.a(sqTicker.o): In function
`ioSynchronousCheckForEvents':<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqTicker.c:128:
undefined reference to `sqLowLevelMFence'<br>vm/vm.a(sqTicker.o): In function
`addHighPriorityTickee':<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqTicker.c:193:
undefined reference to
`sqLowLevelMFence'<br>/home1/vawhigso/public_html/squeakelib/Cog/platforms/Cross/vm/sqTicker.c:193:
undefined reference to `sqLowLevelMFence'<br>collect2: ld returned 1 exit
status<br>make: *** [squeak] Error 1
<div><br><br>--------------------------------------------------<br>From:
"Levente Uzonyi" <<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>><br></div>Sent: Thursday, July 15, 2010
3:38 PM<br>To: "Squeak Virtual Machine Development Discussion" <<a href="mailto:vm-dev@lists.squeakfoundation.org" target="_blank">vm-dev@lists.squeakfoundation.org</a>>
<div><br>Subject: Re: [Vm-dev] Cog on linux<br><br></div>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote"><br>
<div>
<div></div>
<div>On Thu, 15 Jul 2010, Rob Withers wrote:<br><br>(Pine is unable
to quote your mail...)<br><br>The question is: is your OS 32 or 64-bit? The
CPU doesn't matter here. If your OS is 64-bit then you'll probably need the
gcc-multilibs package (or equivalent for your platform) and as Eliot
suggested the -m32 switch for compilation and linking. To run the resulting
VM, you'll need the ia32-libs package (or equivalent for your platform), but
you already have that if you can run the prebuilt
SqueakVM.<br><br><br>Levente
<br></div></div></blockquote><br></blockquote></div><br><p></p></div>
<br></blockquote></div><br>