atftp: fixes musl libc build
PATCH v2 1/1 atftp: fixes musl libc build
From: Ming Liu <[email protected]>
The patches derive from buildroot:
https://git.busybox.net/buildroot/commit/?id=ef33c008e3c5048d1442f8b0f6336db2fa8d79a1
Adjust __BEGIN_DECLS/__END_DECLS defines according to:
http://wiki.musl-libc.org/wiki/FAQ
Signed-off-by Ming Liu <[email protected]>
--- .../atftp/atftp-0.7_add_missing_defines.patch | 65 ++++++++++++++++++++++ .../atftp/atftp-0.7_add_missing_include.patch | 43 ++++++++++++++ meta-networking/recipes-daemons/atftp/atftp_git.bb | 3 + 3 files changed, 111 insertions(+) create mode 100644 meta-networking/recipes-daemons/atftp/atftp/atftp-0.7_add_missing_defines.patch create mode 100644 meta-networking/recipes-daemons/atftp/atftp/atftp-0.7_add_missing_include.patch
meta-networking/recipes-daemons/atftp/atftp/atftp-0.7_add_missing_defines.patch new file +65 -0
@@ -0,0 +1,65 @@ +From 6d597493131b19aa78c1cecd63ac4e266bb50df8 Mon Sep 17 00:00:00 2001 +From: Peter Liu <[email protected]> +Date: Thu, 20 Oct 2016 14:31:30 +0200 +Subject: [PATCH] argz.h: fix compiling (add missing defines) + +Use extern "C" instead of __BEGIN_DECL/__END_DECL macros, these macros +are defined in sys/cdefs.h for glibc and this header is not available +on all libc. + +Also define __attribute_pure__ if it's not defined. + +Upstream-Status: Pending + +Signed-off-by: Peter Liu <[email protected]> +--- + argz.h | 22 ++++++++++++++++++++-- + 1 file changed, 20 insertions(+), 2 deletions(-) + +diff --git a/argz.h b/argz.h +index 582be55..11e1431 100644 +--- a/argz.h ++++ b/argz.h +@@ -48,12 +48,28 @@ + # define __const const + #endif + ++#ifndef __attribute_pure__ ++# define __attribute_pure__ ++#endif ++ + #ifndef __error_t_defined + typedef int error_t; + #endif + ++#ifndef __THROW ++# ifndef __GNUC_PREREQ ++# define __GNUC_PREREQ(maj, min) (0) ++# endif ++# if defined __cplusplus && __GNUC_PREREQ (2,8) ++# define __THROW throw () ++# else ++# define __THROW ++# endif ++#endif + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + + /* Make a '\0' separated arg vector from a unix argv vector, returning it in + ARGZ, and the total length in LEN. If a memory allocation error occurs, +@@ -200,6 +216,8 @@ argz_next (__const char *__argz, size_t __argz_len, + } + #endif /* Use extern inlines. */ + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* argz.h */ +-- +1.9.1 +
meta-networking/recipes-daemons/atftp/atftp/atftp-0.7_add_missing_include.patch new file +43 -0
43 lines not on this page · raw message
meta-networking/recipes-daemons/atftp/atftp_git.bb +3 -0
@@ -14,7 +14,10 @@ SRC_URI = "git://git.code.sf.net/p/atftp/code \ file://atftpd.init \ file://atftpd.service \ file://atftp-0.7-sorcerers_apprentice.patch \ + file://atftp-0.7_add_missing_defines.patch \ + file://atftp-0.7_add_missing_include.patch \ " + S = "${WORKDIR}/git" inherit autotools update-rc.d systemd
Signature · 1 line
1.9.1