summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libbsd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/libbsd')
-rw-r--r--meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch376
-rw-r--r--meta/recipes-support/libbsd/libbsd/0001-flopen-Add-missing-fcntl.h-include.patch46
-rw-r--r--meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch52
-rw-r--r--meta/recipes-support/libbsd/libbsd_0.9.1.bb (renamed from meta/recipes-support/libbsd/libbsd_0.8.7.bb)19
4 files changed, 53 insertions, 440 deletions
diff --git a/meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch b/meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch
deleted file mode 100644
index 54617b506b..0000000000
--- a/meta/recipes-support/libbsd/libbsd/0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch
+++ /dev/null
@@ -1,376 +0,0 @@
1From 88adbe1a855b7aa95bd925c80ed83c86f3fc42e3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 6 Nov 2016 09:39:31 -0800
4Subject: [PATCH 1/3] Replace __BEGIN_DECLS and __END_DECLS
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
8---
9Upstream-Status: Pending
10
11 include/bsd/err.h | 10 ++++++++--
12 include/bsd/libutil.h | 10 ++++++++--
13 include/bsd/md5.h | 10 ++++++++--
14 include/bsd/nlist.h | 10 ++++++++--
15 include/bsd/readpassphrase.h | 10 ++++++++--
16 include/bsd/stdio.h | 10 ++++++++--
17 include/bsd/stdlib.h | 12 +++++++++---
18 include/bsd/string.h | 12 +++++++++---
19 include/bsd/stringlist.h | 10 ++++++++--
20 include/bsd/unistd.h | 10 ++++++++--
21 include/bsd/vis.h | 10 ++++++++--
22 include/bsd/wchar.h | 10 ++++++++--
23 src/hash/sha512.h | 10 ++++++++--
24 13 files changed, 106 insertions(+), 28 deletions(-)
25
26diff --git a/include/bsd/err.h b/include/bsd/err.h
27index 12fd051..43dfc32 100644
28--- a/include/bsd/err.h
29+++ b/include/bsd/err.h
30@@ -42,7 +42,10 @@
31
32 #include <stdarg.h>
33
34-__BEGIN_DECLS
35+/* __BEGIN_DECLS */
36+#ifdef __cplusplus
37+extern "C" {
38+#endif
39 void warnc(int code, const char *format, ...)
40 __printflike(2, 3);
41 void vwarnc(int code, const char *format, va_list ap)
42@@ -51,6 +54,9 @@ void errc(int status, int code, const char *format, ...)
43 __printflike(3, 4);
44 void verrc(int status, int code, const char *format, va_list ap)
45 __printflike(3, 0);
46-__END_DECLS
47+#ifdef __cplusplus
48+}
49+#endif
50+/* __END_DECLS */
51
52 #endif
53diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
54index 45b3b15..9c936e5 100644
55--- a/include/bsd/libutil.h
56+++ b/include/bsd/libutil.h
57@@ -53,7 +53,10 @@ struct pidfh {
58 ino_t pf_ino;
59 };
60
61-__BEGIN_DECLS
62+/* __BEGIN_DECLS */
63+#ifdef __cplusplus
64+extern "C" {
65+#endif
66 int humanize_number(char *buf, size_t len, int64_t bytes,
67 const char *suffix, int scale, int flags);
68 int expand_number(const char *_buf, uint64_t *_num);
69@@ -66,7 +69,10 @@ int pidfile_close(struct pidfh *pfh);
70 int pidfile_remove(struct pidfh *pfh);
71
72 char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
73-__END_DECLS
74+#ifdef __cplusplus
75+}
76+#endif
77+/* __END_DECLS */
78
79 /* humanize_number(3) */
80 #define HN_DECIMAL 0x01
81diff --git a/include/bsd/md5.h b/include/bsd/md5.h
82index 5f3ae46..5d80e5c 100644
83--- a/include/bsd/md5.h
84+++ b/include/bsd/md5.h
85@@ -30,7 +30,10 @@ typedef struct MD5Context {
86 #include <sys/cdefs.h>
87 #include <sys/types.h>
88
89-__BEGIN_DECLS
90+/* __BEGIN_DECLS */
91+#ifdef __cplusplus
92+extern "C" {
93+#endif
94 void MD5Init(MD5_CTX *);
95 void MD5Update(MD5_CTX *, const uint8_t *, size_t)
96 __attribute__((__bounded__(__string__,2,3)));
97@@ -49,6 +52,9 @@ char *MD5FileChunk(const char *, char *, off_t, off_t)
98 char *MD5Data(const uint8_t *, size_t, char *)
99 __attribute__((__bounded__(__string__,1,2)))
100 __attribute__((__bounded__(__minbytes__,3,MD5_DIGEST_STRING_LENGTH)));
101-__END_DECLS
102+#ifdef __cplusplus
103+}
104+#endif
105+/* __END_DECLS */
106
107 #endif /* LIBBSD_MD5_H */
108diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h
109index cb297e8..e63bbbd 100644
110--- a/include/bsd/nlist.h
111+++ b/include/bsd/nlist.h
112@@ -88,8 +88,14 @@ struct nlist {
113
114 #define N_FORMAT "%08x" /* namelist value format; XXX */
115
116-__BEGIN_DECLS
117+/* __BEGIN_DECLS */
118+#ifdef __cplusplus
119+extern "C" {
120+#endif
121 extern int nlist(const char *filename, struct nlist *list);
122-__END_DECLS
123+#ifdef __cplusplus
124+}
125+#endif
126+/* __END_DECLS */
127
128 #endif
129diff --git a/include/bsd/readpassphrase.h b/include/bsd/readpassphrase.h
130index 14744b8..fa73361 100644
131--- a/include/bsd/readpassphrase.h
132+++ b/include/bsd/readpassphrase.h
133@@ -34,8 +34,14 @@
134 #include <sys/cdefs.h>
135 #include <sys/types.h>
136
137-__BEGIN_DECLS
138+/* __BEGIN_DECLS */
139+#ifdef __cplusplus
140+extern "C" {
141+#endif
142 char * readpassphrase(const char *, char *, size_t, int);
143-__END_DECLS
144+#ifdef __cplusplus
145+}
146+#endif
147+/* __END_DECLS */
148
149 #endif /* !LIBBSD_READPASSPHRASE_H */
150diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
151index 4b69983..18645b7 100644
152--- a/include/bsd/stdio.h
153+++ b/include/bsd/stdio.h
154@@ -45,7 +45,10 @@
155 #endif
156 #include <sys/types.h>
157
158-__BEGIN_DECLS
159+/* __BEGIN_DECLS */
160+#ifdef __cplusplus
161+extern "C" {
162+#endif
163 const char *fmtcheck(const char *, const char *);
164
165 /* XXX: The function requires cooperation from the system libc to store the
166@@ -73,7 +76,10 @@ FILE *funopen(const void *cookie,
167 #define fwopen(cookie, fn) funopen(cookie, NULL, fn, NULL, NULL)
168
169 int fpurge(FILE *fp);
170-__END_DECLS
171+#ifdef __cplusplus
172+}
173+#endif
174+/* __END_DECLS */
175
176 #endif
177 #endif
178diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
179index ebc9638..c4b54b6 100644
180--- a/include/bsd/stdlib.h
181+++ b/include/bsd/stdlib.h
182@@ -46,7 +46,10 @@
183 #include <sys/stat.h>
184 #include <stdint.h>
185
186-__BEGIN_DECLS
187+/* __BEGIN_DECLS */
188+#ifdef __cplusplus
189+extern "C" {
190+#endif
191 uint32_t arc4random(void);
192 void arc4random_stir(void);
193 void arc4random_addrandom(unsigned char *dat, int datlen);
194@@ -67,7 +70,7 @@ int sradixsort(const unsigned char **base, int nmemb,
195 const unsigned char *table, unsigned endbyte);
196
197 void *reallocf(void *ptr, size_t size);
198-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
199+#if defined(_GNU_SOURCE) && defined(__GLIBC__)
200 void *reallocarray(void *ptr, size_t nmemb, size_t size);
201 #endif
202
203@@ -75,6 +78,9 @@ long long strtonum(const char *nptr, long long minval, long long maxval,
204 const char **errstr);
205
206 char *getbsize(int *headerlenp, long *blocksizep);
207-__END_DECLS
208+#ifdef __cplusplus
209+}
210+#endif
211+/* __END_DECLS */
212
213 #endif
214diff --git a/include/bsd/string.h b/include/bsd/string.h
215index 6798bf6..fa1193f 100644
216--- a/include/bsd/string.h
217+++ b/include/bsd/string.h
218@@ -36,15 +36,21 @@
219 #include <sys/cdefs.h>
220 #include <sys/types.h>
221
222-__BEGIN_DECLS
223+/* __BEGIN_DECLS */
224+#ifdef __cplusplus
225+extern "C" {
226+#endif
227 size_t strlcpy(char *dst, const char *src, size_t siz);
228 size_t strlcat(char *dst, const char *src, size_t siz);
229 char *strnstr(const char *str, const char *find, size_t str_len);
230 void strmode(mode_t mode, char *str);
231
232-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
233+#if defined(_GNU_SOURCE) && defined(__GLIBC__)
234 void explicit_bzero(void *buf, size_t len);
235 #endif
236-__END_DECLS
237+#ifdef __cplusplus
238+}
239+#endif
240+/* __END_DECLS */
241
242 #endif
243diff --git a/include/bsd/stringlist.h b/include/bsd/stringlist.h
244index ff30cac..4600f6b 100644
245--- a/include/bsd/stringlist.h
246+++ b/include/bsd/stringlist.h
247@@ -43,12 +43,18 @@ typedef struct _stringlist {
248 size_t sl_cur;
249 } StringList;
250
251-__BEGIN_DECLS
252+/* __BEGIN_DECLS */
253+#ifdef __cplusplus
254+extern "C" {
255+#endif
256 StringList *sl_init(void);
257 int sl_add(StringList *, char *);
258 void sl_free(StringList *, int);
259 char *sl_find(StringList *, const char *);
260 int sl_delete(StringList *, const char *, int);
261-__END_DECLS
262+#ifdef __cplusplus
263+}
264+#endif
265+/* __END_DECLS */
266
267 #endif /* LIBBSD_STRINGLIST_H */
268diff --git a/include/bsd/unistd.h b/include/bsd/unistd.h
269index 1f9c5f8..5b2f4c7 100644
270--- a/include/bsd/unistd.h
271+++ b/include/bsd/unistd.h
272@@ -45,7 +45,10 @@
273 #define S_ISTXT S_ISVTX
274 #endif
275
276-__BEGIN_DECLS
277+/* __BEGIN_DECLS */
278+#ifdef __cplusplus
279+extern "C" {
280+#endif
281 extern int optreset;
282
283 #ifdef LIBBSD_OVERLAY
284@@ -68,6 +71,9 @@ void setproctitle(const char *fmt, ...)
285 __printflike(1, 2);
286
287 int getpeereid(int s, uid_t *euid, gid_t *egid);
288-__END_DECLS
289+#ifdef __cplusplus
290+}
291+#endif
292+/* __END_DECLS */
293
294 #endif
295diff --git a/include/bsd/vis.h b/include/bsd/vis.h
296index 970dfdd..621d3c6 100644
297--- a/include/bsd/vis.h
298+++ b/include/bsd/vis.h
299@@ -74,7 +74,10 @@
300
301 #include <sys/cdefs.h>
302
303-__BEGIN_DECLS
304+/* __BEGIN_DECLS */
305+#ifdef __cplusplus
306+extern "C" {
307+#endif
308 char *vis(char *, int, int, int);
309 int strvis(char *, const char *, int);
310 int strvisx(char *, const char *, size_t, int);
311@@ -83,6 +86,9 @@ int strunvis(char *, const char *);
312 int strunvisx(char *, const char *, int);
313 ssize_t strnunvis(char *, const char *, size_t);
314 int unvis(char *, int, int *, int);
315-__END_DECLS
316+#ifdef __cplusplus
317+}
318+#endif
319+/* __END_DECLS */
320
321 #endif /* !LIBBSD_VIS_H */
322diff --git a/include/bsd/wchar.h b/include/bsd/wchar.h
323index 33a500e..aa70742 100644
324--- a/include/bsd/wchar.h
325+++ b/include/bsd/wchar.h
326@@ -43,12 +43,18 @@
327 #include <sys/cdefs.h>
328 #include <sys/types.h>
329
330-__BEGIN_DECLS
331+/* __BEGIN_DECLS */
332+#ifdef __cplusplus
333+extern "C" {
334+#endif
335 wchar_t *fgetwln(FILE *stream, size_t *len);
336
337 size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
338 size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
339-__END_DECLS
340+#ifdef __cplusplus
341+}
342+#endif
343+/* __END_DECLS */
344
345 #endif
346 #endif
347diff --git a/src/hash/sha512.h b/src/hash/sha512.h
348index 4f368a1..27ddc24 100644
349--- a/src/hash/sha512.h
350+++ b/src/hash/sha512.h
351@@ -39,7 +39,10 @@ typedef struct SHA512Context {
352 unsigned char buf[128];
353 } SHA512_CTX;
354
355-__BEGIN_DECLS
356+/* __BEGIN_DECLS */
357+#ifdef __cplusplus
358+extern "C" {
359+#endif
360
361 void SHA512_Init(SHA512_CTX *);
362 void SHA512_Update(SHA512_CTX *, const void *, size_t);
363@@ -48,6 +51,9 @@ char *SHA512_End(SHA512_CTX *, char *);
364 char *SHA512_File(const char *, char *);
365 char *SHA512_FileChunk(const char *, char *, off_t, off_t);
366 char *SHA512_Data(const void *, unsigned int, char *);
367-__END_DECLS
368+#ifdef __cplusplus
369+}
370+#endif
371+/* __END_DECLS */
372
373 #endif /* !_SHA512_H_ */
374--
3751.9.1
376
diff --git a/meta/recipes-support/libbsd/libbsd/0001-flopen-Add-missing-fcntl.h-include.patch b/meta/recipes-support/libbsd/libbsd/0001-flopen-Add-missing-fcntl.h-include.patch
new file mode 100644
index 0000000000..8abb876c7b
--- /dev/null
+++ b/meta/recipes-support/libbsd/libbsd/0001-flopen-Add-missing-fcntl.h-include.patch
@@ -0,0 +1,46 @@
1From 13c32916b4baab58d93940d57fea9ff0777f1931 Mon Sep 17 00:00:00 2001
2From: Baruch Siach <baruch@tkos.co.il>
3Date: Tue, 5 Jun 2018 19:21:46 +0300
4Subject: [PATCH] flopen: Add missing <fcntl.h> include
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Commit 993828d84ee (Add flopenat() function from FreeBSD) dropped the
10fcntl.h header. This breaks the build with musl libc:
11
12flopen.c: In function ‘vflopenat’:
13flopen.c:60:14: error: ‘O_CREAT’ undeclared (first use in this function)
14 if (flags & O_CREAT) {
15 ^~~~~~~
16
17Restore the fcntl.h header include to fix the build.
18
19Fixes: commit 993828d84eed0468c6c15b2818e534e6b134b8e4
20Submitted-also-by: parazyd <parazyd@dyne.org>
21Signed-off-by: Baruch Siach <baruch@tkos.co.il>
22Signed-off-by: Guillem Jover <guillem@hadrons.org>
23
24Upstream-Status: Backport
25[https://gitlab.freedesktop.org/libbsd/libbsd/commit/13c32916b4baab58d93940d57fea9ff0777f1931]
26
27Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
28---
29 src/flopen.c | 1 +
30 1 file changed, 1 insertion(+)
31
32diff --git a/src/flopen.c b/src/flopen.c
33index b9972c9..ff20d07 100644
34--- a/src/flopen.c
35+++ b/src/flopen.c
36@@ -32,6 +32,7 @@
37 #include <sys/stat.h>
38
39 #include <errno.h>
40+#include <fcntl.h>
41 #include <stdarg.h>
42 #include <unistd.h>
43
44--
452.7.4
46
diff --git a/meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch b/meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch
deleted file mode 100644
index 60da15eb83..0000000000
--- a/meta/recipes-support/libbsd/libbsd/0002-Remove-funopen.patch
+++ /dev/null
@@ -1,52 +0,0 @@
1From 28fc66e8b848709a2e69dba7f07694248e0154e8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 6 Nov 2016 09:40:43 -0800
4Subject: [PATCH 2/3] Remove funopen()
5
6Musl doesnt have prerequisites for it.
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10Upstream-Status: Inappropriate [musl specific]
11
12 man/Makefile.am | 1 -
13 src/Makefile.am | 1 -
14 test/Makefile.am | 1 -
15 3 files changed, 3 deletions(-)
16
17diff --git a/man/Makefile.am b/man/Makefile.am
18index 28192c0..a22787d 100644
19--- a/man/Makefile.am
20+++ b/man/Makefile.am
21@@ -168,7 +168,6 @@ dist_man_MANS = \
22 fmtcheck.3bsd \
23 fparseln.3bsd \
24 fpurge.3bsd \
25- funopen.3bsd \
26 getbsize.3bsd \
27 getmode.3bsd \
28 getpeereid.3bsd \
29diff --git a/src/Makefile.am b/src/Makefile.am
30index ad83dbf..13225a3 100644
31--- a/src/Makefile.am
32+++ b/src/Makefile.am
33@@ -76,7 +76,6 @@ libbsd_la_SOURCES = \
34 fmtcheck.c \
35 fparseln.c \
36 fpurge.c \
37- funopen.c \
38 getbsize.c \
39 getpeereid.c \
40 hash/md5.c \
41diff --git a/test/Makefile.am b/test/Makefile.am
42index d86539a..b32ed2e 100644
43--- a/test/Makefile.am
44+++ b/test/Makefile.am
45@@ -36,7 +36,6 @@ check_PROGRAMS = \
46 endian \
47 humanize \
48 fgetln \
49- funopen \
50 fparseln \
51 fpurge \
52 md5 \
diff --git a/meta/recipes-support/libbsd/libbsd_0.8.7.bb b/meta/recipes-support/libbsd/libbsd_0.9.1.bb
index 552a85c4da..2a1cd64535 100644
--- a/meta/recipes-support/libbsd/libbsd_0.8.7.bb
+++ b/meta/recipes-support/libbsd/libbsd_0.9.1.bb
@@ -9,16 +9,14 @@ DESCRIPTION = "This library provides useful functions commonly found on BSD syst
9 9
10HOMEPAGE = "http://libbsd.freedesktop.org/wiki/" 10HOMEPAGE = "http://libbsd.freedesktop.org/wiki/"
11# There seems to be more licenses used in the code, I don't think we want to list them all here, complete list: 11# There seems to be more licenses used in the code, I don't think we want to list them all here, complete list:
12# OE @ ~/projects/libbsd $ grep ^License: COPYING | sort 12# OE @ ~/projects/libbsd $ grep ^License: COPYING | sort -u
13# License: BSD-2-clause
14# License: BSD-2-clause 13# License: BSD-2-clause
15# License: BSD-2-clause-NetBSD 14# License: BSD-2-clause-NetBSD
16# License: BSD-2-clause-author 15# License: BSD-2-clause-author
17# License: BSD-2-clause-verbatim 16# License: BSD-2-clause-verbatim
18# License: BSD-3-clause 17# License: BSD-3-clause
19# License: BSD-3-clause 18# License: BSD-3-clause-author
20# License: BSD-3-clause 19# License: BSD-3-clause-John-Birrell
21# License: BSD-3-clause-Peter-Wemm
22# License: BSD-3-clause-Regents 20# License: BSD-3-clause-Regents
23# License: BSD-4-clause-Christopher-G-Demetriou 21# License: BSD-4-clause-Christopher-G-Demetriou
24# License: BSD-4-clause-Niels-Provos 22# License: BSD-4-clause-Niels-Provos
@@ -30,20 +28,17 @@ HOMEPAGE = "http://libbsd.freedesktop.org/wiki/"
30# License: public-domain 28# License: public-domain
31# License: public-domain-Colin-Plumb 29# License: public-domain-Colin-Plumb
32LICENSE = "BSD-4-Clause & ISC & PD" 30LICENSE = "BSD-4-Clause & ISC & PD"
33LIC_FILES_CHKSUM = "file://COPYING;md5=08fc4e66be4526715dab09c5fba5e9e8" 31LIC_FILES_CHKSUM = "file://COPYING;md5=b552602fda69e34c753d26de383f33c5"
34SECTION = "libs" 32SECTION = "libs"
35 33
36SRC_URI = " \ 34SRC_URI = " \
37 http://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ 35 http://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
38 file://0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch \ 36 file://0001-src-libbsd-overlay.pc.in-Set-Cflags-to-use-I-instead.patch \
39" 37 file://0001-flopen-Add-missing-fcntl.h-include.patch \
40SRC_URI_append_libc-musl = " \
41 file://0001-Replace-__BEGIN_DECLS-and-__END_DECLS.patch \
42 file://0002-Remove-funopen.patch \
43" 38"
44 39
45SRC_URI[md5sum] = "d9e6980fbfe44f94fd92b89a33cce67d" 40SRC_URI[md5sum] = "a74b80c4143afa032c90226a4518fffe"
46SRC_URI[sha256sum] = "f548f10e5af5a08b1e22889ce84315b1ebe41505b015c9596bad03fd13a12b31" 41SRC_URI[sha256sum] = "56d835742327d69faccd16955a60b6dcf30684a8da518c4eca0ac713b9e0a7a4"
47 42
48inherit autotools pkgconfig 43inherit autotools pkgconfig
49 44