• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/libfreeimage/0002-fix-cpuid-x86.patch
Thomas PetazzoniThomas Petazzoni committed 21c656bc47e03 May 2015
Raw file
Source viewDiff to previous
 
1
Fix build issue caused by invalid register usage on x86
2
​
3
Patch taken from https://github.com/openexr/openexr/issues/128.
4
​
5
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
6
​
7
Index: b/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp
8
===================================================================
9
--- a/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp
10
+++ b/Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp
11
@@ -40,21 +40,19 @@
12
 
13
 namespace {
14
 #if defined(IMF_HAVE_SSE2) &&  defined(__GNUC__)
15
-
16
+#include <cpuid.h>
17
     // Helper functions for gcc + SSE enabled
18
-    void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
19
+    void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx,
20
+                   unsigned int &ecx, unsigned int &edx)
21
     {
22
-        __asm__ __volatile__ (
23
-            "cpuid"
24
-            : /* Output  */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) 
25
-            : /* Input   */ "a"(n)
26
-            : /* Clobber */);
27
+       __get_cpuid(n, &eax, &ebx, &ecx, &edx);
28
     }
29
 
30
 #else // IMF_HAVE_SSE2 && __GNUC__
31
 
32
     // Helper functions for generic compiler - all disabled
33
-    void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
34
+    void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx,
35
+                   unsigned int &ecx, unsigned int &edx)
36
     {
37
         eax = ebx = ecx = edx = 0;
38
     }
39
@@ -64,7 +62,7 @@
40
 
41
 #ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
42
 
43
-    void xgetbv(int n, int &eax, int &edx)
44
+    void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
45
     {
46
         __asm__ __volatile__ (
47
             "xgetbv"
48
@@ -75,7 +73,7 @@
49
 
50
 #else //  OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
51
 
52
-    void xgetbv(int n, int &eax, int &edx)
53
+    void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
54
     {
55
         eax = edx = 0;
56
     }
57
@@ -94,8 +92,8 @@
58
     f16c(false)
59
 {
60
     bool osxsave = false;
61
-    int  max     = 0;
62
-    int  eax, ebx, ecx, edx;
63
+    unsigned int  max     = 0;
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.