summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-01-13 19:48:47 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-22 23:42:54 +0000
commitcdb858caadd81d3bdc9ea3fd596e3eab84ec2d81 (patch)
tree85c5236a501c28d302bc359a1d1f62bc1334e32b
parent29e1edcba39a21057ba5862eef4e79c177e7ef62 (diff)
downloadopenembedded-core-contrib-cdb858caadd81d3bdc9ea3fd596e3eab84ec2d81.tar.gz
openembedded-core-contrib-cdb858caadd81d3bdc9ea3fd596e3eab84ec2d81.tar.bz2
openembedded-core-contrib-cdb858caadd81d3bdc9ea3fd596e3eab84ec2d81.zip
mdadm: Fix build with musl
Define _POSIX_C_SOURCE if not defined Add sockaddr_un* to sockaddr* typecast to make compiler happy Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta/recipes-extended/mdadm/files/0001-Define-_POSIX_C_SOURCE-if-undefined.patch59
-rw-r--r--meta/recipes-extended/mdadm/mdadm_3.3.4.bb2
2 files changed, 60 insertions, 1 deletions
diff --git a/meta/recipes-extended/mdadm/files/0001-Define-_POSIX_C_SOURCE-if-undefined.patch b/meta/recipes-extended/mdadm/files/0001-Define-_POSIX_C_SOURCE-if-undefined.patch
new file mode 100644
index 0000000000..a461b763c9
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/0001-Define-_POSIX_C_SOURCE-if-undefined.patch
@@ -0,0 +1,59 @@
+From d74b02d4653d1ea26029c2528eb93d7268b83eb3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 13 Jan 2016 07:28:33 +0000
+Subject: [PATCH] Define _POSIX_C_SOURCE if undefined
+
+typecast second argument of connect() API to use struct sockaddr*
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ config.c | 3 +++
+ mdmon.c | 2 +-
+ msg.c | 2 +-
+ 3 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/config.c b/config.c
+index a882ed3..a675688 100644
+--- a/config.c
++++ b/config.c
+@@ -63,6 +63,9 @@
+ * but may not wrap over lines
+ *
+ */
++#ifndef _POSIX_C_SOURCE
++#define _POSIX_C_SOURCE 200809L
++#endif
+
+ #ifndef CONFFILE
+ #define CONFFILE "/etc/mdadm.conf"
+diff --git a/mdmon.c b/mdmon.c
+index ee12b7c..e4b73d9 100644
+--- a/mdmon.c
++++ b/mdmon.c
+@@ -235,7 +235,7 @@ static int make_control_sock(char *devname)
+ addr.sun_family = PF_LOCAL;
+ strcpy(addr.sun_path, path);
+ umask(077); /* ensure no world write access */
+- if (bind(sfd, &addr, sizeof(addr)) < 0) {
++ if (bind(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
+ close(sfd);
+ return -1;
+ }
+diff --git a/msg.c b/msg.c
+index 754630b..45cd450 100644
+--- a/msg.c
++++ b/msg.c
+@@ -170,7 +170,7 @@ int connect_monitor(char *devname)
+
+ addr.sun_family = PF_LOCAL;
+ strcpy(addr.sun_path, path);
+- if (connect(sfd, &addr, sizeof(addr)) < 0) {
++ if (connect(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
+ close(sfd);
+ return -1;
+ }
+--
+2.7.0
+
diff --git a/meta/recipes-extended/mdadm/mdadm_3.3.4.bb b/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
index 099361181e..e004030f85 100644
--- a/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
+++ b/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
@@ -14,13 +14,13 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
file://mdadm-3.3.2_x32_abi_time_t.patch \
file://0001-Fix-typo-in-comparision.patch \
file://mdadm-fix-ptest-build-errors.patch \
+ file://0001-Define-_POSIX_C_SOURCE-if-undefined.patch \
file://run-ptest \
"
SRC_URI[md5sum] = "7ca8b114710f98f53f20c5787b674a09"
SRC_URI[sha256sum] = "8ae5f45306b873190e91f410709b00e51997b633c072b33f8efd9f7df022ca68"
CFLAGS += "-fno-strict-aliasing"
-
inherit autotools-brokensep
EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"'