summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/liburcu
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-08-23 18:40:43 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-30 12:35:55 +0100
commita95269ab18fc1ac802dfc7f82bbc2d0a82695e51 (patch)
tree4f5f68282f11b06243485de8e737d6650e9a336d /meta/recipes-support/liburcu
parent506c5645ee066b3a9f7bb93fe591389c5357f3cb (diff)
downloadpoky-a95269ab18fc1ac802dfc7f82bbc2d0a82695e51.tar.gz
liburcu: Fix atomic function parameter types in calls
__sync_val_compare_and_swap family specifically asks for proper types of pointer type parameters, gcc does not notice it but clang does and sends out errors calling it out. (From OE-Core rev: 2767b6be71ca809f4a39ba9b8707b311b8334434) (From OE-Core rev: 5a514163bc805e7f59405c0074cb577cf72b9f39) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/liburcu')
-rw-r--r--meta/recipes-support/liburcu/liburcu/0001-uatomic-Specify-complete-types-for-atomic-function-c.patch158
-rw-r--r--meta/recipes-support/liburcu/liburcu_0.8.7.bb1
2 files changed, 159 insertions, 0 deletions
diff --git a/meta/recipes-support/liburcu/liburcu/0001-uatomic-Specify-complete-types-for-atomic-function-c.patch b/meta/recipes-support/liburcu/liburcu/0001-uatomic-Specify-complete-types-for-atomic-function-c.patch
new file mode 100644
index 0000000000..5ad0bbd159
--- /dev/null
+++ b/meta/recipes-support/liburcu/liburcu/0001-uatomic-Specify-complete-types-for-atomic-function-c.patch
@@ -0,0 +1,158 @@
1From 6af790818d074c103c4797f1ce764896f183e028 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 22 Aug 2015 21:35:03 -0700
4Subject: [PATCH] uatomic: Specify complete types for atomic function calls
5
6This was unearthed by clang compiler where it complained about parameter
7mismatch, gcc doesnt notice this
8
9urcu/uatomic/generic.h:190:10: error: address argument to atomic builtin
10must be a pointer to integer or pointer ('void *' invalid)
11 return __sync_add_and_fetch_4(addr, val);
12
13Fixed all instances thusly
14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17Upstream-Status: Submitted
18
19 urcu/uatomic/generic.h | 40 ++++++++++++++++++++--------------------
20 1 file changed, 20 insertions(+), 20 deletions(-)
21
22diff --git a/urcu/uatomic/generic.h b/urcu/uatomic/generic.h
23index 37f59cc..0046ffd 100644
24--- a/urcu/uatomic/generic.h
25+++ b/urcu/uatomic/generic.h
26@@ -65,17 +65,17 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
27 switch (len) {
28 #ifdef UATOMIC_HAS_ATOMIC_BYTE
29 case 1:
30- return __sync_val_compare_and_swap_1(addr, old, _new);
31+ return __sync_val_compare_and_swap_1((unsigned char *)addr, old, _new);
32 #endif
33 #ifdef UATOMIC_HAS_ATOMIC_SHORT
34 case 2:
35- return __sync_val_compare_and_swap_2(addr, old, _new);
36+ return __sync_val_compare_and_swap_2((unsigned short int *)addr, old, _new);
37 #endif
38 case 4:
39- return __sync_val_compare_and_swap_4(addr, old, _new);
40+ return __sync_val_compare_and_swap_4((unsigned int *)addr, old, _new);
41 #if (CAA_BITS_PER_LONG == 64)
42 case 8:
43- return __sync_val_compare_and_swap_8(addr, old, _new);
44+ return __sync_val_compare_and_swap_8((unsigned long *)addr, old, _new);
45 #endif
46 }
47 _uatomic_link_error();
48@@ -100,20 +100,20 @@ void _uatomic_and(void *addr, unsigned long val,
49 switch (len) {
50 #ifdef UATOMIC_HAS_ATOMIC_BYTE
51 case 1:
52- __sync_and_and_fetch_1(addr, val);
53+ __sync_and_and_fetch_1((unsigned char *)addr, val);
54 return;
55 #endif
56 #ifdef UATOMIC_HAS_ATOMIC_SHORT
57 case 2:
58- __sync_and_and_fetch_2(addr, val);
59+ __sync_and_and_fetch_2((unsigned short int *)addr, val);
60 return;
61 #endif
62 case 4:
63- __sync_and_and_fetch_4(addr, val);
64+ __sync_and_and_fetch_4((unsigned int *)addr, val);
65 return;
66 #if (CAA_BITS_PER_LONG == 64)
67 case 8:
68- __sync_and_and_fetch_8(addr, val);
69+ __sync_and_and_fetch_8((unsigned long *)addr, val);
70 return;
71 #endif
72 }
73@@ -139,20 +139,20 @@ void _uatomic_or(void *addr, unsigned long val,
74 switch (len) {
75 #ifdef UATOMIC_HAS_ATOMIC_BYTE
76 case 1:
77- __sync_or_and_fetch_1(addr, val);
78+ __sync_or_and_fetch_1((unsigned char *)addr, val);
79 return;
80 #endif
81 #ifdef UATOMIC_HAS_ATOMIC_SHORT
82 case 2:
83- __sync_or_and_fetch_2(addr, val);
84+ __sync_or_and_fetch_2((unsigned short int *)addr, val);
85 return;
86 #endif
87 case 4:
88- __sync_or_and_fetch_4(addr, val);
89+ __sync_or_and_fetch_4((unsigned int *)addr, val);
90 return;
91 #if (CAA_BITS_PER_LONG == 64)
92 case 8:
93- __sync_or_and_fetch_8(addr, val);
94+ __sync_or_and_fetch_8((unsigned long *)addr, val);
95 return;
96 #endif
97 }
98@@ -180,17 +180,17 @@ unsigned long _uatomic_add_return(void *addr, unsigned long val,
99 switch (len) {
100 #ifdef UATOMIC_HAS_ATOMIC_BYTE
101 case 1:
102- return __sync_add_and_fetch_1(addr, val);
103+ return __sync_add_and_fetch_1((unsigned char *)addr, val);
104 #endif
105 #ifdef UATOMIC_HAS_ATOMIC_SHORT
106 case 2:
107- return __sync_add_and_fetch_2(addr, val);
108+ return __sync_add_and_fetch_2((unsigned short int *)addr, val);
109 #endif
110 case 4:
111- return __sync_add_and_fetch_4(addr, val);
112+ return __sync_add_and_fetch_4((unsigned int *)addr, val);
113 #if (CAA_BITS_PER_LONG == 64)
114 case 8:
115- return __sync_add_and_fetch_8(addr, val);
116+ return __sync_add_and_fetch_8((unsigned long *)addr, val);
117 #endif
118 }
119 _uatomic_link_error();
120@@ -218,7 +218,7 @@ unsigned long _uatomic_exchange(void *addr, unsigned long val, int len)
121
122 do {
123 old = uatomic_read((unsigned char *)addr);
124- } while (!__sync_bool_compare_and_swap_1(addr, old, val));
125+ } while (!__sync_bool_compare_and_swap_1((unsigned char *)addr, old, val));
126
127 return old;
128 }
129@@ -230,7 +230,7 @@ unsigned long _uatomic_exchange(void *addr, unsigned long val, int len)
130
131 do {
132 old = uatomic_read((unsigned short *)addr);
133- } while (!__sync_bool_compare_and_swap_2(addr, old, val));
134+ } while (!__sync_bool_compare_and_swap_2((unsigned short int *)addr, old, val));
135
136 return old;
137 }
138@@ -241,7 +241,7 @@ unsigned long _uatomic_exchange(void *addr, unsigned long val, int len)
139
140 do {
141 old = uatomic_read((unsigned int *)addr);
142- } while (!__sync_bool_compare_and_swap_4(addr, old, val));
143+ } while (!__sync_bool_compare_and_swap_4((unsigned int *)addr, old, val));
144
145 return old;
146 }
147@@ -252,7 +252,7 @@ unsigned long _uatomic_exchange(void *addr, unsigned long val, int len)
148
149 do {
150 old = uatomic_read((unsigned long *)addr);
151- } while (!__sync_bool_compare_and_swap_8(addr, old, val));
152+ } while (!__sync_bool_compare_and_swap_8((unsigned long *)addr, old, val));
153
154 return old;
155 }
156--
1572.1.4
158
diff --git a/meta/recipes-support/liburcu/liburcu_0.8.7.bb b/meta/recipes-support/liburcu/liburcu_0.8.7.bb
index 71cb149d95..a7f4f51b5b 100644
--- a/meta/recipes-support/liburcu/liburcu_0.8.7.bb
+++ b/meta/recipes-support/liburcu/liburcu_0.8.7.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=0f060c30a27922ce9c0d557a639b4fa3 \
10SRC_URI = "http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \ 10SRC_URI = "http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \
11 file://Revert-Blacklist-ARM-gcc-4.8.0-4.8.1-4.8.2.patch \ 11 file://Revert-Blacklist-ARM-gcc-4.8.0-4.8.1-4.8.2.patch \
12 file://aarch64.patch \ 12 file://aarch64.patch \
13 file://0001-uatomic-Specify-complete-types-for-atomic-function-c.patch \
13 " 14 "
14 15
15SRC_URI[md5sum] = "7a6ee17871d31226db3f618e28351d22" 16SRC_URI[md5sum] = "7a6ee17871d31226db3f618e28351d22"