<div dir="ltr">Frank, re building on 64 bits see section 3e in <a href="http://www.squeakvm.org/svn/squeak/branches/Cog/unixbuild/HowToBuild">http://www.squeakvm.org/svn/squeak/branches/Cog/unixbuild/HowToBuild</a></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Jan 2, 2013 at 2:58 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@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">
<div dir="ltr">the way to check is to cd to the UUIDPlugin directory and say make.  If that makes without error then yes, its working. <div><br></div><div>The issue with the sqUnixMain.c problems would appear to be that you&#39;re trying to build a 64-bit binary, not a 32-bit binary.  Supply -m32 somewhere (configure).</div>

</div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Wed, Jan 2, 2013 at 2:16 PM, Frank Shearar <span dir="ltr">&lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@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"><div><div><br>
On 2 January 2013 21:05, Frank Shearar &lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt; wrote:<br>
&gt; On 2 January 2013 20:37, Frank Shearar &lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt; wrote:<br>
&gt;&gt; On 2 January 2013 20:33, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi Frank,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     I *think* this is fixed in the Cog branch.  If you have time and could compile the Cog version I&#39;d appreciate it.  The fix would then be just to copy the Cog version across.<br>
&gt;&gt;<br>
&gt;&gt; Thanks, Eliot. I was setting up a Cog-on-fbsd CI job while I waited,<br>
&gt;&gt; so hopefully I can get back to you soon!<br>
&gt;<br>
&gt; What I&#39;m doing on the Cog side is the same as I&#39;m doing for the<br>
&gt; Interpreter: grab the latest bleeding edge tarball [1], untar it, cd<br>
&gt; platforms/unix &amp;&amp; make. That, on Cog, fails with this:<br>
&gt;<br>
&gt; checking sanity of generated src directory... bad<br>
&gt; missing file: /usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/bld/<a href="http://plugins.int" target="_blank">plugins.int</a><br>
&gt; *** Error code 1<br>
&gt;<br>
&gt; Ah, but I see there&#39;s a unixbuild directory. Following the HowToBuild<br>
&gt; instructions lets me configure a VM, and when compiling I hit a<br>
&gt; _different_ error.<br>
&gt;<br>
&gt; /usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/vm/sqUnixMain.c:62:23:<br>
&gt; error: execinfo.h: No such file or directory<br>
&gt; /usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/vm/sqUnixMain.c:823:3:<br>
&gt; error: #error need to implement extracting pc from a ucontext_t on<br>
&gt; this system<br>
&gt; /usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/vm/sqUnixMain.c:<br>
&gt; In function &#39;reportStackState&#39;:<br>
&gt; /usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/vm/sqUnixMain.c:827:<br>
&gt; error: &#39;fp&#39; undeclared (first use in this function)<br>
&gt; /usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/vm/sqUnixMain.c:827:<br>
&gt; error: (Each undeclared identifier is reported only once<br>
&gt; /usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/vm/sqUnixMain.c:827:<br>
&gt; error: for each function it appears in.)<br>
&gt; /usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/vm/sqUnixMain.c:827:<br>
&gt; error: &#39;sp&#39; undeclared (first use in this function)<br>
&gt; *** Error code 1<br>
&gt;<br>
&gt; That is likely because while there&#39;s a # elif __FreeBSD__ &amp;&amp; __i386__<br>
&gt; clause, this is an amd64 machine I&#39;m compiling on. Dang.<br>
<br>
</div></div>Adding this to sqUnixMain.c:<br>
<br>
# elif __FreeBSD__ &amp;&amp; __x86_64__<br>
                        void *fp = (void *)(uap ? uap-&gt;uc_mcontext.mc_rbp: 0);<br>
                        void *sp = (void *)(uap ? uap-&gt;uc_mcontext.mc_rsp: 0);<br>
<br>
and installing devel/libexecinfo to get execinfo.h gets me further:<br>
<br>
/usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/vm/sqUnixITimerHeartbeat.c:168:3:<br>
error: #error &quot;no high res clock defined&quot;. So, adding this to<br>
sqUnixITimerHeartbeat.c:<br>
<br>
#elif defined(__GNUC__) &amp;&amp; defined(__x86_64__)<br>
    // From <a href="http://sci.tuomastonteri.fi/programming/cplus/x86timer" target="_blank">http://sci.tuomastonteri.fi/programming/cplus/x86timer</a><br>
    uint32_t lo, hi;<br>
    /* We cannot use &quot;=A&quot;, since this would use %rax on x86_64 */<br>
    __asm__ __volatile__ (&quot;rdtsc&quot; : &quot;=a&quot; (lo), &quot;=d&quot; (hi));<br>
    return (uint64_t)hi &lt;&lt; 32 | lo;<br>
