All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl
  2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
@ 2016-08-12 20:49 ` Yann E. MORIN
  2016-08-12 21:30   ` Khem Raj
                     ` (2 more replies)
  2016-08-12 20:49 ` [Buildroot] [PATCH 2/8] package/rpcbind: include cdefs.h where needed Yann E. MORIN
                   ` (7 subsequent siblings)
  8 siblings, 3 replies; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 20:49 UTC (permalink / raw)
  To: buildroot

musl provides neither sys/queue.h nor sys/cdefs.h. Those two headers are
however quite widely used in a lot of packages (though they should at
least not use cdefs,h which is only full of mostly-legacy macros, and
which is mostly an internal header of glibc and was never really meant to
be exposed to, and used by packages).

But we don;t live in an ideal world, so a lot of packages break when
those two headers are missing.

We already took care of sys/queue.h with the netbsd-queue package. But
the need for cdefs.h is getting more and more pressing.

We rename the netbsd-queue package into musl-compat-headers, and we
make it install sys/queue.h (from NetBSD) and sys/cdefs.h (a minimalist
one we bundle in Buildroot). We can't use the cdefs.h from NetBSD
because it includes machine-dependent headers; instead we bundle a very
minimalistic one, that covers only what we need.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/Config.in                                  |  2 +-
 package/musl-compat-headers/Config.in              |  2 ++
 package/musl-compat-headers/cdefs.h                | 40 ++++++++++++++++++++++
 .../musl-compat-headers.hash}                      |  0
 package/musl-compat-headers/musl-compat-headers.mk | 29 ++++++++++++++++
 package/musl/Config.in                             |  3 +-
 package/musl/musl.mk                               | 10 +++---
 package/netbsd-queue/Config.in                     |  2 --
 package/netbsd-queue/netbsd-queue.mk               | 24 -------------
 toolchain/toolchain-external/Config.in             |  3 +-
 toolchain/toolchain-external/toolchain-external.mk | 10 +++---
 11 files changed, 88 insertions(+), 37 deletions(-)
 create mode 100644 package/musl-compat-headers/Config.in
 create mode 100644 package/musl-compat-headers/cdefs.h
 rename package/{netbsd-queue/netbsd-queue.hash => musl-compat-headers/musl-compat-headers.hash} (100%)
 create mode 100644 package/musl-compat-headers/musl-compat-headers.mk
 delete mode 100644 package/netbsd-queue/Config.in
 delete mode 100644 package/netbsd-queue/netbsd-queue.mk

diff --git a/package/Config.in b/package/Config.in
index 645fa29..1e51a45 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1324,7 +1324,7 @@ endif
 	source "package/mpfr/Config.in"
 	source "package/msgpack/Config.in"
 	source "package/mtdev2tuio/Config.in"
-	source "package/netbsd-queue/Config.in"
+	source "package/musl-compat-headers/Config.in"
 	source "package/openblas/Config.in"
 	source "package/orc/Config.in"
 	source "package/p11-kit/Config.in"
diff --git a/package/musl-compat-headers/Config.in b/package/musl-compat-headers/Config.in
new file mode 100644
index 0000000..c672f9c
--- /dev/null
+++ b/package/musl-compat-headers/Config.in
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_MUSL_COMPAT_HEADERS
+	bool
diff --git a/package/musl-compat-headers/cdefs.h b/package/musl-compat-headers/cdefs.h
new file mode 100644
index 0000000..0a78b8f
--- /dev/null
+++ b/package/musl-compat-headers/cdefs.h
@@ -0,0 +1,40 @@
+/* Copyright (C) 2016 Yann E. MORI <yann.morin.1998@free.fr>
+ *
+ * This file is in the Public Domain.
+ *
+ * For jurisdictions in which the Public Domain does not exist
+ * or it is not otherwise applicable, this file is licensed CC0
+ * (Creative Commons Zero).
+ */
+
+/* This file contains definitions for non-standard macros defined by
+ * glibc, but quite commonly used in packages.
+ *
+ * Because they are non-standard, musl does not define those macros.
+ * It does not provide cdefs.h either.
+ *
+ * This file is a compatibility header written from scratch, to be
+ * installed when the C library is musl.
+ *
+ * Not all macros from the glibc's cdefs.h are available, only the
+ * most commonly used ones.
+ *
+ * Please refer to the glibc documentation and source code for
+ * explanations about those macros.
+ */
+
+#ifndef BUILDROOT_SYS_CDEFS_H
+#define BUILDROOT_SYS_CDEFS_H
+
+#undef __P
+#define __P(arg) arg
+
+#ifdef __cplusplus
+#define __BEGIN_DECLS extern "C" {
+#define __END_DECLS   }
+#else
+#define __BEGIN_DECLS
+#define __END_DECLS
+#endif
+
+#endif /* ifndef BUILDROOT_SYS_CDEFS_H */
diff --git a/package/netbsd-queue/netbsd-queue.hash b/package/musl-compat-headers/musl-compat-headers.hash
similarity index 100%
rename from package/netbsd-queue/netbsd-queue.hash
rename to package/musl-compat-headers/musl-compat-headers.hash
diff --git a/package/musl-compat-headers/musl-compat-headers.mk b/package/musl-compat-headers/musl-compat-headers.mk
new file mode 100644
index 0000000..0758021
--- /dev/null
+++ b/package/musl-compat-headers/musl-compat-headers.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# musl-compat-headers
+#
+################################################################################
+
+MUSL_COMPAT_HEADERS_SITE = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys
+MUSL_COMPAT_HEADERS_VERSION = 1.70
+MUSL_COMPAT_HEADERS_SOURCE = queue.h?rev=$(MUSL_COMPAT_HEADERS_VERSION)
+MUSL_COMPAT_HEADERS_LICENSE = BSD-3c, Public Domain or CC0
+
+MUSL_COMPAT_HEADERS_ADD_TOOLCHAIN_DEPENDENCY = NO
+
+# Only installs headers
+MUSL_COMPAT_HEADERS_INSTALL_TARGET = NO
+MUSL_COMPAT_HEADERS_INSTALL_STAGING = YES
+
+define MUSL_COMPAT_HEADERS_EXTRACT_CMDS
+	cp $(DL_DIR)/$(MUSL_COMPAT_HEADERS_SOURCE) $(@D)/queue.h
+endef
+
+define MUSL_COMPAT_HEADERS_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/queue.h \
+		$(STAGING_DIR)/usr/include/sys/queue.h
+	$(INSTALL) -D -m 0644 $(MUSL_COMPAT_HEADERS_PKGDIR)/cdefs.h \
+		$(STAGING_DIR)/usr/include/sys/cdefs.h
+endef
+
+$(eval $(generic-package))
diff --git a/package/musl/Config.in b/package/musl/Config.in
index c263006..18ae69d 100644
--- a/package/musl/Config.in
+++ b/package/musl/Config.in
@@ -3,5 +3,6 @@ config BR2_PACKAGE_MUSL
 	depends on BR2_TOOLCHAIN_USES_MUSL
 	default y
 	select BR2_PACKAGE_LINUX_HEADERS
-	select BR2_PACKAGE_NETBSD_QUEUE
 	select BR2_TOOLCHAIN_HAS_SSP
+	# Compatibility headers: cdefs.h, queue.h
+	select BR2_PACKAGE_MUSL_COMPAT_HEADERS
diff --git a/package/musl/musl.mk b/package/musl/musl.mk
index 920bbbf..f8ea377 100644
--- a/package/musl/musl.mk
+++ b/package/musl/musl.mk
@@ -13,10 +13,12 @@ MUSL_LICENSE_FILES = COPYRIGHT
 # cross-compiler and the kernel headers
 MUSL_DEPENDENCIES = host-gcc-initial linux-headers
 
-# musl does not provide a sys/queue.h implementation, so add the
-# netbsd-queue package that will install a sys/queue.h file in the
-# staging directory based on the NetBSD implementation.
-MUSL_DEPENDENCIES += netbsd-queue
+# musl does not provide an implementation for sys/queue.h or sys/cdefs.h. So,
+# add the netbsd-compat-headers package that will install those files, into
+# the staging directory:
+#   sys/queue.h:  header from NetBSD
+#   sys/cdefs.h:  minimalist header bundled in Buildroot
+MUSL_DEPENDENCIES += musl-compat-headers
 
 # musl is part of the toolchain so disable the toolchain dependency
 MUSL_ADD_TOOLCHAIN_DEPENDENCY = NO
diff --git a/package/netbsd-queue/Config.in b/package/netbsd-queue/Config.in
deleted file mode 100644
index 7837f4c..0000000
--- a/package/netbsd-queue/Config.in
+++ /dev/null
@@ -1,2 +0,0 @@
-config BR2_PACKAGE_NETBSD_QUEUE
-	bool
diff --git a/package/netbsd-queue/netbsd-queue.mk b/package/netbsd-queue/netbsd-queue.mk
deleted file mode 100644
index 5fd926b..0000000
--- a/package/netbsd-queue/netbsd-queue.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-#
-# netbsd-queue
-#
-################################################################################
-
-NETBSD_QUEUE_VERSION = 1.70
-NETBSD_QUEUE_SITE = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys
-NETBSD_QUEUE_SOURCE = queue.h?rev=$(NETBSD_QUEUE_VERSION)
-NETBSD_QUEUE_LICENSE = BSD-3c
-
-NETBSD_QUEUE_ADD_TOOLCHAIN_DEPENDENCY = NO
-NETBSD_QUEUE_INSTALL_STAGING = YES
-
-define NETBSD_QUEUE_EXTRACT_CMDS
-	cp $(DL_DIR)/$(NETBSD_QUEUE_SOURCE) $(@D)/queue.h
-endef
-
-define NETBSD_QUEUE_INSTALL_STAGING_CMDS
-	$(INSTALL) -D -m 0644 $(@D)/queue.h \
-		$(STAGING_DIR)/usr/include/sys/queue.h
-endef
-
-$(eval $(generic-package))
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index f54fbee..63b7712 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -727,7 +727,8 @@ config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
 config BR2_TOOLCHAIN_EXTERNAL_MUSL
 	bool
 	select BR2_TOOLCHAIN_USES_MUSL
-	select BR2_PACKAGE_NETBSD_QUEUE
+	# Compatibility headers: cdefs.h, queue.h
+	select BR2_PACKAGE_MUSL_COMPAT_HEADERS
 
 if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
 
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 29c1f36..967f022 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -246,11 +246,13 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float
 TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
 endif
 
-# musl does not provide a sys/queue.h implementation, so add the
-# netbsd-queue package that will install a sys/queue.h file in the
-# staging directory based on the NetBSD implementation.
+# musl does not provide an implementation for sys/queue.h or sys/cdefs.h. So,
+# add the netbsd-compat-headers package that will install those files, into
+# the staging directory:
+#   sys/queue.h:  header from NetBSD
+#   sys/cdefs.h:  minimalist header bundled in Buildroot
 ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
-TOOLCHAIN_EXTERNAL_DEPENDENCIES += netbsd-queue
+TOOLCHAIN_EXTERNAL_DEPENDENCIES += musl-compat-headers
 endif
 
 # The Linaro toolchain expects the libraries in
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 2/8] package/rpcbind: include cdefs.h where needed
  2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
  2016-08-12 20:49 ` [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl Yann E. MORIN
@ 2016-08-12 20:49 ` Yann E. MORIN
  2016-08-14 21:21   ` Arnout Vandecappelle
  2016-08-12 20:49 ` [Buildroot] [PATCH 3/8] package/aircrack-ng: drop a musl-compatibility patch Yann E. MORIN
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 20:49 UTC (permalink / raw)
  To: buildroot

rpcbind uses a macro defined in sys/cdefs.h but does not included it
explicitly, relying on the glibc behaviour to include it from its own
headers.

Now that we also have a sys/cdefs.h for musl (which completes the triade
glibc/uClibc/musl), sys/cdefs.h is always available.

Fixes:
    http://autobuild.buildroot.org/results/346/346c5b562c244ddb039db2f86f71d670a01ed9ce/
    http://autobuild.buildroot.org/results/d77/d77454265c45539178c008c5d92509c441447675/
    and numerous such autobuild failures

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...003-src-include-cdefs.h-for-the-__P-macro.patch | 126 +++++++++++++++++++++
 1 file changed, 126 insertions(+)
 create mode 100644 package/rpcbind/0003-src-include-cdefs.h-for-the-__P-macro.patch

diff --git a/package/rpcbind/0003-src-include-cdefs.h-for-the-__P-macro.patch b/package/rpcbind/0003-src-include-cdefs.h-for-the-__P-macro.patch
new file mode 100644
index 0000000..0cae0cf
--- /dev/null
+++ b/package/rpcbind/0003-src-include-cdefs.h-for-the-__P-macro.patch
@@ -0,0 +1,126 @@
+From 50ce1b2e3158f0fd1102b7f56d9264057a1a0c01 Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <yann.morin.1998@free.fr>
+Date: Fri, 12 Aug 2016 00:06:28 +0200
+Subject: [PATCH] src: include cdefs.h for the __P() macro
+
+The __P() macro is defined in cdefs.h, so we must include it explcitly
+rather than relying on it being included by another header.
+
+cdefs.h is a glibc-ism; glibc includes it almost everywhere form its own
+headers. So it automatically gets included for glibc.
+
+However, cdefs.h is not present in musl, so its headers do not include
+it. We must thus include it when we need __P() (of course, one will have
+to provide his own cdefs.h in this case).
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+---
+ src/check_bound.c  | 1 +
+ src/pmap_svc.c     | 1 +
+ src/rpcb_svc.c     | 1 +
+ src/rpcb_svc_4.c   | 1 +
+ src/rpcb_svc_com.c | 1 +
+ src/rpcbind.c      | 1 +
+ src/util.c         | 1 +
+ src/warmstart.c    | 1 +
+ 8 files changed, 8 insertions(+)
+
+diff --git a/src/check_bound.c b/src/check_bound.c
+index c70b845..df14fbc 100644
+--- a/src/check_bound.c
++++ b/src/check_bound.c
+@@ -49,6 +49,7 @@ static	char sccsid[] = "@(#)check_bound.c 1.11 89/04/21 Copyr 1989 Sun Micro";
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#include <sys/cdefs.h>
+ #include <rpc/rpc.h>
+ #include <stdio.h>
+ #include <netconfig.h>
+diff --git a/src/pmap_svc.c b/src/pmap_svc.c
+index ad28b93..5993c0b 100644
+--- a/src/pmap_svc.c
++++ b/src/pmap_svc.c
+@@ -49,6 +49,7 @@ static	char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro";
+ #ifdef PORTMAP
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_prot.h>
+diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
+index bd92201..eb5b49c 100644
+--- a/src/rpcb_svc.c
++++ b/src/rpcb_svc.c
+@@ -42,6 +42,7 @@
+  * version 3 of rpcbind.
+  */
+ #include <sys/types.h>
++#include <sys/cdefs.h>
+ #include <rpc/rpc.h>
+ #include <rpc/rpcb_prot.h>
+ #include <netconfig.h>
+diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
+index b673452..69d75e3 100644
+--- a/src/rpcb_svc_4.c
++++ b/src/rpcb_svc_4.c
+@@ -44,6 +44,7 @@
+ 
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/cdefs.h>
+ #include <rpc/rpc.h>
+ #include <stdio.h>
+ #include <unistd.h>
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index 148fe42..9369e27 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -43,6 +43,7 @@
+ #include <sys/stat.h>
+ #include <sys/param.h>
+ #include <sys/poll.h>
++#include <sys/cdefs.h>
+ #include <bits/poll.h>
+ #include <sys/socket.h>
+ #include <rpc/rpc.h>
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index c4265cd..37fc660 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -50,6 +50,7 @@
+ #include <sys/file.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#include <sys/cdefs.h>
+ #include <netinet/in.h>
+ #include <rpc/rpc.h>
+ #include <rpc/rpc_com.h>
+diff --git a/src/util.c b/src/util.c
+index a6c835b..5bbec1d 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -42,6 +42,7 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/queue.h>
++#include <sys/cdefs.h>
+ #include <net/if.h>
+ #include <netinet/in.h>
+ #include <ifaddrs.h>
+diff --git a/src/warmstart.c b/src/warmstart.c
+index b6eb73e..f3a9c29 100644
+--- a/src/warmstart.c
++++ b/src/warmstart.c
+@@ -34,6 +34,7 @@
+ 
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/cdefs.h>
+ #include <stdio.h>
+ #include <rpc/rpc.h>
+ #include <rpc/rpcb_prot.h>
+-- 
+2.7.4
+
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 3/8] package/aircrack-ng: drop a musl-compatibility patch
  2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
  2016-08-12 20:49 ` [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl Yann E. MORIN
  2016-08-12 20:49 ` [Buildroot] [PATCH 2/8] package/rpcbind: include cdefs.h where needed Yann E. MORIN
@ 2016-08-12 20:49 ` Yann E. MORIN
  2016-08-14 21:22   ` Arnout Vandecappelle
  2016-08-12 20:49 ` [Buildroot] [PATCH 4/8] package/android-tools: drop musl-compatibility cdefs patching out Yann E. MORIN
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 20:49 UTC (permalink / raw)
  To: buildroot

We now always have a sys/cdefs.h, so we can drop this patch.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/aircrack-ng/0004-fix-musl-build.patch | 53 ---------------------------
 1 file changed, 53 deletions(-)
 delete mode 100644 package/aircrack-ng/0004-fix-musl-build.patch

diff --git a/package/aircrack-ng/0004-fix-musl-build.patch b/package/aircrack-ng/0004-fix-musl-build.patch
deleted file mode 100644
index cc093d3..0000000
--- a/package/aircrack-ng/0004-fix-musl-build.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From da6e87670ad4639371da056f9e36201a9236dfa2 Mon Sep 17 00:00:00 2001
-From: Romain Naour <romain.naour@openwide.fr>
-Date: Wed, 29 Jul 2015 19:38:46 +0200
-Subject: [PATCH] fix musl build
-
-aircrack-ng doesn't build with a musl toolchain due to
-cdefs.h internal glibc header being used in internal
-ethernet.h [1].
-
-[1] http://wiki.musl-libc.org/wiki/FAQ
-
-Signed-off-by: Romain Naour <romain.naour@openwide.fr>
----
- src/include/ethernet.h | 20 +++++++++++---------
- 1 file changed, 11 insertions(+), 9 deletions(-)
-
-diff --git a/src/include/ethernet.h b/src/include/ethernet.h
-index 72d5e81..e9d9236 100644
---- a/src/include/ethernet.h
-+++ b/src/include/ethernet.h
-@@ -389,18 +389,20 @@ void	ether_vlan_mtap(struct bpf_if *, struct mbuf *,
- 
- #else /* _KERNEL */
- 
--#include <sys/cdefs.h>
--
- /*
-  * Ethernet address conversion/parsing routines.
-  */
--__BEGIN_DECLS
--struct	ether_addr *ether_aton(const char *);
--int	ether_hostton(const char *, struct ether_addr *);
--int	ether_line(const char *, struct ether_addr *, char *);
--char 	*ether_ntoa(const struct ether_addr *);
--int	ether_ntohost(char *, const struct ether_addr *);
--__END_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+	struct	ether_addr *ether_aton(const char *);
-+	int	ether_hostton(const char *, struct ether_addr *);
-+	int	ether_line(const char *, struct ether_addr *, char *);
-+	char 	*ether_ntoa(const struct ether_addr *);
-+	int	ether_ntohost(char *, const struct ether_addr *);
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* !_KERNEL */
- 
--- 
-2.4.3
-
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 4/8] package/android-tools: drop musl-compatibility cdefs patching out
  2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
                   ` (2 preceding siblings ...)
  2016-08-12 20:49 ` [Buildroot] [PATCH 3/8] package/aircrack-ng: drop a musl-compatibility patch Yann E. MORIN
@ 2016-08-12 20:49 ` Yann E. MORIN
  2016-08-14 21:34   ` Arnout Vandecappelle
  2016-08-12 20:49 ` [Buildroot] [PATCH 5/8] package/bcusdk: drop a musl-compatibility patch Yann E. MORIN
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 20:49 UTC (permalink / raw)
  To: buildroot

We now always have a sys/cdefs.h, so we no longer need to patch it out.

Simplify the patch by removing any hunk removing cdefs.h or the use of
__BEGIN_DECLS/__END_DECLS. However, it must be included when macros it
defines are being used.

Also, renumber patches to guarantee ordering.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../0004-Fix-build-issue-with-musl.patch           | 181 +--------------------
 ...build.patch => 0006-fix-big-endian-build.patch} |   0
 .../0007-include-cdefs-h-when-needed.patch         |  41 +++++
 3 files changed, 43 insertions(+), 179 deletions(-)
 rename package/android-tools/{0005-fix-big-endian-build.patch => 0006-fix-big-endian-build.patch} (100%)
 create mode 100644 package/android-tools/0007-include-cdefs-h-when-needed.patch

diff --git a/package/android-tools/0004-Fix-build-issue-with-musl.patch b/package/android-tools/0004-Fix-build-issue-with-musl.patch
index e5ba0e6..964eb87 100644
--- a/package/android-tools/0004-Fix-build-issue-with-musl.patch
+++ b/package/android-tools/0004-Fix-build-issue-with-musl.patch
@@ -1,9 +1,6 @@
 [PATCH] Fix build issue with musl
 
-cdefs.h header doesn't exist in musl toolchains:
-http://wiki.musl-libc.org/wiki/FAQ
-
-Also arpa/nameser.h doesn't use the same macro name to avoid several
+arpa/nameser.h doesn't use the same macro name to avoid several
 inclusions.
 
 Finally had an issue with framebuffer_service.c since it was missing the
@@ -26,7 +23,7 @@ diff --git a/core/adbd/arpa_nameser.h b/core/adbd/arpa_nameser.h
 index 438dc04..b2a28d6 100644
 --- a/core/adbd/arpa_nameser.h
 +++ b/core/adbd/arpa_nameser.h
-@@ -52,11 +52,12 @@
+@@ -52,6 +52,8 @@
  
  #ifndef _ARPA_NAMESER_H_
  #define _ARPA_NAMESER_H_
@@ -35,51 +32,12 @@ index 438dc04..b2a28d6 100644
  
  #define BIND_4_COMPAT
  
- #include <sys/types.h>
--#include <sys/cdefs.h>
- 
- /*
-  * Revision information.  This is the release date in YYYYMMDD format.
-@@ -505,7 +506,9 @@ typedef enum __ns_cert_types {
- #define	ns_makecanon		__ns_makecanon
- #define	ns_samename		__ns_samename
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- int		ns_msg_getflag(ns_msg, int);
- uint16_t	ns_get16(const u_char *);
- uint32_t	ns_get32(const u_char *);
-@@ -560,7 +563,9 @@ int		ns_samedomain(const char *, const char *);
- int		ns_subdomain(const char *, const char *);
- int		ns_makecanon(const char *, char *, size_t);
- int		ns_samename(const char *, const char *);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #ifdef BIND_4_COMPAT
- #include "arpa_nameser_compat.h"
 @@ -574,4 +579,5 @@ __END_DECLS
  #define  XLOG(...)   do {} while (0)
  #endif
  
 +#endif /* !_ARPA_NAMESER_H */
  #endif /* !_ARPA_NAMESER_H_ */
-diff --git a/core/adbd/base64.c b/core/adbd/base64.c
-index 7270703..73725f5 100644
---- a/core/adbd/base64.c
-+++ b/core/adbd/base64.c
-@@ -42,7 +42,6 @@
-  * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
-  */
- 
--#include <sys/cdefs.h>
- #if defined(LIBC_SCCS) && !defined(lint)
- __RCSID("$NetBSD: base64.c,v 1.8 2002/11/11 01:15:17 thorpej Exp $");
- #endif /* LIBC_SCCS and not lint */
 diff --git a/core/adbd/framebuffer_service.c b/core/adbd/framebuffer_service.c
 index 20c08d2..48e0241 100644
 --- a/core/adbd/framebuffer_service.c
@@ -92,140 +50,5 @@ index 20c08d2..48e0241 100644
  #include <linux/fb.h>
  #include <sys/ioctl.h>
  #include <sys/mman.h>
-diff --git a/core/adbd/qemu_pipe.h b/core/adbd/qemu_pipe.h
-index 1a67022..572a242 100644
---- a/core/adbd/qemu_pipe.h
-+++ b/core/adbd/qemu_pipe.h
-@@ -16,7 +16,6 @@
- #ifndef ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H
- #define ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H
- 
--#include <sys/cdefs.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <sys/mman.h>
-diff --git a/core/include/cutils/android_reboot.h b/core/include/cutils/android_reboot.h
-index 0c79be7..2ebe1cf 100644
---- a/core/include/cutils/android_reboot.h
-+++ b/core/include/cutils/android_reboot.h
-@@ -17,7 +17,9 @@
- #ifndef __CUTILS_ANDROID_REBOOT_H__
- #define __CUTILS_ANDROID_REBOOT_H__
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- /* Commands */
- #define ANDROID_RB_RESTART  0xDEAD0001
-@@ -30,6 +32,8 @@ __BEGIN_DECLS
- 
- int android_reboot(int cmd, int flags, char *arg);
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* __CUTILS_ANDROID_REBOOT_H__ */
-diff --git a/core/include/cutils/bitops.h b/core/include/cutils/bitops.h
-index 1b3b762..a7c8cab 100644
---- a/core/include/cutils/bitops.h
-+++ b/core/include/cutils/bitops.h
-@@ -17,9 +17,9 @@
- #ifndef __CUTILS_BITOPS_H
- #define __CUTILS_BITOPS_H
- 
--#include <sys/cdefs.h>
--
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- static inline int popcount(unsigned int x)
- {
-@@ -36,6 +36,8 @@ static inline int popcountll(unsigned long long x)
-     return __builtin_popcountll(x);
- }
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* __CUTILS_BITOPS_H */
-diff --git a/core/include/cutils/partition_utils.h b/core/include/cutils/partition_utils.h
-index 597df92..0da9d5b 100644
---- a/core/include/cutils/partition_utils.h
-+++ b/core/include/cutils/partition_utils.h
-@@ -17,11 +17,15 @@
- #ifndef __CUTILS_PARTITION_WIPED_H__
- #define __CUTILS_PARTITION_WIPED_H__
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- int partition_wiped(char *source);
- void erase_footer(const char *dev_path, long long size);
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* __CUTILS_PARTITION_WIPED_H__ */
-diff --git a/extras/ext4_utils/sha1.c b/extras/ext4_utils/sha1.c
-index 463ec38..e2e29cf 100644
---- a/extras/ext4_utils/sha1.c
-+++ b/extras/ext4_utils/sha1.c
-@@ -17,9 +17,6 @@
- 
- #define SHA1HANDSOFF		/* Copies data before messing with it. */
- 
--#ifndef USE_MINGW
--#include <sys/cdefs.h>
--#endif
- #include <sys/types.h>
- #include <assert.h>
- #include <string.h>
-diff --git a/extras/ext4_utils/sha1.h b/extras/ext4_utils/sha1.h
-index 9a8f7e3..fe3217e 100644
---- a/extras/ext4_utils/sha1.h
-+++ b/extras/ext4_utils/sha1.h
-@@ -17,11 +17,6 @@ typedef unsigned char u_char;
- typedef unsigned int uint32_t;
- typedef unsigned int u_int32_t;
- typedef unsigned int u_int;
--
--#define __BEGIN_DECLS
--#define __END_DECLS
--#else
--#include <sys/cdefs.h>
- #endif
- 
- #define SHA1_DIGEST_LENGTH		20
-@@ -33,11 +28,15 @@ typedef struct {
- 	u_char buffer[64];
- } SHA1_CTX;
- 
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- void	SHA1Transform(uint32_t[5], const u_char[64]);
- void	SHA1Init(SHA1_CTX *);
- void	SHA1Update(SHA1_CTX *, const u_char *, u_int);
- void	SHA1Final(u_char[SHA1_DIGEST_LENGTH], SHA1_CTX *);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* _SYS_SHA1_H_ */
 -- 
 2.6.1
-
diff --git a/package/android-tools/0005-fix-big-endian-build.patch b/package/android-tools/0006-fix-big-endian-build.patch
similarity index 100%
rename from package/android-tools/0005-fix-big-endian-build.patch
rename to package/android-tools/0006-fix-big-endian-build.patch
diff --git a/package/android-tools/0007-include-cdefs-h-when-needed.patch b/package/android-tools/0007-include-cdefs-h-when-needed.patch
new file mode 100644
index 0000000..da4ee13
--- /dev/null
+++ b/package/android-tools/0007-include-cdefs-h-when-needed.patch
@@ -0,0 +1,41 @@
+Include cdefs.h wherever it is needed
+
+cdefs.h is included from within a lot of glibc headers, so it almost
+invariably and automagically gets pulled in with glibc.
+
+However, this might not be the case with other C libraries. musl does
+not provide cdefs.h so it does not include it from its own headers
+(cdefs.h must be provided separately).
+
+So we must include it when we are going to use macros it provides.
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+---
+ core/adbd/services.c                  |  1 +
+ core/libcutils/android_reboot.c       |  1 +
+ 2 files changed, 2 insertions(+), 0 deletion(-)
+
+diff --git a/core/adbd/services.c b/core/adbd/services.c
+index 20c08d2..48e0241 100644
+--- a/core/adbd/services.c
++++ b/core/adbd/services.c
+@@ -20,6 +20,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <pwd.h>
++#include <sys/cdefs.h>
+ 
+ #include "sysdeps.h"
+ 
+diff --git a/core/libcutils/android_reboot.c b/core/libcutils/android_reboot.c
+index 20c08d2..48e0241 100644
+--- a/core/libcutils/android_reboot.c
++++ b/core/libcutils/android_reboot.c
+@@ -23,6 +23,7 @@
+ #include <string.h>
+ #include <linux/reboot.h>
+ #include <sys/syscall.h>
++#include <sys/cdefs.h>
+ 
+ #include <cutils/android_reboot.h>
+ 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs)
@ 2016-08-12 20:49 Yann E. MORIN
  2016-08-12 20:49 ` [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl Yann E. MORIN
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 20:49 UTC (permalink / raw)
  To: buildroot

Hello All!

This series is an ateempt at quiescing, once and for all, all the build
failures under musl, due to missing non-standard header cdefs.h.

sys/cdefs.h is a non-standrad header, originating from glibc. Its goal
is two fold:

  - first, it hides away legacy compiler specifities by providing macros
    to declare prototypes and so on; this is *really* legacy, and
    targets pre-ANSI compilers (that is, I was already born, but had no
    idea what ANSI was, nor what a compiler was, for that matters);

  - second, it provides macros to begin and end C declarations in
    headers that can be included from C++ code. This is so trivial that
    the need for a macro is not even obvious to begin with.

Of course, this header is totally non-standard, and the macros it
defines are definitely non-standard as well. However, it has started to
be used in more and more packages as time passed, so that, decades later,
its use is so widespread that eradicating it is an impossible task.

But then enters musl, a strict standard-compliant C library, with as few
non-standard externsions as possible (if at all?). musl does not provide
a sys/cdefs.h headers, so a lot of code breaks with musl.

To make matters more intractable, sys/cdefs.h is included from inside
many other headers from glibc, making its macros available to a wide
audience without realizing they need a non-standard header.

Fixing all those bodies of code is nigh impossible, so instead we
provide a strictly-minimal sys/cdefs.h, that defines only the three
strictly-required macros:

  - __P() to declare function prototypes;
  - __BEGIN_DECLS and __END_DECLS to enclose C declarations.

When (if!) more are needed, they can be added later.

The basic idea was suggested by Thomas P. on IRC. Thanks! :-)

This then allows us to drop quite a few patches that were removing use
of cdefs.h. However, including sys/cdefs.h has been added to two
packages that were relying on other glibc headers to include it.

Regards,
Yann E. MORIN.


The following changes since commit f0e1381ef91ac85ad4fc9ab3db30057279ffe7c5

  toolchain: Bump ARC tools to arc-2016.09-eng008 (2016-08-11 15:07:06 +0200)


are available in the git repository at:

  git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to d4d54fc8edf86a9c69e7f1593004e698a4614bbb

  package/qlibc: drop a musl-compatibility patch (2016-08-12 22:28:57 +0200)


----------------------------------------------------------------
Yann E. MORIN (8):
      package/netbsd-compat-headers: provide compatibility headers not in musl
      package/rpcbind: include cdefs.h where needed
      package/aircrack-ng: drop a musl-compatibility patch
      package/android-tools: drop musl-compatibility cdefs patching out
      package/bcusdk: drop a musl-compatibility patch
      package/libsepol: drop a musl-compatibility patch
      package/linknx: drop a musl-compatibility patch
      package/qlibc: drop a musl-compatibility patch

 package/Config.in                                  |    2 +-
 package/aircrack-ng/0004-fix-musl-build.patch      |   53 -
 .../0004-Fix-build-issue-with-musl.patch           |  181 +---
 ...build.patch => 0006-fix-big-endian-build.patch} |    0
 .../0007-include-cdefs-h-when-needed.patch         |   41 +
 ...t-use-the-non-standard-sys-cdefs.h-header.patch |   48 -
 ...d_set-requires-inclusion-of-sys-select.h.patch} |    0
 package/libsepol/0005-replace-cdefs.patch          | 1074 --------------------
 package/linknx/0002-musl-cdefs.patch               |   37 -
 package/musl-compat-headers/Config.in              |    2 +
 package/musl-compat-headers/cdefs.h                |   40 +
 .../musl-compat-headers.hash}                      |    0
 package/musl-compat-headers/musl-compat-headers.mk |   29 +
 package/musl/Config.in                             |    3 +-
 package/musl/musl.mk                               |   10 +-
 package/netbsd-queue/Config.in                     |    2 -
 package/netbsd-queue/netbsd-queue.mk               |   24 -
 ...l-build-by-removing-usage-of-internal-gli.patch |   59 --
 ...003-src-include-cdefs.h-for-the-__P-macro.patch |  126 +++
 toolchain/toolchain-external/Config.in             |    3 +-
 toolchain/toolchain-external/toolchain-external.mk |   10 +-
 21 files changed, 257 insertions(+), 1487 deletions(-)
 delete mode 100644 package/aircrack-ng/0004-fix-musl-build.patch
 rename package/android-tools/{0005-fix-big-endian-build.patch => 0006-fix-big-endian-build.patch} (100%)
 create mode 100644 package/android-tools/0007-include-cdefs-h-when-needed.patch
 delete mode 100644 package/bcusdk/0001-Do-not-use-the-non-standard-sys-cdefs.h-header.patch
 rename package/bcusdk/{0002-fd_set-requires-inclusion-of-sys-select.h.patch => 0001-fd_set-requires-inclusion-of-sys-select.h.patch} (100%)
 delete mode 100644 package/libsepol/0005-replace-cdefs.patch
 delete mode 100644 package/linknx/0002-musl-cdefs.patch
 create mode 100644 package/musl-compat-headers/Config.in
 create mode 100644 package/musl-compat-headers/cdefs.h
 rename package/{netbsd-queue/netbsd-queue.hash => musl-compat-headers/musl-compat-headers.hash} (100%)
 create mode 100644 package/musl-compat-headers/musl-compat-headers.mk
 delete mode 100644 package/netbsd-queue/Config.in
 delete mode 100644 package/netbsd-queue/netbsd-queue.mk
 delete mode 100644 package/qlibc/0004-md5-fix-musl-build-by-removing-usage-of-internal-gli.patch
 create mode 100644 package/rpcbind/0003-src-include-cdefs.h-for-the-__P-macro.patch

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 5/8] package/bcusdk: drop a musl-compatibility patch
  2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
                   ` (3 preceding siblings ...)
  2016-08-12 20:49 ` [Buildroot] [PATCH 4/8] package/android-tools: drop musl-compatibility cdefs patching out Yann E. MORIN
