summaryrefslogtreecommitdiffstats
path: root/package/openblas/0002-Rework-__GLIBC_PREREQ-checks-to-avoid-breaking-non-g.patch
blob: 7659ee08884c15763928c6ae267e9dea4e09d02b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
From ad0f270ed32635d8ef9a7446ae280db415cf78ac Mon Sep 17 00:00:00 2001
From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Date: Mon, 31 Jul 2017 21:02:43 +0200
Subject: [PATCH] Rework __GLIBC_PREREQ checks to avoid breaking non-glibc
 builds

[baruch: backported to v0.2.20
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
Upstream status: commit 63cfa32691680

 driver/others/memory.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/driver/others/memory.c b/driver/others/memory.c
index 38d063715602..79d6988e08a4 100644
--- a/driver/others/memory.c
+++ b/driver/others/memory.c
@@ -155,7 +155,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifdef DYNAMIC_ARCH
 gotoblas_t *gotoblas = NULL;
 #endif
-
 extern void openblas_warning(int verbose, const char * msg);
 
 #ifndef SMP
@@ -187,25 +186,24 @@ int i,n;
      
 #if !defined(__GLIBC_PREREQ)
    return nums;
-#endif   
-#if !__GLIBC_PREREQ(2, 3)
+#else
+ #if !__GLIBC_PREREQ(2, 3)
    return nums;
-#endif   
+ #endif
 
-#if !__GLIBC_PREREQ(2, 7)
+ #if !__GLIBC_PREREQ(2, 7)
   ret = sched_getaffinity(0,sizeof(cpu_set_t), cpusetp);
   if (ret!=0) return nums;
   n=0;
-#if !__GLIBC_PREREQ(2, 6)  
+  #if !__GLIBC_PREREQ(2, 6)
   for (i=0;i<nums;i++)
      if (CPU_ISSET(i,cpusetp)) n++;
-  nums=n;   
-#else
+  nums=n;
+  #else
   nums = CPU_COUNT(sizeof(cpu_set_t),cpusetp);
-#endif
+  #endif
   return nums;
-#endif
-
+ #else
   cpusetp = CPU_ALLOC(nums);
   if (cpusetp == NULL) return nums;
   size = CPU_ALLOC_SIZE(nums);
@@ -214,6 +212,8 @@ int i,n;
   nums = CPU_COUNT_S(size,cpusetp);
   CPU_FREE(cpusetp);
   return nums;
+ #endif
+#endif
 }
 #endif
 #endif
-- 
2.17.0

OpenPOWER on IntegriCloud