<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -612,6 +612,8 @@ info :
 	@echo &quot;LDFLAGS      = $(LDFLAGS)&quot;
 	@echo &quot;C_CFLAGS     = $(C_CFLAGS)&quot;
 	@echo &quot;C_LDFLAGS    = $(C_LDFLAGS)&quot;
+	@echo &quot;DLL_NAME     = $(DLL_NAME)&quot;
+	@echo &quot;DLL_CFLAGS   = $(DLL_CFLAGS)&quot;
 	@echo &quot;MATLABEXE    = $(MATLABEXE)&quot;
 	@echo &quot;MEX          = $(MEX)&quot;
 	@echo &quot;MATLABPATH   = $(MATLABPATH)&quot;</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -335,8 +335,12 @@ _vl_cpuid (vl_int32* info, int function)
 VL_INLINE void
 _vl_cpuid (vl_int32* info, int function)
 {
-  /* this version is compatible with -fPIC */
-#if defined(VL_ARCH_IX86)
+#if defined(VL_ARCH_IX86) &amp;&amp; (defined(__PIC__) || defined(__pic__))
+  /* This version is compatible with -fPIC on x386 targets. This special
+   * case is required becaus
+   * on such platform -fPIC alocates ebx as global offset table pointer.
+   * Note that =r below will be mapped to a register different from ebx,
+   * so the code is sound. */
   __asm__ __volatile__
   (&quot;pushl %%ebx      \n&quot; /* save %ebx */
    &quot;cpuid            \n&quot;
@@ -344,14 +348,11 @@ _vl_cpuid (vl_int32* info, int function)
    &quot;popl %%ebx       \n&quot; /* restore the old %ebx */
    : &quot;=a&quot;(info[0]), &quot;=r&quot;(info[1]), &quot;=c&quot;(info[2]), &quot;=d&quot;(info[3])
    : &quot;a&quot;(function)
-   : &quot;cc&quot;) ;
-#else /* defined(VL_ARCH_IA64)*/
+   : &quot;cc&quot;) ; /* clobbered (cc=condition codes) */
+#else /* no -fPIC or -fPIC with a 64-bit target */
   __asm__ __volatile__
-  (&quot;pushq %%rbx      \n&quot; /* save %ebx */
-   &quot;cpuid            \n&quot;
-   &quot;movl %%ebx, %1   \n&quot; /* save what cpuid just put in %ebx */
-   &quot;popq %%rbx       \n&quot; /* restore the old %ebx */
-   : &quot;=a&quot;(info[0]), &quot;=r&quot;(info[1]), &quot;=c&quot;(info[2]), &quot;=d&quot;(info[3])
+  (&quot;cpuid&quot;
+   : &quot;=a&quot;(info[0]), &quot;=b&quot;(info[1]), &quot;=c&quot;(info[2]), &quot;=d&quot;(info[3])
    : &quot;a&quot;(function)
    : &quot;cc&quot;) ;
 #endif</diff>
      <filename>vl/host.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c94b0c6cdff5a0b7dba109dc36be73e2c7528feb</id>
    </parent>
  </parents>
  <author>
    <name>Andrea Vedaldi</name>
    <email>vedaldi@gmail.com</email>
  </author>
  <url>http://github.com/vlfeat/vlfeat/commit/73b84d0c7248fbfa7d20769f82a42d148216dd64</url>
  <id>73b84d0c7248fbfa7d20769f82a42d148216dd64</id>
  <committed-date>2009-08-31T07:33:28-07:00</committed-date>
  <authored-date>2009-08-31T07:33:28-07:00</authored-date>
  <message>vl/host.c: fixes a crash in CPUID detection on 64-bit targets</message>
  <tree>c08d1fe4b96e3774f29edc10afc68a72eabcd0c9</tree>
  <committer>
    <name>Andrea Vedaldi</name>
    <email>vedaldi@gmail.com</email>
  </committer>
</commit>
