aboutsummaryrefslogtreecommitdiffstats
path: root/community/ceph/musl-fixes.patch
blob: 6e50e6ba5ba4c86fcee11242283dc4faf939f04c (plain) (blame)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
diff --git a/src/common/secret.c b/src/common/secret.c
index b6f26ec3..1b4531f8 100644
--- a/src/common/secret.c
+++ b/src/common/secret.c
@@ -63,9 +63,18 @@ int set_kernel_secret(const char *secret, const char *key_name)
 
   ret = ceph_unarmor(payload, payload+sizeof(payload), secret, secret+secret_len);
   if (ret < 0) {
-    char error_buf[80];
-    fprintf(stderr, "secret is not valid base64: %s.\n",
-	    strerror_r(-ret, error_buf, sizeof(error_buf)));
+    char error_buf[80] = "unkown error";
+    char *p;
+#if defined(__GLIBC__)
+    p = strerror_r(-ret, error_buf, sizeof(error_buf));
+#else
+    if (strerror_r(-ret, error_buf, sizeof(error_buf)) < 0) {
+      p = "unkown error";
+    } else {
+      p = error_buf;
+    }
+#endif
+    fprintf(stderr, "secret is not valid base64: %s.\n", p);
     return ret;
   }
 
diff --git a/src/dmclock/src/dmclock_util.cc b/src/dmclock/src/dmclock_util.cc
index e8046cdc..aa9000bc 100644
--- a/src/dmclock/src/dmclock_util.cc
+++ b/src/dmclock/src/dmclock_util.cc
@@ -21,7 +21,7 @@
 #include "dmclock_util.h"
 
 
-std::string crimson::dmclock::format_time(const Time& time, uint modulo) {
+std::string crimson::dmclock::format_time(const Time& time, unsigned int modulo) {
   long subtract = long(time / modulo) * modulo;
   std::stringstream ss;
   ss << std::fixed << std::setprecision(4) << (time - subtract);
diff --git a/src/dmclock/src/dmclock_util.h b/src/dmclock/src/dmclock_util.h
index d3fd3f19..ee8b6c3a 100644
--- a/src/dmclock/src/dmclock_util.h
+++ b/src/dmclock/src/dmclock_util.h
@@ -52,7 +52,7 @@ namespace crimson {
 #endif
     }
 
-    std::string format_time(const Time& time, uint modulo = 1000);
+    std::string format_time(const Time& time, unsigned int modulo = 1000);
 
     void debugger();
 
diff --git a/src/seastar/dpdk/config/common_base b/src/seastar/dpdk/config/common_base
index 8907bea3..6d3f7577 100644
--- a/src/seastar/dpdk/config/common_base
+++ b/src/seastar/dpdk/config/common_base
@@ -96,7 +96,7 @@ CONFIG_RTE_MAX_TAILQ=32
 CONFIG_RTE_LOG_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_HISTORY=256
-CONFIG_RTE_BACKTRACE=y
+CONFIG_RTE_BACKTRACE=n
 CONFIG_RTE_LIBEAL_USE_HPET=n
 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
diff --git a/src/spdk/dpdk/config/common_base b/src/spdk/dpdk/config/common_base
index d5fbb3a4..d9561545 100644
--- a/src/spdk/dpdk/config/common_base
+++ b/src/spdk/dpdk/config/common_base
@@ -80,7 +80,7 @@ CONFIG_RTE_MAX_TAILQ=32
 CONFIG_RTE_ENABLE_ASSERT=n
 CONFIG_RTE_LOG_DP_LEVEL=RTE_LOG_INFO
 CONFIG_RTE_LOG_HISTORY=256
-CONFIG_RTE_BACKTRACE=y
+CONFIG_RTE_BACKTRACE=n
 CONFIG_RTE_LIBEAL_USE_HPET=n
 CONFIG_RTE_EAL_ALLOW_INV_SOCKET_ID=n
 CONFIG_RTE_EAL_ALWAYS_PANIC_ON_ERROR=n
diff --git a/src/spdk/dpdk/config/rte_config.h b/src/spdk/dpdk/config/rte_config.h
index a8e47977..7599bd39 100644
--- a/src/spdk/dpdk/config/rte_config.h
+++ b/src/spdk/dpdk/config/rte_config.h
@@ -30,7 +30,7 @@
 #define RTE_MAX_MEMZONE 2560
 #define RTE_MAX_TAILQ 32
 #define RTE_LOG_DP_LEVEL RTE_LOG_INFO
-#define RTE_BACKTRACE 1
+//#define RTE_BACKTRACE 1
 #define RTE_EAL_VFIO 1
 #define RTE_MAX_VFIO_CONTAINERS 64
 
diff --git a/src/spdk/dpdk/drivers/bus/pci/linux/pci_uio.c b/src/spdk/dpdk/drivers/bus/pci/linux/pci_uio.c
index a7c14421..aff241e8 100644
--- a/src/spdk/dpdk/drivers/bus/pci/linux/pci_uio.c
+++ b/src/spdk/dpdk/drivers/bus/pci/linux/pci_uio.c
@@ -14,6 +14,32 @@
 
 #if defined(RTE_ARCH_X86)
 #include <sys/io.h>
+#if defined(__GLIBC__)
+#define pci_uio_outl_p outl_p
+#define pci_uio_outw_p outw_p
+#define pci_uio_outb_p outb_p
+#else
+static inline void
+pci_uio_outl_p(unsigned int value, unsigned short int port)
+{
+	__asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80" : : "a" (value),
+			      "Nd" (port));
+}
+
+static inline void
+pci_uio_outw_p(unsigned short int value, unsigned short int port)
+{
+	__asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80" : : "a" (value),
+			      "Nd" (port));
+}
+
+static inline void
+pci_uio_outb_p(unsigned char value, unsigned short int port)
+{
+	__asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80" : : "a" (value),
+			      "Nd" (port));
+}
+#endif
 #endif
 
 #include <rte_log.h>