@ 2016-08-12 20:49 ` Yann E. MORIN
  2016-08-14 21:41   ` Arnout Vandecappelle
  2016-08-12 20:49 ` [Buildroot] [PATCH 6/8] package/libsepol: " Yann E. MORIN
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 20:49 UTC (permalink / raw)
  To: buildroot

We now always have a sys/cdefs.h, so we can drop this patch.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

---
Note that the patch was sent upstream, but it seems never acted upon.
---
 ...t-use-the-non-standard-sys-cdefs.h-header.patch | 48 ----------------------
 ...d_set-requires-inclusion-of-sys-select.h.patch} |  0
 2 files changed, 48 deletions(-)
 delete mode 100644 package/bcusdk/0001-Do-not-use-the-non-standard-sys-cdefs.h-header.patch
 rename package/bcusdk/{0002-fd_set-requires-inclusion-of-sys-select.h.patch => 0001-fd_set-requires-inclusion-of-sys-select.h.patch} (100%)

diff --git a/package/bcusdk/0001-Do-not-use-the-non-standard-sys-cdefs.h-header.patch b/package/bcusdk/0001-Do-not-use-the-non-standard-sys-cdefs.h-header.patch
deleted file mode 100644
index fc64386..0000000
--- a/package/bcusdk/0001-Do-not-use-the-non-standard-sys-cdefs.h-header.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From c36db3f798bf576f42d81a0c51198b17d7112e8c Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Date: Sat, 8 Aug 2015 17:43:28 +0200
-Subject: [PATCH] Do not use the non-standard <sys/cdefs.h> header
-
-<sys/cdefs.h> is glibc-specific, and should be used only internally by
-glibc, not by external libraries/programs. It is not available in all
-standard C libraries.
-
-Submitted upstream: https://sourceforge.net/p/bcusdk/patches/3/
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- eibd/include/eibclient.h | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/eibd/include/eibclient.h b/eibd/include/eibclient.h
-index 2781878..b095a1c 100644
---- a/eibd/include/eibclient.h
-+++ b/eibd/include/eibclient.h
-@@ -27,10 +27,11 @@
- #ifndef EIBCLIENT_H
- #define EIBCLIENT_H
- 
--#include <sys/cdefs.h>
- #include <stdint.h>
- 
--__BEGIN_DECLS;
-+#ifdef	__cplusplus
-+extern "C" {
-+#endif
- 
- #include "eibloadresult.h"
- 
-@@ -889,5 +890,9 @@ int EIB_Cache_LastUpdates_async (EIBConnection * con, uint16_t start,
- 				 uint16_t * end);
- 
- 
--__END_DECLS
-+
-+#ifdef	__cplusplus
-+}
-+#endif
-+
- #endif
--- 
-2.5.0
-
diff --git a/package/bcusdk/0002-fd_set-requires-inclusion-of-sys-select.h.patch b/package/bcusdk/0001-fd_set-requires-inclusion-of-sys-select.h.patch
similarity index 100%
rename from package/bcusdk/0002-fd_set-requires-inclusion-of-sys-select.h.patch
rename to package/bcusdk/0001-fd_set-requires-inclusion-of-sys-select.h.patch
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 6/8] package/libsepol: drop a musl-compatibility patch
  2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
                   ` (4 preceding siblings ...)
  2016-08-12 20:49 ` [Buildroot] [PATCH 5/8] package/bcusdk: drop a musl-compatibility patch Yann E. MORIN
@ 2016-08-12 20:49 ` Yann E. MORIN
  2016-08-14 21:48   ` Arnout Vandecappelle
  2016-08-12 20:50 ` [Buildroot] [PATCH 7/8] package/linknx: " Yann E. MORIN
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 20:49 UTC (permalink / raw)
  To: buildroot