<br>
I can get a whole lot further. Far enough to hit this:<br>
<br>
vm/vm.a(sqUnixMain.o)(.text+0x2481): In function `reportStackState&#39;:<br>
/usr/home/frank/temp/jenkins/workspace/CogVM-FreeBSD/target/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src/platforms/unix/vm/sqUnixMain.c:799:<br>
undefined reference to `backtrace&#39;<br>
<br>
which looks to be a linking error.<br>
<br>
So that should mean that, in fact, the Cog branch _does_ have UUID<br>
stuff working for FreeBSD?<br>
<span><font color="#888888"><br>
frank<br>
</font></span><div><div><br>
&gt; It looks like this fails before the plugins get compiled, so I can&#39;t<br>
&gt; verify that the UUID stuff works on the Cog branch.<br>
&gt;<br>
&gt; frank<br>
&gt;<br>
&gt; [1] Right now that&#39;s<br>
&gt; <a href="http://squeakci.org/job/CogVM/lastSuccessfulBuild/artifact/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src-201301020322.tar.gz" target="_blank">http://squeakci.org/job/CogVM/lastSuccessfulBuild/artifact/Squeak-vm-unix-4.6.0-Cog-2646-unofficial-src-201301020322.tar.gz</a><br>


&gt;&gt; frank<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Wed, Jan 2, 2013 at 11:22 AM, Frank Shearar &lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I&#39;m setting up more CI jobs, this time to give FreeBSD some love. So I<br>
&gt;&gt;&gt;&gt; have a script that gets the bleeding edge Interpreter source, cd<br>
&gt;&gt;&gt;&gt; platform/unix; make. The results are here:<br>
&gt;&gt;&gt;&gt; <a href="http://squeakci.org/job/InterpreterVM-FreeBSD/13/console" target="_blank">http://squeakci.org/job/InterpreterVM-FreeBSD/13/console</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The punchline is that compilation fails thusly:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; In file included from<br>
&gt;&gt;&gt;&gt; /usr/home/frank/temp/jenkins/workspace/InterpreterVM-FreeBSD/target/Squeak-vm-unix-4.10.7-2646-unofficial-src/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c:9:<br>
&gt;&gt;&gt;&gt; /usr/local/include/uuid/uuid.h:44: error: conflicting types for &#39;uuid_t&#39;<br>
&gt;&gt;&gt;&gt; /usr/include/sys/uuid.h:74: error: previous declaration of &#39;uuid_t&#39; was here<br>
&gt;&gt;&gt;&gt; /usr/home/frank/temp/jenkins/workspace/InterpreterVM-FreeBSD/target/Squeak-vm-unix-4.10.7-2646-unofficial-src/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c:<br>
&gt;&gt;&gt;&gt; In function &#39;MakeUUID&#39;:<br>
&gt;&gt;&gt;&gt; /usr/home/frank/temp/jenkins/workspace/InterpreterVM-FreeBSD/target/Squeak-vm-unix-4.10.7-2646-unofficial-src/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c:29:<br>
&gt;&gt;&gt;&gt; warning: passing argument 1 of &#39;uuidgen&#39; from incompatible pointer<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The relevant source is here:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; int MakeUUID(char *location)<br>
&gt;&gt;&gt;&gt; {<br>
&gt;&gt;&gt;&gt; #if defined(HAVE_UUID_CREATE) &amp;&amp; !defined(HAVE_UUIDGEN) &amp;&amp;<br>
&gt;&gt;&gt;&gt; !defined(HAVE_UUID_GENERATE)<br>
&gt;&gt;&gt;&gt;   size_t  len= 16;      /* 128 bits */<br>
&gt;&gt;&gt;&gt;   uuid_t *uuid;<br>
&gt;&gt;&gt;&gt;   uuid_create(&amp;uuid);<br>
&gt;&gt;&gt;&gt;   uuid_make(uuid, UUID_MAKE_V1);<br>
&gt;&gt;&gt;&gt;   uuid_export(uuid, UUID_FMT_BIN, (void **)&amp;location, &amp;len);<br>
&gt;&gt;&gt;&gt;   uuid_destroy(uuid);<br>
&gt;&gt;&gt;&gt; #else<br>
&gt;&gt;&gt;&gt;   uuid_t uuid;<br>
&gt;&gt;&gt;&gt; #  if defined(HAVE_UUIDGEN)<br>
&gt;&gt;&gt;&gt;   uuidgen(&amp;uuid, 1);   // &lt;-- this is line 29, the offender<br>
&gt;&gt;&gt;&gt; #  elif defined(HAVE_UUID_GENERATE)<br>
&gt;&gt;&gt;&gt;   uuid_generate(uuid);<br>
&gt;&gt;&gt;&gt; #  endif<br>
&gt;&gt;&gt;&gt;   memcpy((void *)location, (void *)&amp;uuid, sizeof(uuid));<br>
&gt;&gt;&gt;&gt; #endif<br>
&gt;&gt;&gt;&gt;   return 1;<br>
&gt;&gt;&gt;&gt; }<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Any ideas? I&#39;m happy to do legwork, but Bozhe moi! This I know from nothing!<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; frank<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; best,<br>
&gt;&gt;&gt; Eliot<br>
&gt;&gt;&gt;<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>best,<div>Eliot</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div>