@@ -527,21 +553,21 @@ pci_uio_ioport_write(struct rte_pci_ioport *p,
 		if (len >= 4) {
 			size = 4;
 #if defined(RTE_ARCH_X86)
-			outl_p(*(const uint32_t *)s, reg);
+			pci_uio_outl_p(*(const uint32_t *)s, reg);
 #else
 			*(volatile uint32_t *)reg = *(const uint32_t *)s;
 #endif
 		} else if (len >= 2) {
 			size = 2;
 #if defined(RTE_ARCH_X86)
-			outw_p(*(const uint16_t *)s, reg);
+			pci_uio_outw_p(*(const uint16_t *)s, reg);
 #else
 			*(volatile uint16_t *)reg = *(const uint16_t *)s;
 #endif
 		} else {
 			size = 1;
 #if defined(RTE_ARCH_X86)
-			outb_p(*s, reg);
+			pci_uio_outb_p(*s, reg);
 #else
 			*(volatile uint8_t *)reg = *s;
 #endif
diff --git a/src/spdk/dpdk/lib/librte_eal/common/eal_common_fbarray.c b/src/spdk/dpdk/lib/librte_eal/common/eal_common_fbarray.c
index ba6c4ae3..b9b7d70d 100644
--- a/src/spdk/dpdk/lib/librte_eal/common/eal_common_fbarray.c
+++ b/src/spdk/dpdk/lib/librte_eal/common/eal_common_fbarray.c
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <sys/file.h>
 #include <string.h>
+#include <fcntl.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
diff --git a/src/spdk/dpdk/lib/librte_eal/common/malloc_heap.c b/src/spdk/dpdk/lib/librte_eal/common/malloc_heap.c
index 02a5385d..cf063d5f 100644
--- a/src/spdk/dpdk/lib/librte_eal/common/malloc_heap.c
+++ b/src/spdk/dpdk/lib/librte_eal/common/malloc_heap.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2010-2014 Intel Corporation
  */
+ #include<string.h>
 #include <stdint.h>
 #include <stddef.h>
 #include <stdlib.h>
diff --git a/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
index 3a7d4b22..99b25d3c 100644
--- a/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
+++ b/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
@@ -17,6 +17,7 @@
 #include <sys/mman.h>
 #include <sys/queue.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 
 #include <linux/mman.h> /* for hugetlb-related flags */
 
diff --git a/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c b/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c
index 0bf2aef3..0c98c74c 100644
--- a/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/src/spdk/dpdk/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -15,6 +15,7 @@
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 #include <sys/queue.h>
 #include <sys/file.h>
 #include <unistd.h>
diff --git a/src/spdk/dpdk/mk/target/generic/rte.vars.mk b/src/spdk/dpdk/mk/target/generic/rte.vars.mk
index 98085cd3..dd149acc 100644
--- a/src/spdk/dpdk/mk/target/generic/rte.vars.mk
+++ b/src/spdk/dpdk/mk/target/generic/rte.vars.mk
@@ -108,6 +108,9 @@ CFLAGS += -include $(RTE_SDK_BIN)/include/rte_config.h
 LDFLAGS += -L$(RTE_SDK_BIN)/lib
 endif
 
+# always define _GNU_SOURCE
+CFLAGS += -D_GNU_SOURCE
+
 export CFLAGS
 export LDFLAGS
 
diff --git a/src/tools/rbd_nbd/rbd-nbd.cc b/src/tools/rbd_nbd/rbd-nbd.cc
index cce44e4f..b0988e64 100644
--- a/src/tools/rbd_nbd/rbd-nbd.cc
+++ b/src/tools/rbd_nbd/rbd-nbd.cc
@@ -552,7 +552,8 @@ private:
     for (unsigned i = 0; i < cmdline.size(); i++) {
       const char *arg = &cmdline[i];
       if (i == 0) {
-        if (strcmp(basename(arg) , "rbd-nbd") != 0) {
+        const char *fname = strrchr(arg, '/');
+        if (strcmp(fname ? fname+1 : arg, "rbd-nbd") != 0) {
           return -EINVAL;
         }
       } else {