freebsd-ports/graphics/OpenEXR/files/patch-IlmImf__ImfSystemSpecific.cpp
Matthias Andree 1fb0ae7cf9 Security update OpenEXR and ilmbase to 2.2.1.
While here, fix libIlmImfUtil_la_LDFLAGp so that when linking libIlmImfUtil,
the locally built libIlmImf gets precedence over the one in /usr/local,
to permit upgrades in a running system with the older version installed.

This changes the library's SONAME, so bump PORTREVISION of all dependees.

Unfortunately, this looks a bit too intrusive for an MFH to 2017Q4.

Security:	CVE-2017-9110
Security:	CVE-2017-9111
Security:	CVE-2017-9112
Security:	CVE-2017-9113
Security:	CVE-2017-9114
Security:	CVE-2017-9115
Security:	CVE-2017-9116
Security:	803879e9-4195-11e7-9b08-080027ef73ec
2017-12-01 01:58:23 +00:00

29 lines
970 B
C++

--- IlmImf/ImfSystemSpecific.cpp.orig 2017-11-17 23:00:24 UTC
+++ IlmImf/ImfSystemSpecific.cpp
@@ -44,11 +44,23 @@ namespace {
// Helper functions for gcc + SSE enabled
void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
{
+#if __i386__
__asm__ __volatile__ (
- "cpuid"
- : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
- : /* Input */ "a"(n)
+ "xchgl %%ebx,%k1\n"
+ "cpuid\n"
+ "xchgl %%ebx,%k1" \
+ : /* Output */ "=a"(eax), "=&r"(ebx), "=c"(ecx), "=d"(edx)
+ : /* Input */ "0"(n)
: /* Clobber */);
+#else
+ __asm__ __volatile__ (
+ "xchgq %%rbx,%q1\n"
+ "cpuid\n"
+ "xchgq %%rbx,%q1" \
+ : /* Output */ "=a"(eax), "=&r"(ebx), "=c"(ecx), "=d"(edx)
+ : /* Input */ "0"(n)
+ : /* Clobber */);
+#endif
}
#else // IMF_HAVE_SSE2 && __GNUC__