We now always have a sys/cdefs.h, so we can drop this patch.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/libsepol/0005-replace-cdefs.patch | 1074 -----------------------------
 1 file changed, 1074 deletions(-)
 delete mode 100644 package/libsepol/0005-replace-cdefs.patch

diff --git a/package/libsepol/0005-replace-cdefs.patch b/package/libsepol/0005-replace-cdefs.patch
deleted file mode 100644
index 2f76a74..0000000
--- a/package/libsepol/0005-replace-cdefs.patch
+++ /dev/null
@@ -1,1074 +0,0 @@
-Remove usage of <sys/cdefs.h>.
-
-This fixes autobuild issue: http://autobuild.buildroot.org/results/cbb/cbb2bac69aa0708e587ba9fcd1efcead82e42446/build-end.log
-Libsepol uses cdefs.h which is a internal glibc header.
-This header is not intended to be used by any program and will cause
-compiling against musl (and possibly other c libraries) to fail.
-This patch fixed this issue and replaces all references of
-#include <sys/cdefs.h> and __BEGIN/END_DECLS with the appropriate #ifdefs.
-
-This patch has also been submitted upstream to the selinux github repository.
-https://github.com/SELinuxProject/selinux/issues/19
-
-Signed-off-by: Adam Duskett <Aduskett@gmail.com>
-
-
-diff --git a/include/sepol/boolean_record.h b/include/sepol/boolean_record.h
-index 9af16be..09cd01f 100644
---- a/include/sepol/boolean_record.h
-+++ b/include/sepol/boolean_record.h
-@@ -3,9 +3,10 @@
-
- #include <stddef.h>
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_bool;
- struct sepol_bool_key;
-@@ -51,5 +52,8 @@ extern int sepol_bool_clone(sepol_handle_t * handle,
-
- extern void sepol_bool_free(sepol_bool_t * boolean);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/booleans.h b/include/sepol/booleans.h
-index 7374dde..02356d1 100644
---- a/include/sepol/booleans.h
-+++ b/include/sepol/booleans.h
-@@ -5,9 +5,10 @@
- #include <sepol/policydb.h>
- #include <sepol/boolean_record.h>
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /*--------------compatibility--------------*/
-
-@@ -59,5 +60,8 @@ extern int sepol_bool_iterate(sepol_handle_t * handle,
- 			      int (*fn) (const sepol_bool_t * boolean,
- 					 void *fn_arg), void *arg);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/context.h b/include/sepol/context.h
-index a69e8c9..b3e5497 100644
---- a/include/sepol/context.h
-+++ b/include/sepol/context.h
-@@ -4,9 +4,10 @@
- #include <sepol/context_record.h>
- #include <sepol/policydb.h>
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* -- Deprecated -- */
-
-@@ -26,5 +27,8 @@ extern int sepol_mls_contains(sepol_handle_t * handle,
- extern int sepol_mls_check(sepol_handle_t * handle,
- 			   const sepol_policydb_t * policydb, const char *mls);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/context_record.h b/include/sepol/context_record.h
-index c07da8f..1dcbebb 100644
---- a/include/sepol/context_record.h
-+++ b/include/sepol/context_record.h
-@@ -2,9 +2,10 @@
- #define _SEPOL_CONTEXT_RECORD_H_
-
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_context;
- typedef struct sepol_context sepol_context_t;
-@@ -53,5 +54,8 @@ extern int sepol_context_from_string(sepol_handle_t * handle,
- extern int sepol_context_to_string(sepol_handle_t * handle,
- 				   const sepol_context_t * con, char **str_ptr);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/debug.h b/include/sepol/debug.h
-index b852c8d..972a4de 100644
---- a/include/sepol/debug.h
-+++ b/include/sepol/debug.h
-@@ -2,9 +2,10 @@
- #define _SEPOL_DEBUG_H_
-
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* Deprecated */
- extern void sepol_debug(int on);
-@@ -35,5 +36,8 @@ extern void sepol_msg_set_callback(sepol_handle_t * handle,
- 							 const char *fmt, ...),
- 				   void *msg_callback_arg);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/errcodes.h b/include/sepol/errcodes.h
-index eba7088..0136564 100644
---- a/include/sepol/errcodes.h
-+++ b/include/sepol/errcodes.h
-@@ -4,9 +4,10 @@
- #define __sepol_errno_h__
-
- #include <errno.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- #define SEPOL_OK             0
-
-@@ -25,5 +26,8 @@ __BEGIN_DECLS
- #define SEPOL_EEXIST         -EEXIST
- #define SEPOL_ENOENT         -ENOENT
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/handle.h b/include/sepol/handle.h
-index 00ed0ed..27cbd6c 100644
---- a/include/sepol/handle.h
-+++ b/include/sepol/handle.h
-@@ -1,9 +1,9 @@
- #ifndef _SEPOL_HANDLE_H_
- #define _SEPOL_HANDLE_H_
-
--#include <sys/cdefs.h>
--
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_handle;
- typedef struct sepol_handle sepol_handle_t;
-@@ -35,5 +35,8 @@ int sepol_get_preserve_tunables(sepol_handle_t * sh);
-  * 0 is default and discard such branch, 1 preserves them */
- void sepol_set_preserve_tunables(sepol_handle_t * sh, int preserve_tunables);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/iface_record.h b/include/sepol/iface_record.h
-index 81d7027..098bc77 100644
---- a/include/sepol/iface_record.h
-+++ b/include/sepol/iface_record.h
-@@ -3,9 +3,10 @@
-
- #include <sepol/handle.h>
- #include <sepol/context_record.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_iface;
- struct sepol_iface_key;
-@@ -59,5 +60,8 @@ extern int sepol_iface_clone(sepol_handle_t * handle,
-
- extern void sepol_iface_free(sepol_iface_t * iface);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/interfaces.h b/include/sepol/interfaces.h
-index 3cb5043..7ef23ce 100644
---- a/include/sepol/interfaces.h
-+++ b/include/sepol/interfaces.h
-@@ -4,9 +4,10 @@
- #include <sepol/policydb.h>
- #include <sepol/iface_record.h>
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* Return the number of interfaces */
- extern int sepol_iface_count(sepol_handle_t * handle,
-@@ -43,5 +44,8 @@ extern int sepol_iface_iterate(sepol_handle_t * handle,
- 			       int (*fn) (const sepol_iface_t * iface,
- 					  void *fn_arg), void *arg);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/module.h b/include/sepol/module.h
-index ff27f96..77114a1 100644
---- a/include/sepol/module.h
-+++ b/include/sepol/module.h
-@@ -7,9 +7,11 @@
-
- #include <sepol/handle.h>
- #include <sepol/policydb.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_module_package;
- typedef struct sepol_module_package sepol_module_package_t;
-@@ -82,5 +84,8 @@ extern int sepol_expand_module(sepol_handle_t * handle,
- 			       sepol_policydb_t * base,
- 			       sepol_policydb_t * out, int verbose, int check);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/module_to_cil.h b/include/sepol/module_to_cil.h
-index 18bb3bf..fe5eb5b 100644
---- a/include/sepol/module_to_cil.h
-+++ b/include/sepol/module_to_cil.h
-@@ -1,5 +1,4 @@
- #include <stdlib.h>
--
- #include <sepol/module.h>
- #include <sepol/policydb/policydb.h>
-
-diff --git a/include/sepol/node_record.h b/include/sepol/node_record.h
-index e2d3e6d..3873223 100644
---- a/include/sepol/node_record.h
-+++ b/include/sepol/node_record.h
-@@ -4,9 +4,10 @@
- #include <stddef.h>
- #include <sepol/context_record.h>
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_node;
- struct sepol_node_key;
-@@ -92,5 +93,8 @@ extern int sepol_node_clone(sepol_handle_t * handle,
-
- extern void sepol_node_free(sepol_node_t * node);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/nodes.h b/include/sepol/nodes.h
-index 6fa534e..3cf99d2 100644
---- a/include/sepol/nodes.h
-+++ b/include/sepol/nodes.h
-@@ -4,9 +4,10 @@
- #include <sepol/handle.h>
- #include <sepol/policydb.h>
- #include <sepol/node_record.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* Return the number of nodes */
- extern int sepol_node_count(sepol_handle_t * handle,
-@@ -40,5 +41,8 @@ extern int sepol_node_iterate(sepol_handle_t * handle,
- 			      int (*fn) (const sepol_node_t * node,
- 					 void *fn_arg), void *arg);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb.h b/include/sepol/policydb.h
-index c3943e9..6769b91 100644
---- a/include/sepol/policydb.h
-+++ b/include/sepol/policydb.h
-@@ -5,9 +5,10 @@
- #include <stdio.h>
-
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_policy_file;
- typedef struct sepol_policy_file sepol_policy_file_t;
-@@ -144,5 +145,8 @@ extern int sepol_policydb_mls_enabled(const sepol_policydb_t * p);
-  */
- extern int sepol_policydb_compat_net(const sepol_policydb_t * p);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/avrule_block.h b/include/sepol/policydb/avrule_block.h
-index ecd347b..57d6a8a 100644
---- a/include/sepol/policydb/avrule_block.h
-+++ b/include/sepol/policydb/avrule_block.h
-@@ -21,9 +21,11 @@
- #define _SEPOL_AVRULE_BLOCK_H_
-
- #include <sepol/policydb/policydb.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- extern avrule_block_t *avrule_block_create(void);
- extern void avrule_block_destroy(avrule_block_t * x);
-@@ -37,5 +39,7 @@ extern cond_list_t *get_decl_cond_list(policydb_t * p,
- extern int is_id_enabled(char *id, policydb_t * p, int symbol_table);
- extern int is_perm_enabled(char *class_id, char *perm_id, policydb_t * p);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- #endif
-diff --git a/include/sepol/policydb/avtab.h b/include/sepol/policydb/avtab.h
-index d3ea84e..74f97f8 100644
---- a/include/sepol/policydb/avtab.h
-+++ b/include/sepol/policydb/avtab.h
-@@ -40,11 +40,13 @@
- #ifndef _SEPOL_POLICYDB_AVTAB_H_
- #define _SEPOL_POLICYDB_AVTAB_H_
-
--#include <sys/cdefs.h>
-+
- #include <sys/types.h>
- #include <stdint.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- typedef struct avtab_key {
- 	uint16_t source_type;
-@@ -142,7 +144,9 @@ extern avtab_ptr_t avtab_search_node_next(avtab_ptr_t node, int specified);
- /* avtab_alloc uses one bucket per 2-4 elements, so adjust to get maximum buckets */
- #define MAX_AVTAB_SIZE (MAX_AVTAB_HASH_BUCKETS << 1)
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- #endif				/* _AVTAB_H_ */
-
- /* FLASK */
-diff --git a/include/sepol/policydb/conditional.h b/include/sepol/policydb/conditional.h
-index cd2a9a9..52d6b31 100644
---- a/include/sepol/policydb/conditional.h
-+++ b/include/sepol/policydb/conditional.h
-@@ -25,9 +25,11 @@
- #include <sepol/policydb/avtab.h>
- #include <sepol/policydb/symtab.h>
- #include <sepol/policydb/policydb.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- #define COND_EXPR_MAXDEPTH 10
-
-@@ -136,5 +138,7 @@ extern int cond_read_list(policydb_t * p, cond_list_t ** list, void *fp);
- extern void cond_compute_av(avtab_t * ctab, avtab_key_t * key,
- 			    struct sepol_av_decision *avd);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- #endif				/* _CONDITIONAL_H_ */
-diff --git a/include/sepol/policydb/constraint.h b/include/sepol/policydb/constraint.h
-index ae7034d..927bdc0 100644
---- a/include/sepol/policydb/constraint.h
-+++ b/include/sepol/policydb/constraint.h
-@@ -22,7 +22,9 @@
- #include <sepol/policydb/ebitmap.h>
- #include <sepol/policydb/flask_types.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- #define CEXPR_MAXDEPTH 5
-
-@@ -73,7 +75,10 @@ struct policydb;
- extern int constraint_expr_init(constraint_expr_t * expr);
- extern void constraint_expr_destroy(constraint_expr_t * expr);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif				/* _CONSTRAINT_H_ */
-
- /* FLASK */
-diff --git a/include/sepol/policydb/context.h b/include/sepol/policydb/context.h
-index dbb7c3e..aad3647 100644
---- a/include/sepol/policydb/context.h
-+++ b/include/sepol/policydb/context.h
-@@ -22,7 +22,9 @@
- #include <sepol/policydb/ebitmap.h>
- #include <sepol/policydb/mls_types.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /*
-  * A security context consists of an authenticated user
-@@ -95,5 +97,8 @@ static inline int context_cmp(context_struct_t * c1, context_struct_t * c2)
- 		(c1->type == c2->type) && mls_context_cmp(c1, c2));
- }
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/ebitmap.h b/include/sepol/policydb/ebitmap.h
-index 7b3508d..b883597 100644
---- a/include/sepol/policydb/ebitmap.h
-+++ b/include/sepol/policydb/ebitmap.h
-@@ -19,9 +19,11 @@
-
- #include <stdint.h>
- #include <string.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- #define MAPTYPE uint64_t	/* portion of bitmap in each node */
- #define MAPSIZE (sizeof(MAPTYPE) * 8)	/* number of bits in node bitmap */
-@@ -92,7 +94,9 @@ extern int ebitmap_set_bit(ebitmap_t * e, unsigned int bit, int value);
- extern void ebitmap_destroy(ebitmap_t * e);
- extern int ebitmap_read(ebitmap_t * e, void *fp);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- #endif				/* _EBITMAP_H_ */
-
- /* FLASK */
-diff --git a/include/sepol/policydb/expand.h b/include/sepol/policydb/expand.h
-index a8de41e..59151c1 100644
---- a/include/sepol/policydb/expand.h
-+++ b/include/sepol/policydb/expand.h
-@@ -28,9 +28,11 @@
- #include <stddef.h>
- #include <sepol/handle.h>
- #include <sepol/policydb/conditional.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /*
-  * Expand only the avrules for a module. It is valid for this function
-@@ -79,5 +81,8 @@ extern int expand_avtab(policydb_t * p, avtab_t * a, avtab_t * expa);
- extern int expand_cond_av_list(policydb_t * p, cond_av_list_t * l,
- 			       cond_av_list_t ** newl, avtab_t * expa);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/flask_types.h b/include/sepol/policydb/flask_types.h
-index 2a59565..c41bd22 100644
---- a/include/sepol/policydb/flask_types.h
-+++ b/include/sepol/policydb/flask_types.h
-@@ -13,9 +13,11 @@
-
- #include <sys/types.h>
- #include <stdint.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /*
-  * A security context is a set of security attributes 
-@@ -61,5 +63,8 @@ struct sepol_av_decision {
- 	uint32_t seqno;
- };
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/hashtab.h b/include/sepol/policydb/hashtab.h
-index 0afc59c..af72817 100644
---- a/include/sepol/policydb/hashtab.h
-+++ b/include/sepol/policydb/hashtab.h
-@@ -17,9 +17,11 @@
-
- #include <stdint.h>
- #include <stdio.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- typedef char *hashtab_key_t;	/* generic key type */
- typedef void *hashtab_datum_t;	/* generic datum type */
-@@ -136,5 +138,8 @@ extern void hashtab_map_remove_on_error(hashtab_t h,
-
- extern void hashtab_hash_eval(hashtab_t h, char *tag);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/hierarchy.h b/include/sepol/policydb/hierarchy.h
-index 88bc02e..27d140b 100644
---- a/include/sepol/policydb/hierarchy.h
-+++ b/include/sepol/policydb/hierarchy.h
-@@ -27,9 +27,11 @@
-
- #include <sepol/policydb/avtab.h>
- #include <sepol/policydb/policydb.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- extern int hierarchy_add_bounds(sepol_handle_t *handle, policydb_t *p);
-
-@@ -43,5 +45,8 @@ extern int bounds_check_types(sepol_handle_t *handle, policydb_t *p);
-
- extern int hierarchy_check_constraints(sepol_handle_t * handle, policydb_t * p);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/link.h b/include/sepol/policydb/link.h
-index 7c7c9be..545331d 100644
---- a/include/sepol/policydb/link.h
-+++ b/include/sepol/policydb/link.h
-@@ -12,13 +12,18 @@
-
-
- #include <stddef.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- extern int link_modules(sepol_handle_t * handle,
- 			policydb_t * b, policydb_t ** mods, int len,
- 			int verbose);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/mls_types.h b/include/sepol/policydb/mls_types.h
-index 4bf7367..52347a6 100644
---- a/include/sepol/policydb/mls_types.h
-+++ b/include/sepol/policydb/mls_types.h
-@@ -34,9 +34,11 @@
- #include <stdlib.h>
- #include <sepol/policydb/ebitmap.h>
- #include <sepol/policydb/flask_types.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- typedef struct mls_level {
- 	uint32_t sens;		/* sensitivity */
-@@ -152,5 +154,8 @@ extern void mls_semantic_range_init(mls_semantic_range_t *r);
- extern void mls_semantic_range_destroy(mls_semantic_range_t *r);
- extern int mls_semantic_range_cpy(mls_semantic_range_t *dst, mls_semantic_range_t *src);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/module.h b/include/sepol/policydb/module.h
-index 3fe560c..d0d2c7a 100644
---- a/include/sepol/policydb/module.h
-+++ b/include/sepol/policydb/module.h
-@@ -27,11 +27,12 @@
-
- #include <sepol/policydb/policydb.h>
- #include <sepol/policydb/conditional.h>
--#include <sys/cdefs.h>
-
- #define SEPOL_MODULE_PACKAGE_MAGIC 0xf97cff8f
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_module_package {
- 	sepol_policydb_t *policy;
-@@ -48,5 +49,8 @@ struct sepol_module_package {
-
- extern int sepol_module_package_init(sepol_module_package_t * p);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/polcaps.h b/include/sepol/policydb/polcaps.h
-index 74b7c9e..53d7994 100644
---- a/include/sepol/policydb/polcaps.h
-+++ b/include/sepol/policydb/polcaps.h
-@@ -1,9 +1,9 @@
- #ifndef _SEPOL_POLICYDB_POLCAPS_H_
- #define _SEPOL_POLICYDB_POLCAPS_H_
-
--#include <sys/cdefs.h>
--
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* Policy capabilities */
- enum {
-@@ -21,5 +21,8 @@ extern int sepol_polcap_getnum(const char *name);
- /* Convert a capability number to name. */
- extern const char *sepol_polcap_getname(int capnum);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif /* _SEPOL_POLICYDB_POLCAPS_H_ */
-diff --git a/include/sepol/policydb/policydb.h b/include/sepol/policydb/policydb.h
-index 26cec13..0d770bf 100644
---- a/include/sepol/policydb/policydb.h
-+++ b/include/sepol/policydb/policydb.h
-@@ -61,7 +61,6 @@
- #include <sepol/policydb/context.h>
- #include <sepol/policydb/constraint.h>
- #include <sepol/policydb/sidtab.h>
--#include <sys/cdefs.h>
-
- #define ERRMSG_LEN 1024
-
-@@ -69,7 +68,9 @@
- #define POLICYDB_ERROR       -1
- #define POLICYDB_UNSUPPORTED -2
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /*
-  * A datum type is defined for each kind of symbol 
-@@ -768,7 +769,10 @@ extern int policydb_set_target_platform(policydb_t *p, int platform);
- #define POLICYDB_MOD_MAGIC SELINUX_MOD_MAGIC
- #define POLICYDB_MOD_STRING "SE Linux Module"
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif				/* _POLICYDB_H_ */
-
- /* FLASK */
-diff --git a/include/sepol/policydb/services.h b/include/sepol/policydb/services.h
-index 8a5dc9a..29f57cf 100644
---- a/include/sepol/policydb/services.h
-+++ b/include/sepol/policydb/services.h
-@@ -15,9 +15,10 @@
- #include <sepol/policydb/flask_types.h>
- #include <sepol/policydb/policydb.h>
- #include <stddef.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* Set the policydb and sidtab structures to be used by
-    the service functions.  If not set, then these default
-@@ -230,5 +231,8 @@ extern int sepol_genfs_sid(const char *fstype,	/* IN */
- 			   sepol_security_class_t sclass,	/* IN */
- 			   sepol_security_id_t * sid);	/* OUT  */
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/policydb/sidtab.h b/include/sepol/policydb/sidtab.h
-index 4b93567..2df1a50 100644
---- a/include/sepol/policydb/sidtab.h
-+++ b/include/sepol/policydb/sidtab.h
-@@ -11,9 +11,10 @@
- #define _SEPOL_POLICYDB_SIDTAB_H_
-
- #include <sepol/policydb/context.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- typedef struct sidtab_node {
- 	sepol_security_id_t sid;	/* security identifier */
-@@ -69,7 +70,10 @@ extern void sepol_sidtab_set(sidtab_t * dst, sidtab_t * src);
-
- extern void sepol_sidtab_shutdown(sidtab_t * s);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif				/* _SIDTAB_H_ */
-
- /* FLASK */
-diff --git a/include/sepol/policydb/symtab.h b/include/sepol/policydb/symtab.h
-index e0da337..68b5ad4 100644
---- a/include/sepol/policydb/symtab.h
-+++ b/include/sepol/policydb/symtab.h
-@@ -14,9 +14,10 @@
- #define _SEPOL_POLICYDB_SYMTAB_H_
-
- #include <sepol/policydb/hashtab.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* The symtab_datum struct stores the common information for
-  * all symtab datums. It should the first element in every
-@@ -37,7 +38,10 @@ typedef struct {
- extern int symtab_init(symtab_t *, unsigned int size);
- extern void symtab_destroy(symtab_t *);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif				/* _SYMTAB_H_ */
-
- /* FLASK */
-diff --git a/include/sepol/policydb/util.h b/include/sepol/policydb/util.h
-index fa12661..ee236a2 100644
---- a/include/sepol/policydb/util.h
-+++ b/include/sepol/policydb/util.h
-@@ -23,9 +23,9 @@
- #ifndef __SEPOL_UTIL_H__
- #define __SEPOL_UTIL_H__
-
--#include <sys/cdefs.h>
--
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- extern int add_i_to_a(uint32_t i, uint32_t * cnt, uint32_t ** a);
-
-@@ -40,5 +40,8 @@ char *sepol_extended_perms_to_string(avtab_extended_perms_t *xperms);
-  */
- extern int tokenize(char *line_buf, char delim, int num_args, ...);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/port_record.h b/include/sepol/port_record.h
-index 697cea4..3bb4039 100644
---- a/include/sepol/port_record.h
-+++ b/include/sepol/port_record.h
-@@ -3,9 +3,10 @@
-
- #include <sepol/context_record.h>
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_port;
- struct sepol_port_key;
-@@ -66,5 +67,8 @@ extern int sepol_port_clone(sepol_handle_t * handle,
-
- extern void sepol_port_free(sepol_port_t * port);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/ports.h b/include/sepol/ports.h
-index b4622ba..cda246c 100644
---- a/include/sepol/ports.h
-+++ b/include/sepol/ports.h
-@@ -4,9 +4,10 @@
- #include <sepol/handle.h>
- #include <sepol/policydb.h>
- #include <sepol/port_record.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /* Return the number of ports */
- extern int sepol_port_count(sepol_handle_t * handle,
-@@ -40,5 +41,8 @@ extern int sepol_port_iterate(sepol_handle_t * handle,
- 			      int (*fn) (const sepol_port_t * port,
- 					 void *fn_arg), void *arg);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/roles.h b/include/sepol/roles.h
-index 89b3af2..e750078 100644
---- a/include/sepol/roles.h
-+++ b/include/sepol/roles.h
-@@ -1,9 +1,9 @@
- #ifndef _SEPOL_ROLES_H_
- #define _SEPOL_ROLES_H_
-
--#include <sys/cdefs.h>
--
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- extern int sepol_role_exists(const sepol_policydb_t * policydb,
- 			     const char *role, int *response);
-@@ -11,5 +11,8 @@ extern int sepol_role_exists(const sepol_policydb_t * policydb,
- extern int sepol_role_list(const sepol_policydb_t * policydb,
- 			   char ***roles, unsigned int *nroles);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/sepol.h b/include/sepol/sepol.h
-index 00a2129..513f77d 100644
---- a/include/sepol/sepol.h
-+++ b/include/sepol/sepol.h
-@@ -3,9 +3,10 @@
-
- #include <stddef.h>
- #include <stdio.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- #include <sepol/user_record.h>
- #include <sepol/context_record.h>
-@@ -28,5 +29,8 @@ __BEGIN_DECLS
- /* Set internal policydb from a file for subsequent service calls. */
- extern int sepol_set_policydb_from_file(FILE * fp);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/user_record.h b/include/sepol/user_record.h
-index 9a39526..d17a3db 100644
---- a/include/sepol/user_record.h
-+++ b/include/sepol/user_record.h
-@@ -3,9 +3,10 @@
-
- #include <stddef.h>
- #include <sepol/handle.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- struct sepol_user;
- struct sepol_user_key;
-@@ -76,5 +77,8 @@ extern int sepol_user_clone(sepol_handle_t * handle,
-
- extern void sepol_user_free(sepol_user_t * user);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-diff --git a/include/sepol/users.h b/include/sepol/users.h
-index 0e0f76e..ad23f89 100644
---- a/include/sepol/users.h
-+++ b/include/sepol/users.h
-@@ -5,9 +5,10 @@
- #include <sepol/user_record.h>
- #include <sepol/handle.h>
- #include <stddef.h>
--#include <sys/cdefs.h>
-
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- /*---------compatibility------------*/
-
-@@ -57,5 +58,8 @@ extern int sepol_user_iterate(sepol_handle_t * handle,
- 			      int (*fn) (const sepol_user_t * user,
- 					 void *fn_arg), void *arg);
-
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 7/8] package/linknx: drop a musl-compatibility patch
  2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
                   ` (5 preceding siblings ...)
  2016-08-12 20:49 ` [Buildroot] [PATCH 6/8] package/libsepol: " Yann E. MORIN
@ 2016-08-12 20:50 ` Yann E. MORIN
  2016-08-14 21:49   ` Arnout Vandecappelle
  2016-08-12 20:50 ` [Buildroot] [PATCH 8/8] package/qlibc: " Yann E. MORIN
  2016-08-14 21:59 ` [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Arnout Vandecappelle
  8 siblings, 1 reply; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 20:50 UTC (permalink / raw)
  To: buildroot

We now always have a sys/cdefs.h, so we can drop this patch.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/linknx/0002-musl-cdefs.patch | 37 ------------------------------------
 1 file changed, 37 deletions(-)
 delete mode 100644 package/linknx/0002-musl-cdefs.patch

diff --git a/package/linknx/0002-musl-cdefs.patch b/package/linknx/0002-musl-cdefs.patch
deleted file mode 100644
index 59e28ca..0000000
--- a/package/linknx/0002-musl-cdefs.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Do not use the non-standard <sys/cdefs.h> header
-
-<sys/cdefs.h> is glibc-specific, and should be used only internally by
-glibc, not by external libraries/programs. It is not available in all
-standard C libraries.
-
-Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
-(Patch sent upstream: https://sourceforge.net/p/linknx/patches/21/)
-
-diff -uNr linknx-0.0.1.32.org/include/eibclient.h linknx-0.0.1.32/include/eibclient.h
---- linknx-0.0.1.32.org/include/eibclient.h	2007-10-11 01:55:33.000000000 +0200
-+++ linknx-0.0.1.32/include/eibclient.h	2016-01-23 23:21:17.315006629 +0100
-@@ -27,11 +27,12 @@
- #ifndef EIBCLIENT_H
- #define EIBCLIENT_H
- 
--#include "sys/cdefs.h"
- #include "stdint.h"
- #include <pthsem.h>
- 
--__BEGIN_DECLS;
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- 
- #include "eibloadresult.h"
- 
-@@ -705,5 +706,8 @@
-  */
- int EIB_LoadImage_async (EIBConnection * con, const uint8_t * image, int len);
- 
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 8/8] package/qlibc: drop a musl-compatibility patch
  2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
                   ` (6 preceding siblings ...)
  2016-08-12 20:50 ` [Buildroot] [PATCH 7/8] package/linknx: " Yann E. MORIN
@ 2016-08-12 20:50 ` Yann E. MORIN
  2016-08-14 21:50   ` Arnout Vandecappelle
  2016-08-14 21:59 ` [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Arnout Vandecappelle
  8 siblings, 1 reply; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 20:50 UTC (permalink / raw)
  To: buildroot

We now always have a sys/cdefs.h, so we can drop this patch.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...l-build-by-removing-usage-of-internal-gli.patch | 59 ----------------------
 1 file changed, 59 deletions(-)
 delete mode 100644 package/qlibc/0004-md5-fix-musl-build-by-removing-usage-of-internal-gli.patch

diff --git a/package/qlibc/0004-md5-fix-musl-build-by-removing-usage-of-internal-gli.patch b/package/qlibc/0004-md5-fix-musl-build-by-removing-usage-of-internal-gli.patch
deleted file mode 100644
index a48b27f..0000000
--- a/package/qlibc/0004-md5-fix-musl-build-by-removing-usage-of-internal-gli.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From fe45b18f777b1414aee908f08f56a5730a00dbb5 Mon Sep 17 00:00:00 2001
-From: Bernd Kuhls <bernd.kuhls@t-online.de>
-Date: Sat, 21 May 2016 09:59:56 +0200
-Subject: [PATCH 1/1] md5: fix musl build by removing usage of internal glibc
- header sys/cdefs.h
-
-As suggested in musl FAQ:
-http://wiki.musl-libc.org/wiki/FAQ#Q:_I.27m_trying_to_compile_something_against_musl_and_I_get_error_messages_about_sys.2Fcdefs.h
-
-Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
-(Patch for master branch sent upstream:
- https://github.com/wolkykim/qlibc/pull/53)
----
- src/internal/md5/md5.h  | 10 ++++++----
- src/internal/md5/md5c.c |  1 -
- 2 files changed, 6 insertions(+), 5 deletions(-)
-
-diff --git a/src/internal/md5/md5.h b/src/internal/md5/md5.h
-index cbfa7ca..8e726fe 100644
---- a/src/internal/md5/md5.h
-+++ b/src/internal/md5/md5.h
-@@ -35,9 +35,9 @@ typedef struct MD5Context {
-     unsigned char buffer[64]; /* input buffer */
- } MD5_CTX;
- 
--#include <sys/cdefs.h>
--
--__BEGIN_DECLS
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
- void MD5Init(MD5_CTX *);
- void MD5Update(MD5_CTX *, const unsigned char *, unsigned int);
- void MD5Final(unsigned char[16], MD5_CTX *);
-@@ -45,6 +45,8 @@ char * MD5End(MD5_CTX *, char *);
- char * MD5File(const char *, char *);
- char * MD5FileChunk(const char *, char *, off_t, off_t);
- char * MD5Data(const unsigned char *, unsigned int, char *);
--__END_DECLS
-+#ifdef __cplusplus
-+}
-+#endif
- 
- #endif /* Q_MD5_H */
-diff --git a/src/internal/md5/md5c.c b/src/internal/md5/md5c.c
-index de9e47f..040bf5e 100644
---- a/src/internal/md5/md5c.c
-+++ b/src/internal/md5/md5c.c
-@@ -26,7 +26,6 @@
-  * edited for clarity and style only.
-  */
- 
--#include <sys/cdefs.h>
- #include <sys/types.h>
- #include <string.h>
- #include "md5.h"
--- 
-2.8.1
-
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl
  2016-08-12 20:49 ` [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl Yann E. MORIN
@ 2016-08-12 21:30   ` Khem Raj
  2016-08-12 21:39     ` Yann E. MORIN
  2016-08-14 10:41   ` Baruch Siach
  2016-08-14 21:20   ` Arnout Vandecappelle
  2 siblings, 1 reply; 24+ messages in thread
From: Khem Raj @ 2016-08-12 21:30 UTC (permalink / raw)
  To: buildroot


> On Aug 12, 2016, at 1:49 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> 
> musl provides neither sys/queue.h nor sys/cdefs.h. Those two headers are
> however quite widely used in a lot of packages (though they should at
> least not use cdefs,h which is only full of mostly-legacy macros, and
> which is mostly an internal header of glibc and was never really meant to
> be exposed to, and used by packages).
> 
> But we don;t live in an ideal world, so a lot of packages break when
> those two headers are missing.
> 
> We already took care of sys/queue.h with the netbsd-queue package. But
> the need for cdefs.h is getting more and more pressing.
> 
> We rename the netbsd-queue package into musl-compat-headers, and we
> make it install sys/queue.h (from NetBSD) and sys/cdefs.h (a minimalist
> one we bundle in Buildroot). We can't use the cdefs.h from NetBSD
> because it includes machine-dependent headers; instead we bundle a very
> minimalistic one, that covers only what we need.

see here http://git.openembedded.org/openembedded-core/tree/meta/recipes-core/bsd-headers/bsd-headers
you might need some more.

> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> package/Config.in                                  |  2 +-
> package/musl-compat-headers/Config.in              |  2 ++
> package/musl-compat-headers/cdefs.h                | 40 ++++++++++++++++++++++
> .../musl-compat-headers.hash}                      |  0
> package/musl-compat-headers/musl-compat-headers.mk | 29 ++++++++++++++++
> package/musl/Config.in                             |  3 +-
> package/musl/musl.mk                               | 10 +++---
> package/netbsd-queue/Config.in                     |  2 --
> package/netbsd-queue/netbsd-queue.mk               | 24 -------------
> toolchain/toolchain-external/Config.in             |  3 +-
> toolchain/toolchain-external/toolchain-external.mk | 10 +++---
> 11 files changed, 88 insertions(+), 37 deletions(-)
> create mode 100644 package/musl-compat-headers/Config.in
> create mode 100644 package/musl-compat-headers/cdefs.h
> rename package/{netbsd-queue/netbsd-queue.hash => musl-compat-headers/musl-compat-headers.hash} (100%)
> create mode 100644 package/musl-compat-headers/musl-compat-headers.mk
> delete mode 100644 package/netbsd-queue/Config.in
> delete mode 100644 package/netbsd-queue/netbsd-queue.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index 645fa29..1e51a45 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1324,7 +1324,7 @@ endif
> 	source "package/mpfr/Config.in"
> 	source "package/msgpack/Config.in"
> 	source "package/mtdev2tuio/Config.in"
> -	source "package/netbsd-queue/Config.in"
> +	source "package/musl-compat-headers/Config.in"
> 	source "package/openblas/Config.in"
> 	source "package/orc/Config.in"
> 	source "package/p11-kit/Config.in"
> diff --git a/package/musl-compat-headers/Config.in b/package/musl-compat-headers/Config.in
> new file mode 100644
> index 0000000..c672f9c
> --- /dev/null
> +++ b/package/musl-compat-headers/Config.in
> @@ -0,0 +1,2 @@
> +config BR2_PACKAGE_MUSL_COMPAT_HEADERS
> +	bool
> diff --git a/package/musl-compat-headers/cdefs.h b/package/musl-compat-headers/cdefs.h
> new file mode 100644
> index 0000000..0a78b8f
> --- /dev/null
> +++ b/package/musl-compat-headers/cdefs.h
> @@ -0,0 +1,40 @@
> +/* Copyright (C) 2016 Yann E. MORI <yann.morin.1998@free.fr>
> + *
> + * This file is in the Public Domain.
> + *
> + * For jurisdictions in which the Public Domain does not exist
> + * or it is not otherwise applicable, this file is licensed CC0
> + * (Creative Commons Zero).
> + */
> +
> +/* This file contains definitions for non-standard macros defined by
> + * glibc, but quite commonly used in packages.
> + *
> + * Because they are non-standard, musl does not define those macros.
> + * It does not provide cdefs.h either.
> + *
> + * This file is a compatibility header written from scratch, to be
> + * installed when the C library is musl.
> + *
> + * Not all macros from the glibc's cdefs.h are available, only the
> + * most commonly used ones.
> + *
> + * Please refer to the glibc documentation and source code for
> + * explanations about those macros.
> + */
> +
> +#ifndef BUILDROOT_SYS_CDEFS_H
> +#define BUILDROOT_SYS_CDEFS_H
> +
> +#undef __P
> +#define __P(arg) arg
> +
> +#ifdef __cplusplus
> +#define __BEGIN_DECLS extern "C" {
> +#define __END_DECLS   }
> +#else
> +#define __BEGIN_DECLS
> +#define __END_DECLS
> +#endif
> +
> +#endif /* ifndef BUILDROOT_SYS_CDEFS_H */
> diff --git a/package/netbsd-queue/netbsd-queue.hash b/package/musl-compat-headers/musl-compat-headers.hash
> similarity index 100%
> rename from package/netbsd-queue/netbsd-queue.hash
> rename to package/musl-compat-headers/musl-compat-headers.hash
> diff --git a/package/musl-compat-headers/musl-compat-headers.mk b/package/musl-compat-headers/musl-compat-headers.mk
> new file mode 100644
> index 0000000..0758021
> --- /dev/null
> +++ b/package/musl-compat-headers/musl-compat-headers.mk
> @@ -0,0 +1,29 @@
> +################################################################################
> +#
> +# musl-compat-headers
> +#
> +################################################################################
> +
> +MUSL_COMPAT_HEADERS_SITE = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys
> +MUSL_COMPAT_HEADERS_VERSION = 1.70
> +MUSL_COMPAT_HEADERS_SOURCE = queue.h?rev=$(MUSL_COMPAT_HEADERS_VERSION)
> +MUSL_COMPAT_HEADERS_LICENSE = BSD-3c, Public Domain or CC0
> +
> +MUSL_COMPAT_HEADERS_ADD_TOOLCHAIN_DEPENDENCY = NO
> +
> +# Only installs headers
> +MUSL_COMPAT_HEADERS_INSTALL_TARGET = NO
> +MUSL_COMPAT_HEADERS_INSTALL_STAGING = YES
> +
> +define MUSL_COMPAT_HEADERS_EXTRACT_CMDS
> +	cp $(DL_DIR)/$(MUSL_COMPAT_HEADERS_SOURCE) $(@D)/queue.h
> +endef
> +
> +define MUSL_COMPAT_HEADERS_INSTALL_STAGING_CMDS
> +	$(INSTALL) -D -m 0644 $(@D)/queue.h \
> +		$(STAGING_DIR)/usr/include/sys/queue.h
> +	$(INSTALL) -D -m 0644 $(MUSL_COMPAT_HEADERS_PKGDIR)/cdefs.h \
> +		$(STAGING_DIR)/usr/include/sys/cdefs.h
> +endef
> +
> +$(eval $(generic-package))
> diff --git a/package/musl/Config.in b/package/musl/Config.in
> index c263006..18ae69d 100644
> --- a/package/musl/Config.in
> +++ b/package/musl/Config.in
> @@ -3,5 +3,6 @@ config BR2_PACKAGE_MUSL
> 	depends on BR2_TOOLCHAIN_USES_MUSL
> 	default y
> 	select BR2_PACKAGE_LINUX_HEADERS
> -	select BR2_PACKAGE_NETBSD_QUEUE
> 	select BR2_TOOLCHAIN_HAS_SSP
> +	# Compatibility headers: cdefs.h, queue.h
> +	select BR2_PACKAGE_MUSL_COMPAT_HEADERS
> diff --git a/package/musl/musl.mk b/package/musl/musl.mk
> index 920bbbf..f8ea377 100644
> --- a/package/musl/musl.mk
> +++ b/package/musl/musl.mk
> @@ -13,10 +13,12 @@ MUSL_LICENSE_FILES = COPYRIGHT
> # cross-compiler and the kernel headers
> MUSL_DEPENDENCIES = host-gcc-initial linux-headers
> 
> -# musl does not provide a sys/queue.h implementation, so add the
> -# netbsd-queue package that will install a sys/queue.h file in the
> -# staging directory based on the NetBSD implementation.
> -MUSL_DEPENDENCIES += netbsd-queue
> +# musl does not provide an implementation for sys/queue.h or sys/cdefs.h. So,
> +# add the netbsd-compat-headers package that will install those files, into
> +# the staging directory:
> +#   sys/queue.h:  header from NetBSD
> +#   sys/cdefs.h:  minimalist header bundled in Buildroot
> +MUSL_DEPENDENCIES += musl-compat-headers
> 
> # musl is part of the toolchain so disable the toolchain dependency
> MUSL_ADD_TOOLCHAIN_DEPENDENCY = NO
> diff --git a/package/netbsd-queue/Config.in b/package/netbsd-queue/Config.in
> deleted file mode 100644
> index 7837f4c..0000000
> --- a/package/netbsd-queue/Config.in
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -config BR2_PACKAGE_NETBSD_QUEUE
> -	bool
> diff --git a/package/netbsd-queue/netbsd-queue.mk b/package/netbsd-queue/netbsd-queue.mk
> deleted file mode 100644
> index 5fd926b..0000000
> --- a/package/netbsd-queue/netbsd-queue.mk
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -################################################################################
> -#
> -# netbsd-queue
> -#
> -################################################################################
> -
> -NETBSD_QUEUE_VERSION = 1.70
> -NETBSD_QUEUE_SITE = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys
> -NETBSD_QUEUE_SOURCE = queue.h?rev=$(NETBSD_QUEUE_VERSION)
> -NETBSD_QUEUE_LICENSE = BSD-3c
> -
> -NETBSD_QUEUE_ADD_TOOLCHAIN_DEPENDENCY = NO
> -NETBSD_QUEUE_INSTALL_STAGING = YES
> -
> -define NETBSD_QUEUE_EXTRACT_CMDS
> -	cp $(DL_DIR)/$(NETBSD_QUEUE_SOURCE) $(@D)/queue.h
> -endef
> -
> -define NETBSD_QUEUE_INSTALL_STAGING_CMDS
> -	$(INSTALL) -D -m 0644 $(@D)/queue.h \
> -		$(STAGING_DIR)/usr/include/sys/queue.h
> -endef
> -
> -$(eval $(generic-package))
> diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
> index f54fbee..63b7712 100644
> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -727,7 +727,8 @@ config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
> config BR2_TOOLCHAIN_EXTERNAL_MUSL
> 	bool
> 	select BR2_TOOLCHAIN_USES_MUSL
> -	select BR2_PACKAGE_NETBSD_QUEUE
> +	# Compatibility headers: cdefs.h, queue.h
> +	select BR2_PACKAGE_MUSL_COMPAT_HEADERS
> 
> if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
> 
> diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
> index 29c1f36..967f022 100644
> --- a/toolchain/toolchain-external/toolchain-external.mk
> +++ b/toolchain/toolchain-external/toolchain-external.mk
> @@ -246,11 +246,13 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float
> TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
> endif
> 
> -# musl does not provide a sys/queue.h implementation, so add the
> -# netbsd-queue package that will install a sys/queue.h file in the
> -# staging directory based on the NetBSD implementation.
> +# musl does not provide an implementation for sys/queue.h or sys/cdefs.h. So,
> +# add the netbsd-compat-headers package that will install those files, into
> +# the staging directory:
> +#   sys/queue.h:  header from NetBSD
> +#   sys/cdefs.h:  minimalist header bundled in Buildroot
> ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
> -TOOLCHAIN_EXTERNAL_DEPENDENCIES += netbsd-queue
> +TOOLCHAIN_EXTERNAL_DEPENDENCIES += musl-compat-headers
> endif
> 
> # The Linaro toolchain expects the libraries in
> --
> 2.7.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160812/9338f8f1/attachment.asc>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl
  2016-08-12 21:30   ` Khem Raj
@ 2016-08-12 21:39     ` Yann E. MORIN
  2016-08-13  2:35       ` Khem Raj
  0 siblings, 1 reply; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-12 21:39 UTC (permalink / raw)
  To: buildroot

Khem, All,

On 2016-08-12 14:30 -0700, Khem Raj spake thusly:
> 
> > On Aug 12, 2016, at 1:49 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > 
> > musl provides neither sys/queue.h nor sys/cdefs.h. Those two headers are
> > however quite widely used in a lot of packages (though they should at
> > least not use cdefs,h which is only full of mostly-legacy macros, and
> > which is mostly an internal header of glibc and was never really meant to
> > be exposed to, and used by packages).
> > 
> > But we don;t live in an ideal world, so a lot of packages break when
> > those two headers are missing.
> > 
> > We already took care of sys/queue.h with the netbsd-queue package. But
> > the need for cdefs.h is getting more and more pressing.
> > 
> > We rename the netbsd-queue package into musl-compat-headers, and we
> > make it install sys/queue.h (from NetBSD) and sys/cdefs.h (a minimalist
> > one we bundle in Buildroot). We can't use the cdefs.h from NetBSD
> > because it includes machine-dependent headers; instead we bundle a very
> > minimalistic one, that covers only what we need.
> 
> see here http://git.openembedded.org/openembedded-core/tree/meta/recipes-core/bsd-headers/bsd-headers

Thanks for the pointer! :-)
But no licensing info in that file, so we can't use it... :-/

Also, we don't want to add a #warning, to avoid having to patch those
bad packages that find it smart to add -Werror by default.

> you might need some more.

Right now, all the packages in Buildroot that we were patching because
of cdefs.h only need those three macros: __BEGIN_DECLS(), __END_DECLS()
and __P().

There is no point in adding more than what we strictly require. As I
said in the cover letter, we can add the missing macros when we see the
issue.

TRhanks for the feedback! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl
  2016-08-12 21:39     ` Yann E. MORIN
@ 2016-08-13  2:35       ` Khem Raj
  0 siblings, 0 replies; 24+ messages in thread
From: Khem Raj @ 2016-08-13  2:35 UTC (permalink / raw)
  To: buildroot


> On Aug 12, 2016, at 2:39 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> 
> Khem, All,
> 
> On 2016-08-12 14:30 -0700, Khem Raj spake thusly:
>> 
>>> On Aug 12, 2016, at 1:49 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>>> 
>>> musl provides neither sys/queue.h nor sys/cdefs.h. Those two headers are
>>> however quite widely used in a lot of packages (though they should at
>>> least not use cdefs,h which is only full of mostly-legacy macros, and
>>> which is mostly an internal header of glibc and was never really meant to
>>> be exposed to, and used by packages).
>>> 
>>> But we don;t live in an ideal world, so a lot of packages break when
>>> those two headers are missing.
>>> 
>>> We already took care of sys/queue.h with the netbsd-queue package. But
>>> the need for cdefs.h is getting more and more pressing.
>>> 
>>> We rename the netbsd-queue package into musl-compat-headers, and we
>>> make it install sys/queue.h (from NetBSD) and sys/cdefs.h (a minimalist
>>> one we bundle in Buildroot). We can't use the cdefs.h from NetBSD
>>> because it includes machine-dependent headers; instead we bundle a very
>>> minimalistic one, that covers only what we need.
>> 
>> see here http://git.openembedded.org/openembedded-core/tree/meta/recipes-core/bsd-headers/bsd-headers
> 
> Thanks for the pointer! :-)
> But no licensing info in that file, so we can't use it... :-/

Oh, that can be fixed.

> 
> Also, we don't want to add a #warning, to avoid having to patch those
> bad packages that find it smart to add -Werror by default.

yet to encounter this case in OE world yet.

> 
>> you might need some more.
> 
> Right now, all the packages in Buildroot that we were patching because
> of cdefs.h only need those three macros: __BEGIN_DECLS(), __END_DECLS()
> and __P().
> 
> There is no point in adding more than what we strictly require. As I
> said in the cover letter, we can add the missing macros when we see the
> issue.

Fair enough.

> 
> TRhanks for the feedback! :-)
> 
> Regards,
> Yann E. MORIN.
> 
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160812/6261bcbf/attachment.asc>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl
  2016-08-12 20:49 ` [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl Yann E. MORIN
  2016-08-12 21:30   ` Khem Raj
@ 2016-08-14 10:41   ` Baruch Siach
  2016-08-14 21:20   ` Arnout Vandecappelle
  2 siblings, 0 replies; 24+ messages in thread
From: Baruch Siach @ 2016-08-14 10:41 UTC (permalink / raw)
  To: buildroot

Hi Yann,

On Fri, Aug 12, 2016 at 10:49:54PM +0200, Yann E. MORIN wrote: 
> diff --git a/package/musl-compat-headers/cdefs.h b/package/musl-compat-headers/cdefs.h
> new file mode 100644
> index 0000000..0a78b8f
> --- /dev/null
> +++ b/package/musl-compat-headers/cdefs.h
> @@ -0,0 +1,40 @@
> +/* Copyright (C) 2016 Yann E. MORI <yann.morin.1998@free.fr>

Your last name is missing 'N'.

> + *
> + * This file is in the Public Domain.
> + *
> + * For jurisdictions in which the Public Domain does not exist
> + * or it is not otherwise applicable, this file is licensed CC0
> + * (Creative Commons Zero).
> + */

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl
  2016-08-12 20:49 ` [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl Yann E. MORIN
  2016-08-12 21:30   ` Khem Raj
  2016-08-14 10:41   ` Baruch Siach
@ 2016-08-14 21:20   ` Arnout Vandecappelle
  2016-08-14 21:56     ` Yann E. MORIN
  2 siblings, 1 reply; 24+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 21:20 UTC (permalink / raw)
  To: buildroot

 Subject line should be musl-compat-headers, not netbsd-...

On 12-08-16 22:49, Yann E. MORIN wrote:
> musl provides neither sys/queue.h nor sys/cdefs.h. Those two headers are
> however quite widely used in a lot of packages (though they should at
> least not use cdefs,h which is only full of mostly-legacy macros, and
> which is mostly an internal header of glibc and was never really meant to
> be exposed to, and used by packages).
> 
> But we don;t live in an ideal world, so a lot of packages break when
         don't

> those two headers are missing.
> 
> We already took care of sys/queue.h with the netbsd-queue package. But
> the need for cdefs.h is getting more and more pressing.
> 
> We rename the netbsd-queue package into musl-compat-headers, and we
> make it install sys/queue.h (from NetBSD) and sys/cdefs.h (a minimalist
> one we bundle in Buildroot). We can't use the cdefs.h from NetBSD
> because it includes machine-dependent headers; instead we bundle a very
> minimalistic one, that covers only what we need.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

 In general I prefer to use an upstream like Khem proposes. However, in this
case, it's really a lot easier if we can add or change the header as needed by
breaking packages. So I like the way it's done now.

[snip]
> diff --git a/package/musl-compat-headers/musl-compat-headers.mk b/package/musl-compat-headers/musl-compat-headers.mk
> new file mode 100644
> index 0000000..0758021
> --- /dev/null
> +++ b/package/musl-compat-headers/musl-compat-headers.mk
> @@ -0,0 +1,29 @@
> +################################################################################
> +#
> +# musl-compat-headers
> +#
> +################################################################################
> +
> +MUSL_COMPAT_HEADERS_SITE = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys
> +MUSL_COMPAT_HEADERS_VERSION = 1.70
> +MUSL_COMPAT_HEADERS_SOURCE = queue.h?rev=$(MUSL_COMPAT_HEADERS_VERSION)

 We may need additional files in the future (e.g. the tree.h that openembedded
is carrying). Also, the definition of upstream here is not entirely correct,
because that's only half the package. So I think it's nicer/cleaner to specify
this as:

MUSL_COMPAT_HEADERS_EXTRA_DOWNLOADS = \
	http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/queue.h?rev=1.70

> +MUSL_COMPAT_HEADERS_LICENSE = BSD-3c, Public Domain or CC0

 Shouldn't we specify here

MUSL_COMPAT_HEADERS_LICENSE_FILES = queue.h cdefs.h

?

> +
> +MUSL_COMPAT_HEADERS_ADD_TOOLCHAIN_DEPENDENCY = NO
> +
> +# Only installs headers
> +MUSL_COMPAT_HEADERS_INSTALL_TARGET = NO
> +MUSL_COMPAT_HEADERS_INSTALL_STAGING = YES
> +
> +define MUSL_COMPAT_HEADERS_EXTRACT_CMDS
> +	cp $(DL_DIR)/$(MUSL_COMPAT_HEADERS_SOURCE) $(@D)/queue.h
                     ^^^This would become
                     $(notdir $(MUSL_COMPAT_HEADERS_EXTRA_DOWNLOADS))

 BTW I think it makes sense to use install here as well.

> +endef
> +
> +define MUSL_COMPAT_HEADERS_INSTALL_STAGING_CMDS
> +	$(INSTALL) -D -m 0644 $(@D)/queue.h \
> +		$(STAGING_DIR)/usr/include/sys/queue.h
> +	$(INSTALL) -D -m 0644 $(MUSL_COMPAT_HEADERS_PKGDIR)/cdefs.h \
> +		$(STAGING_DIR)/usr/include/sys/cdefs.h
> +endef
> +
> +$(eval $(generic-package))
> diff --git a/package/musl/Config.in b/package/musl/Config.in
> index c263006..18ae69d 100644
> --- a/package/musl/Config.in
> +++ b/package/musl/Config.in
> @@ -3,5 +3,6 @@ config BR2_PACKAGE_MUSL
>  	depends on BR2_TOOLCHAIN_USES_MUSL
>  	default y
>  	select BR2_PACKAGE_LINUX_HEADERS
> -	select BR2_PACKAGE_NETBSD_QUEUE
>  	select BR2_TOOLCHAIN_HAS_SSP
> +	# Compatibility headers: cdefs.h, queue.h
> +	select BR2_PACKAGE_MUSL_COMPAT_HEADERS
> diff --git a/package/musl/musl.mk b/package/musl/musl.mk
> index 920bbbf..f8ea377 100644
> --- a/package/musl/musl.mk
> +++ b/package/musl/musl.mk
> @@ -13,10 +13,12 @@ MUSL_LICENSE_FILES = COPYRIGHT
>  # cross-compiler and the kernel headers
>  MUSL_DEPENDENCIES = host-gcc-initial linux-headers
>  
> -# musl does not provide a sys/queue.h implementation, so add the
> -# netbsd-queue package that will install a sys/queue.h file in the
> -# staging directory based on the NetBSD implementation.
> -MUSL_DEPENDENCIES += netbsd-queue
> +# musl does not provide an implementation for sys/queue.h or sys/cdefs.h. So,
> +# add the netbsd-compat-headers package that will install those files, into
             ^^^^^^ musl
> +# the staging directory:
> +#   sys/queue.h:  header from NetBSD
> +#   sys/cdefs.h:  minimalist header bundled in Buildroot
> +MUSL_DEPENDENCIES += musl-compat-headers
>  
>  # musl is part of the toolchain so disable the toolchain dependency
>  MUSL_ADD_TOOLCHAIN_DEPENDENCY = NO
> diff --git a/package/netbsd-queue/Config.in b/package/netbsd-queue/Config.in
> deleted file mode 100644
> index 7837f4c..0000000
> --- a/package/netbsd-queue/Config.in
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -config BR2_PACKAGE_NETBSD_QUEUE
> -	bool
> diff --git a/package/netbsd-queue/netbsd-queue.mk b/package/netbsd-queue/netbsd-queue.mk
> deleted file mode 100644
> index 5fd926b..0000000
> --- a/package/netbsd-queue/netbsd-queue.mk
> +++ /dev/null
> @@ -1,24 +0,0 @@
> -################################################################################
> -#
> -# netbsd-queue
> -#
> -################################################################################
> -
> -NETBSD_QUEUE_VERSION = 1.70
> -NETBSD_QUEUE_SITE = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys
> -NETBSD_QUEUE_SOURCE = queue.h?rev=$(NETBSD_QUEUE_VERSION)
> -NETBSD_QUEUE_LICENSE = BSD-3c
> -
> -NETBSD_QUEUE_ADD_TOOLCHAIN_DEPENDENCY = NO
> -NETBSD_QUEUE_INSTALL_STAGING = YES
> -
> -define NETBSD_QUEUE_EXTRACT_CMDS
> -	cp $(DL_DIR)/$(NETBSD_QUEUE_SOURCE) $(@D)/queue.h
> -endef
> -
> -define NETBSD_QUEUE_INSTALL_STAGING_CMDS
> -	$(INSTALL) -D -m 0644 $(@D)/queue.h \
> -		$(STAGING_DIR)/usr/include/sys/queue.h
> -endef
> -
> -$(eval $(generic-package))
> diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
> index f54fbee..63b7712 100644
> --- a/toolchain/toolchain-external/Config.in
> +++ b/toolchain/toolchain-external/Config.in
> @@ -727,7 +727,8 @@ config BR2_TOOLCHAIN_EXTERNAL_UCLIBC
>  config BR2_TOOLCHAIN_EXTERNAL_MUSL
>  	bool
>  	select BR2_TOOLCHAIN_USES_MUSL
> -	select BR2_PACKAGE_NETBSD_QUEUE
> +	# Compatibility headers: cdefs.h, queue.h
> +	select BR2_PACKAGE_MUSL_COMPAT_HEADERS
>  
>  if BR2_TOOLCHAIN_EXTERNAL_CUSTOM
>  
> diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
> index 29c1f36..967f022 100644
> --- a/toolchain/toolchain-external/toolchain-external.mk
> +++ b/toolchain/toolchain-external/toolchain-external.mk
> @@ -246,11 +246,13 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float
>  TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
>  endif
>  
> -# musl does not provide a sys/queue.h implementation, so add the
> -# netbsd-queue package that will install a sys/queue.h file in the
> -# staging directory based on the NetBSD implementation.
> +# musl does not provide an implementation for sys/queue.h or sys/cdefs.h. So,
> +# add the netbsd-compat-headers package that will install those files, into
             ^^^^^^musl


 Regards,
 Arnout

> +# the staging directory:
> +#   sys/queue.h:  header from NetBSD
> +#   sys/cdefs.h:  minimalist header bundled in Buildroot
>  ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
> -TOOLCHAIN_EXTERNAL_DEPENDENCIES += netbsd-queue
> +TOOLCHAIN_EXTERNAL_DEPENDENCIES += musl-compat-headers
>  endif
>  
>  # The Linaro toolchain expects the libraries in
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 2/8] package/rpcbind: include cdefs.h where needed
  2016-08-12 20:49 ` [Buildroot] [PATCH 2/8] package/rpcbind: include cdefs.h where needed Yann E. MORIN
@ 2016-08-14 21:21   ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 21:21 UTC (permalink / raw)
  To: buildroot

On 12-08-16 22:49, Yann E. MORIN wrote:
> rpcbind uses a macro defined in sys/cdefs.h but does not included it
                                                           include
> explicitly, relying on the glibc behaviour to include it from its own
> headers.
> 
> Now that we also have a sys/cdefs.h for musl (which completes the triade
> glibc/uClibc/musl), sys/cdefs.h is always available.
> 
> Fixes:
>     http://autobuild.buildroot.org/results/346/346c5b562c244ddb039db2f86f71d670a01ed9ce/
>     http://autobuild.buildroot.org/results/d77/d77454265c45539178c008c5d92509c441447675/
>     and numerous such autobuild failures
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout
[snip]
-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 3/8] package/aircrack-ng: drop a musl-compatibility patch
  2016-08-12 20:49 ` [Buildroot] [PATCH 3/8] package/aircrack-ng: drop a musl-compatibility patch Yann E. MORIN
@ 2016-08-14 21:22   ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 21:22 UTC (permalink / raw)
  To: buildroot

On 12-08-16 22:49, Yann E. MORIN wrote:
> We now always have a sys/cdefs.h, so we can drop this patch.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout

> ---
>  package/aircrack-ng/0004-fix-musl-build.patch | 53 ---------------------------
>  1 file changed, 53 deletions(-)
>  delete mode 100644 package/aircrack-ng/0004-fix-musl-build.patch
> 
> diff --git a/package/aircrack-ng/0004-fix-musl-build.patch b/package/aircrack-ng/0004-fix-musl-build.patch
> deleted file mode 100644
> index cc093d3..0000000
> --- a/package/aircrack-ng/0004-fix-musl-build.patch
> +++ /dev/null
> @@ -1,53 +0,0 @@
> -From da6e87670ad4639371da056f9e36201a9236dfa2 Mon Sep 17 00:00:00 2001
> -From: Romain Naour <romain.naour@openwide.fr>
> -Date: Wed, 29 Jul 2015 19:38:46 +0200
> -Subject: [PATCH] fix musl build
> -
> -aircrack-ng doesn't build with a musl toolchain due to
> -cdefs.h internal glibc header being used in internal
> -ethernet.h [1].
> -
> -[1] http://wiki.musl-libc.org/wiki/FAQ
> -
> -Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> ----
> - src/include/ethernet.h | 20 +++++++++++---------
> - 1 file changed, 11 insertions(+), 9 deletions(-)
> -
> -diff --git a/src/include/ethernet.h b/src/include/ethernet.h
> -index 72d5e81..e9d9236 100644
> ---- a/src/include/ethernet.h
> -+++ b/src/include/ethernet.h
> -@@ -389,18 +389,20 @@ void	ether_vlan_mtap(struct bpf_if *, struct mbuf *,
> - 
> - #else /* _KERNEL */
> - 
> --#include <sys/cdefs.h>
> --
> - /*
> -  * Ethernet address conversion/parsing routines.
> -  */
> --__BEGIN_DECLS
> --struct	ether_addr *ether_aton(const char *);
> --int	ether_hostton(const char *, struct ether_addr *);
> --int	ether_line(const char *, struct ether_addr *, char *);
> --char 	*ether_ntoa(const struct ether_addr *);
> --int	ether_ntohost(char *, const struct ether_addr *);
> --__END_DECLS
> -+#ifdef __cplusplus
> -+extern "C" {
> -+#endif
> -+	struct	ether_addr *ether_aton(const char *);
> -+	int	ether_hostton(const char *, struct ether_addr *);
> -+	int	ether_line(const char *, struct ether_addr *, char *);
> -+	char 	*ether_ntoa(const struct ether_addr *);
> -+	int	ether_ntohost(char *, const struct ether_addr *);
> -+#ifdef __cplusplus
> -+}
> -+#endif
> - 
> - #endif /* !_KERNEL */
> - 
> --- 
> -2.4.3
> -
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 4/8] package/android-tools: drop musl-compatibility cdefs patching out
  2016-08-12 20:49 ` [Buildroot] [PATCH 4/8] package/android-tools: drop musl-compatibility cdefs patching out Yann E. MORIN
@ 2016-08-14 21:34   ` Arnout Vandecappelle
  2016-08-14 21:57     ` Yann E. MORIN
  0 siblings, 1 reply; 24+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 21:34 UTC (permalink / raw)
  To: buildroot

On 12-08-16 22:49, Yann E. MORIN wrote:
> We now always have a sys/cdefs.h, so we no longer need to patch it out.
> 
> Simplify the patch by removing any hunk removing cdefs.h or the use of
> __BEGIN_DECLS/__END_DECLS. However, it must be included when macros it
> defines are being used.
> 
> Also, renumber patches to guarantee ordering.

 You actually changed the ordering...

0005-fix-big-endian-build.patch
0005-fix-static-link-zlib.patch

->

0005-fix-static-link-zlib.patch
0006-fix-big-endian-build.patch

so I guess the order doesn't matter.

 But anyway, after careful review of the patch-in-patch changes:

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>


 Regards,
 Arnout

> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  .../0004-Fix-build-issue-with-musl.patch           | 181 +--------------------
>  ...build.patch => 0006-fix-big-endian-build.patch} |   0
>  .../0007-include-cdefs-h-when-needed.patch         |  41 +++++
>  3 files changed, 43 insertions(+), 179 deletions(-)
>  rename package/android-tools/{0005-fix-big-endian-build.patch => 0006-fix-big-endian-build.patch} (100%)
>  create mode 100644 package/android-tools/0007-include-cdefs-h-when-needed.patch
[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 5/8] package/bcusdk: drop a musl-compatibility patch
  2016-08-12 20:49 ` [Buildroot] [PATCH 5/8] package/bcusdk: drop a musl-compatibility patch Yann E. MORIN
@ 2016-08-14 21:41   ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 21:41 UTC (permalink / raw)
  To: buildroot

On 12-08-16 22:49, Yann E. MORIN wrote:
> We now always have a sys/cdefs.h, so we can drop this patch.

 And renumber the remaining patch.

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout

> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
> ---
> Note that the patch was sent upstream, but it seems never acted upon.
> ---
>  ...t-use-the-non-standard-sys-cdefs.h-header.patch | 48 ----------------------
>  ...d_set-requires-inclusion-of-sys-select.h.patch} |  0
>  2 files changed, 48 deletions(-)
>  delete mode 100644 package/bcusdk/0001-Do-not-use-the-non-standard-sys-cdefs.h-header.patch
>  rename package/bcusdk/{0002-fd_set-requires-inclusion-of-sys-select.h.patch => 0001-fd_set-requires-inclusion-of-sys-select.h.patch} (100%)
> 
[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 6/8] package/libsepol: drop a musl-compatibility patch
  2016-08-12 20:49 ` [Buildroot] [PATCH 6/8] package/libsepol: " Yann E. MORIN
@ 2016-08-14 21:48   ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 21:48 UTC (permalink / raw)
  To: buildroot

On 12-08-16 22:49, Yann E. MORIN wrote:
> We now always have a sys/cdefs.h, so we can drop this patch.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

 After carefully checking that the removed patch doesn't do anything other than
cdefs.h and __BEGIN_DECLS:

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>


 Regards,
 Arnout

> ---
>  package/libsepol/0005-replace-cdefs.patch | 1074 -----------------------------
>  1 file changed, 1074 deletions(-)
>  delete mode 100644 package/libsepol/0005-replace-cdefs.patch
> 
[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 7/8] package/linknx: drop a musl-compatibility patch
  2016-08-12 20:50 ` [Buildroot] [PATCH 7/8] package/linknx: " Yann E. MORIN
@ 2016-08-14 21:49   ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 21:49 UTC (permalink / raw)
  To: buildroot

On 12-08-16 22:50, Yann E. MORIN wrote:
> We now always have a sys/cdefs.h, so we can drop this patch.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout

> ---
>  package/linknx/0002-musl-cdefs.patch | 37 ------------------------------------
>  1 file changed, 37 deletions(-)
>  delete mode 100644 package/linknx/0002-musl-cdefs.patch
> 
> diff --git a/package/linknx/0002-musl-cdefs.patch b/package/linknx/0002-musl-cdefs.patch
> deleted file mode 100644
> index 59e28ca..0000000
> --- a/package/linknx/0002-musl-cdefs.patch
> +++ /dev/null
> @@ -1,37 +0,0 @@
> -Do not use the non-standard <sys/cdefs.h> header
> -
> -<sys/cdefs.h> is glibc-specific, and should be used only internally by
> -glibc, not by external libraries/programs. It is not available in all
> -standard C libraries.
> -
> -Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> -(Patch sent upstream: https://sourceforge.net/p/linknx/patches/21/)
> -
> -diff -uNr linknx-0.0.1.32.org/include/eibclient.h linknx-0.0.1.32/include/eibclient.h
> ---- linknx-0.0.1.32.org/include/eibclient.h	2007-10-11 01:55:33.000000000 +0200
> -+++ linknx-0.0.1.32/include/eibclient.h	2016-01-23 23:21:17.315006629 +0100
> -@@ -27,11 +27,12 @@
> - #ifndef EIBCLIENT_H
> - #define EIBCLIENT_H
> - 
> --#include "sys/cdefs.h"
> - #include "stdint.h"
> - #include <pthsem.h>
> - 
> --__BEGIN_DECLS;
> -+#ifdef __cplusplus
> -+extern "C" {
> -+#endif
> - 
> - #include "eibloadresult.h"
> - 
> -@@ -705,5 +706,8 @@
> -  */
> - int EIB_LoadImage_async (EIBConnection * con, const uint8_t * image, int len);
> - 
> --__END_DECLS
> -+#ifdef __cplusplus
> -+}
> -+#endif
> -+
> - #endif
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 8/8] package/qlibc: drop a musl-compatibility patch
  2016-08-12 20:50 ` [Buildroot] [PATCH 8/8] package/qlibc: " Yann E. MORIN
@ 2016-08-14 21:50   ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 21:50 UTC (permalink / raw)
  To: buildroot

On 12-08-16 22:50, Yann E. MORIN wrote:
> We now always have a sys/cdefs.h, so we can drop this patch.
> 
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout

> ---
>  ...l-build-by-removing-usage-of-internal-gli.patch | 59 ----------------------
>  1 file changed, 59 deletions(-)
>  delete mode 100644 package/qlibc/0004-md5-fix-musl-build-by-removing-usage-of-internal-gli.patch
> 
[snip]

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl
  2016-08-14 21:20   ` Arnout Vandecappelle
@ 2016-08-14 21:56     ` Yann E. MORIN
  0 siblings, 0 replies; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-14 21:56 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2016-08-14 23:20 +0200, Arnout Vandecappelle spake thusly:
>  Subject line should be musl-compat-headers, not netbsd-...
> 
> On 12-08-16 22:49, Yann E. MORIN wrote:
> > musl provides neither sys/queue.h nor sys/cdefs.h. Those two headers are
> > however quite widely used in a lot of packages (though they should at
> > least not use cdefs,h which is only full of mostly-legacy macros, and
> > which is mostly an internal header of glibc and was never really meant to
> > be exposed to, and used by packages).
> > 
> > But we don;t live in an ideal world, so a lot of packages break when
>          don't
> 
> > those two headers are missing.
> > 
> > We already took care of sys/queue.h with the netbsd-queue package. But
> > the need for cdefs.h is getting more and more pressing.
> > 
> > We rename the netbsd-queue package into musl-compat-headers, and we
> > make it install sys/queue.h (from NetBSD) and sys/cdefs.h (a minimalist
> > one we bundle in Buildroot). We can't use the cdefs.h from NetBSD
> > because it includes machine-dependent headers; instead we bundle a very
> > minimalistic one, that covers only what we need.
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> 
>  In general I prefer to use an upstream like Khem proposes. However, in this
> case, it's really a lot easier if we can add or change the header as needed by
> breaking packages. So I like the way it's done now.

What khem ponted to is not an upstream. It is a minimalist header
OpenEmbeded crafted.

As you can read in the commit log, we can not use the upstream cdefs.h
header, as it includes a machine-dependent header. And we don't really
want to go that route of downloadign yet another header, which is
moreover different for each target...

> [snip]
> > diff --git a/package/musl-compat-headers/musl-compat-headers.mk b/package/musl-compat-headers/musl-compat-headers.mk
> > new file mode 100644
> > index 0000000..0758021
> > --- /dev/null
> > +++ b/package/musl-compat-headers/musl-compat-headers.mk
> > @@ -0,0 +1,29 @@
> > +################################################################################
> > +#
> > +# musl-compat-headers
> > +#
> > +################################################################################
> > +
> > +MUSL_COMPAT_HEADERS_SITE = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys
> > +MUSL_COMPAT_HEADERS_VERSION = 1.70
> > +MUSL_COMPAT_HEADERS_SOURCE = queue.h?rev=$(MUSL_COMPAT_HEADERS_VERSION)
> 
>  We may need additional files in the future (e.g. the tree.h that openembedded
> is carrying). Also, the definition of upstream here is not entirely correct,
> because that's only half the package. So I think it's nicer/cleaner to specify
> this as:
> 
> MUSL_COMPAT_HEADERS_EXTRA_DOWNLOADS = \
> 	http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/queue.h?rev=1.70

That's what I initially did, as I agree with you.

However, I want it to be minimaly intrusive, as it might be applied to
master and we're post -rc1.

> > +MUSL_COMPAT_HEADERS_LICENSE = BSD-3c, Public Domain or CC0
> 
>  Shouldn't we specify here
> 
> MUSL_COMPAT_HEADERS_LICENSE_FILES = queue.h cdefs.h

Good point. Will do.

> > +MUSL_COMPAT_HEADERS_ADD_TOOLCHAIN_DEPENDENCY = NO
> > +
> > +# Only installs headers
> > +MUSL_COMPAT_HEADERS_INSTALL_TARGET = NO
> > +MUSL_COMPAT_HEADERS_INSTALL_STAGING = YES
> > +
> > +define MUSL_COMPAT_HEADERS_EXTRACT_CMDS
> > +	cp $(DL_DIR)/$(MUSL_COMPAT_HEADERS_SOURCE) $(@D)/queue.h
>                      ^^^This would become
>                      $(notdir $(MUSL_COMPAT_HEADERS_EXTRA_DOWNLOADS))
> 
>  BTW I think it makes sense to use install here as well.

I re-used what was previously in the netbsd-queue package. But yes,
install is better. Will do.

[--SNIP--]
> > diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
> > index 29c1f36..967f022 100644
> > --- a/toolchain/toolchain-external/toolchain-external.mk
> > +++ b/toolchain/toolchain-external/toolchain-external.mk
> > @@ -246,11 +246,13 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float
> >  TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
> >  endif
> >  
> > -# musl does not provide a sys/queue.h implementation, so add the
> > -# netbsd-queue package that will install a sys/queue.h file in the
> > -# staging directory based on the NetBSD implementation.
> > +# musl does not provide an implementation for sys/queue.h or sys/cdefs.h. So,
> > +# add the netbsd-compat-headers package that will install those files, into
>              ^^^^^^musl

Yeah. Remnants of successive renames back-n-forth between
musl-compat-headers, netbsd-compat-headers, netbsd-headers and
musl-compat...

Will fix.

Thanks! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 4/8] package/android-tools: drop musl-compatibility cdefs patching out
  2016-08-14 21:34   ` Arnout Vandecappelle
@ 2016-08-14 21:57     ` Yann E. MORIN
  0 siblings, 0 replies; 24+ messages in thread
From: Yann E. MORIN @ 2016-08-14 21:57 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2016-08-14 23:34 +0200, Arnout Vandecappelle spake thusly:
> On 12-08-16 22:49, Yann E. MORIN wrote:
> > We now always have a sys/cdefs.h, so we no longer need to patch it out.
> > 
> > Simplify the patch by removing any hunk removing cdefs.h or the use of
> > __BEGIN_DECLS/__END_DECLS. However, it must be included when macros it
> > defines are being used.
> > 
> > Also, renumber patches to guarantee ordering.
> 
>  You actually changed the ordering...
> 
> 0005-fix-big-endian-build.patch
> 0005-fix-static-link-zlib.patch
> 
> ->
> 
> 0005-fix-static-link-zlib.patch
> 0006-fix-big-endian-build.patch
> 
> so I guess the order doesn't matter.

No it does not. But if you git-log the package, you'll see that the
static fix was introduced before the big-endian one.

>  But anyway, after careful review of the patch-in-patch changes:
> 
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Thanks!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs)
  2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
                   ` (7 preceding siblings ...)
  2016-08-12 20:50 ` [Buildroot] [PATCH 8/8] package/qlibc: " Yann E. MORIN
@ 2016-08-14 21:59 ` Arnout Vandecappelle
  8 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2016-08-14 21:59 UTC (permalink / raw)
  To: buildroot

On 12-08-16 22:49, Yann E. MORIN wrote:
> Hello All!
> 
> This series is an ateempt at quiescing, once and for all, all the build
> failures under musl, due to missing non-standard header cdefs.h.
[snip]
> Fixing all those bodies of code is nigh impossible, so instead we
> provide a strictly-minimal sys/cdefs.h, that defines only the three
> strictly-required macros:
> 
>   - __P() to declare function prototypes;
>   - __BEGIN_DECLS and __END_DECLS to enclose C declarations.
> 
> When (if!) more are needed, they can be added later.
> 
> The basic idea was suggested by Thomas P. on IRC. Thanks! :-)
> 
> This then allows us to drop quite a few patches that were removing use
> of cdefs.h. However, including sys/cdefs.h has been added to two
> packages that were relying on other glibc headers to include it.
>

 I had some minor comments on the first patch, all others have my Reviewed-by.
However, you missed two patches:

package/atftp/0002-argz.h-fix-musl-compile-add-missing-defines.patch

-> This one shows that __THROW and __attribute_pure__ may be needed as well.

package/attr/0002-avoid-glibc-specific-decls-defines.patch

-> Although it's probably better to keep it as is, otherwise an include cdefs.h
would have to be added.


 Regards,
 Arnout

[snip]


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2016-08-14 21:59 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-12 20:49 [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Yann E. MORIN
2016-08-12 20:49 ` [Buildroot] [PATCH 1/8] package/netbsd-compat-headers: provide compatibility headers not in musl Yann E. MORIN
2016-08-12 21:30   ` Khem Raj
2016-08-12 21:39     ` Yann E. MORIN
2016-08-13  2:35       ` Khem Raj
2016-08-14 10:41   ` Baruch Siach
2016-08-14 21:20   ` Arnout Vandecappelle
2016-08-14 21:56     ` Yann E. MORIN
2016-08-12 20:49 ` [Buildroot] [PATCH 2/8] package/rpcbind: include cdefs.h where needed Yann E. MORIN
2016-08-14 21:21   ` Arnout Vandecappelle
2016-08-12 20:49 ` [Buildroot] [PATCH 3/8] package/aircrack-ng: drop a musl-compatibility patch Yann E. MORIN
2016-08-14 21:22   ` Arnout Vandecappelle
2016-08-12 20:49 ` [Buildroot] [PATCH 4/8] package/android-tools: drop musl-compatibility cdefs patching out Yann E. MORIN
2016-08-14 21:34   ` Arnout Vandecappelle
2016-08-14 21:57     ` Yann E. MORIN
2016-08-12 20:49 ` [Buildroot] [PATCH 5/8] package/bcusdk: drop a musl-compatibility patch Yann E. MORIN
2016-08-14 21:41   ` Arnout Vandecappelle
2016-08-12 20:49 ` [Buildroot] [PATCH 6/8] package/libsepol: " Yann E. MORIN
2016-08-14 21:48   ` Arnout Vandecappelle
2016-08-12 20:50 ` [Buildroot] [PATCH 7/8] package/linknx: " Yann E. MORIN
2016-08-14 21:49   ` Arnout Vandecappelle
2016-08-12 20:50 ` [Buildroot] [PATCH 8/8] package/qlibc: " Yann E. MORIN
2016-08-14 21:50   ` Arnout Vandecappelle
2016-08-14 21:59 ` [Buildroot] [PATCH 0/8] musl: add compatibility cdefs.h header (branch yem/cdefs) Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.