diff options
author | richard <richard@pkgsrc.org> | 2014-08-15 18:07:41 +0000 |
---|---|---|
committer | richard <richard@pkgsrc.org> | 2014-08-15 18:07:41 +0000 |
commit | 98cb160a0c1bf6483ec55b05ad56d70f351a2753 (patch) | |
tree | bb71d83e951c0156e8ccfdbc56ae0736be5e6cc4 /graphics | |
parent | 0b359157c0588c0d6eb6dde8afc54a6c23f872a9 (diff) | |
download | pkgsrc-98cb160a0c1bf6483ec55b05ad56d70f351a2753.tar.gz |
Rework cpuid function to use gnuc __get_cpuid (requiring at least gcc 4.3)
This get's over issues such as encountered with PIC builds.
Upstream issue : https://github.com/openexr/openexr/issues/128
Revbump due to new dependency on GCC_REQD+= 4.3
(additional patches available upon request for bmake test target)
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/openexr/Makefile | 6 | ||||
-rw-r--r-- | graphics/openexr/distinfo | 3 | ||||
-rw-r--r-- | graphics/openexr/patches/patch-IlmImf_ImfSystemSpecific.cpp | 65 |
3 files changed, 71 insertions, 3 deletions
diff --git a/graphics/openexr/Makefile b/graphics/openexr/Makefile index 1ef120e615d..18a99fd1cd1 100644 --- a/graphics/openexr/Makefile +++ b/graphics/openexr/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.33 2014/08/13 19:23:08 tron Exp $ +# $NetBSD: Makefile,v 1.34 2014/08/15 18:07:41 richard Exp $ DISTNAME= openexr-2.2.0 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= graphics MASTER_SITES= http://download.savannah.nongnu.org/releases/openexr/ @@ -17,6 +17,8 @@ GNU_CONFIGURE= yes PKGCONFIG_OVERRIDE= OpenEXR.pc.in TEST_TARGET= check +GCC_REQD+= 4.3 + PTHREAD_OPTS+= require LIBS.IRIX+= -lmx LIBS.SunOS+= -lm diff --git a/graphics/openexr/distinfo b/graphics/openexr/distinfo index 23869d4e40d..083607275f1 100644 --- a/graphics/openexr/distinfo +++ b/graphics/openexr/distinfo @@ -1,9 +1,10 @@ -$NetBSD: distinfo,v 1.24 2014/08/13 19:23:08 tron Exp $ +$NetBSD: distinfo,v 1.25 2014/08/15 18:07:41 richard Exp $ SHA1 (openexr-2.2.0.tar.gz) = d09a68c4443b7a12a0484c073adaef348b44cb92 RMD160 (openexr-2.2.0.tar.gz) = a825ed42e731da3bc39f25ce2a310712a5b0f956 Size (openexr-2.2.0.tar.gz) = 14489661 bytes SHA1 (patch-IlmImf_ImfFastHuf.cpp) = bf583b5e0efb1af6e00d671b07d4cc154e13ac44 +SHA1 (patch-IlmImf_ImfSystemSpecific.cpp) = 774b6498bdce55f24a9ffd6efaee349bfbd82173 SHA1 (patch-IlmImf_ImfSystemSpecific.h) = f36d049085e42beabcf5f7af5354009391a1f9f2 SHA1 (patch-aa) = 08b38d81338fc755c321911a9ffa3cccb53e99f3 SHA1 (patch-ab) = 0efe7155350e1976d1d7bad9da8b1a037fd84572 diff --git a/graphics/openexr/patches/patch-IlmImf_ImfSystemSpecific.cpp b/graphics/openexr/patches/patch-IlmImf_ImfSystemSpecific.cpp new file mode 100644 index 00000000000..85d8bbb1f22 --- /dev/null +++ b/graphics/openexr/patches/patch-IlmImf_ImfSystemSpecific.cpp @@ -0,0 +1,65 @@ +$NetBSD: patch-IlmImf_ImfSystemSpecific.cpp,v 1.1 2014/08/15 18:07:41 richard Exp $ + +Rework cpuid function to use gnuc __get_cpuid (requiring at least gcc 4.3) +This get's over issues such as encountered with PIC builds. +Upstream issue : https://github.com/openexr/openexr/issues/128 + +--- IlmImf/ImfSystemSpecific.cpp.orig 2014-08-10 04:23:57.000000000 +0000 ++++ IlmImf/ImfSystemSpecific.cpp +@@ -40,21 +40,19 @@ OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EN + + namespace { + #if defined(IMF_HAVE_SSE2) && defined(__GNUC__) +- ++#include <cpuid.h> + // Helper functions for gcc + SSE enabled +- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) ++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, ++ unsigned int &ecx, unsigned int &edx) + { +- __asm__ __volatile__ ( +- "cpuid" +- : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) +- : /* Input */ "a"(n) +- : /* Clobber */); ++ __get_cpuid(n, &eax, &ebx, &ecx, &edx); + } + + #else // IMF_HAVE_SSE2 && __GNUC__ + + // Helper functions for generic compiler - all disabled +- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) ++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, ++ unsigned int &ecx, unsigned int &edx) + { + eax = ebx = ecx = edx = 0; + } +@@ -64,7 +62,7 @@ namespace { + + #ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX + +- void xgetbv(int n, int &eax, int &edx) ++ void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx) + { + __asm__ __volatile__ ( + "xgetbv" +@@ -75,7 +73,7 @@ namespace { + + #else // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX + +- void xgetbv(int n, int &eax, int &edx) ++ void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx) + { + eax = edx = 0; + } +@@ -94,8 +92,8 @@ CpuId::CpuId(): + f16c(false) + { + bool osxsave = false; +- int max = 0; +- int eax, ebx, ecx, edx; ++ unsigned int max = 0; ++ unsigned int eax, ebx, ecx, edx; + + cpuid(0, max, ebx, ecx, edx); + if (max > 0) |