Revision
149026
Author
mcalhoun@macports.org
Date
2016-05-25 05:44:48 -0700 (Wed, 25 May 2016)

Log Message

openexr: attempt to fix Leopard i386 error reported in #51470

Modified Paths

Added Paths

Diff

Modified: trunk/dports/graphics/openexr/Portfile (149025 => 149026)


--- trunk/dports/graphics/openexr/Portfile	2016-05-25 12:41:47 UTC (rev 149025)
+++ trunk/dports/graphics/openexr/Portfile	2016-05-25 12:44:48 UTC (rev 149026)
@@ -57,6 +57,13 @@
     #    https://github.com/openexr/openexr/commit/57ecf581d053f5cacf2e8fc3c024490e0bbe536f
     #    for upstream fix
     patchfiles-append patch-64bit_types.diff
+
+    # avoid "can't find a register in class 'BREG' while reloading 'asm'
+    # see #51470 for MacPorts report
+    # see https://github.com/openexr/openexr/issues/128 for upstream report
+    if { ${build_arch} eq "i386" && [string match *gcc-4* ${configure.compiler}] } {
+        patchfiles-append patch-pic.diff
+    }
 }
 
 subport ilmbase {

Added: trunk/dports/graphics/openexr/files/patch-pic.diff (0 => 149026)


--- trunk/dports/graphics/openexr/files/patch-pic.diff	                        (rev 0)
+++ trunk/dports/graphics/openexr/files/patch-pic.diff	2016-05-25 12:44:48 UTC (rev 149026)
@@ -0,0 +1,15 @@
+--- IlmImf/ImfSystemSpecific.cpp.orig	2014-08-09 21:23:57.000000000 -0700
++++ IlmImf/ImfSystemSpecific.cpp	2016-05-24 05:49:44.000000000 -0700
+@@ -45,8 +45,10 @@
+     void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
+     {
+         __asm__ __volatile__ (
+-            "cpuid"
+-            : /* Output  */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) 
++            "mov %%ebx, %%edi\n"
++            "cpuid\n"
++            "xchg %%edi, %%ebx"
++            : /* Output  */ "=a"(eax), "=D"(ebx), "=c"(ecx), "=d"(edx) 
+             : /* Input   */ "a"(n)
+             : /* Clobber */);
+     }