diff options
author | Khem Raj <raj.khem@gmail.com> | 2015-12-30 01:27:51 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-24 09:40:28 +0000 |
commit | 93fb408e787526375ce699723691c815414f7b77 (patch) | |
tree | b3d219363a2683dcf941c700a01bf258d6f089f6 /meta/recipes-extended | |
parent | 7509ffd3f9a9032221af430c928c00b8e1d23468 (diff) | |
download | poky-93fb408e787526375ce699723691c815414f7b77.tar.gz |
watchdog: Fix build with musl
This patch is generic but is found during compiling watchdog with musl
(From OE-Core rev: 00d30f7c772299f612e5f4d975042280e0d18f83)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r-- | meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch | 99 | ||||
-rw-r--r-- | meta/recipes-extended/watchdog/watchdog_5.14.bb | 8 |
2 files changed, 106 insertions, 1 deletions
diff --git a/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch b/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch new file mode 100644 index 0000000000..8afed5c0db --- /dev/null +++ b/meta/recipes-extended/watchdog/watchdog/0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | From 83ec34df357218a1c9cfc13a23d3367d333652c3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 30 Dec 2015 01:01:15 +0000 | ||
4 | Subject: [PATCH] Fix build issues found with non glibc C libraries | ||
5 | |||
6 | Add time.h for getting time_t definition | ||
7 | limits.h for PATH_MAX | ||
8 | linux/param.h for EXEC_PAGESIZE | ||
9 | Replace deprecated MNTTAB with _PATH_MNTTAB | ||
10 | include ext2_mnt.h for MNTOPT_USRQUOTA and MNTOPT_GRPQUOTA and | ||
11 | MNTTYPE_EXT2 | ||
12 | Include sys/types.h for u_char definition | ||
13 | |||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | |||
17 | Upstream-Status: Submitted | ||
18 | |||
19 | include/extern.h | 1 + | ||
20 | src/configfile.c | 1 + | ||
21 | src/memory.c | 3 +++ | ||
22 | src/net.c | 1 + | ||
23 | src/shutdown.c | 3 ++- | ||
24 | 5 files changed, 8 insertions(+), 1 deletion(-) | ||
25 | |||
26 | diff --git a/include/extern.h b/include/extern.h | ||
27 | index 21db11b..04b16bc 100644 | ||
28 | --- a/include/extern.h | ||
29 | +++ b/include/extern.h | ||
30 | @@ -3,6 +3,7 @@ | ||
31 | |||
32 | #include <netinet/in.h> | ||
33 | #include <stdio.h> | ||
34 | +#include <time.h> | ||
35 | |||
36 | #include "logmessage.h" | ||
37 | #include "xmalloc.h" | ||
38 | diff --git a/src/configfile.c b/src/configfile.c | ||
39 | index be5d7b3..7c1d1dd 100644 | ||
40 | --- a/src/configfile.c | ||
41 | +++ b/src/configfile.c | ||
42 | @@ -16,6 +16,7 @@ | ||
43 | #include <errno.h> | ||
44 | #include <string.h> | ||
45 | #include <dirent.h> | ||
46 | +#include <limits.h> | ||
47 | #include <sys/stat.h> | ||
48 | |||
49 | #include "extern.h" | ||
50 | diff --git a/src/memory.c b/src/memory.c | ||
51 | index e9607e4..b5e08aa 100644 | ||
52 | --- a/src/memory.c | ||
53 | +++ b/src/memory.c | ||
54 | @@ -21,6 +21,9 @@ | ||
55 | #include <sys/stat.h> | ||
56 | #include <sys/param.h> | ||
57 | #include <sys/mman.h> | ||
58 | +#ifdef __linux__ | ||
59 | +#include <linux/param.h> | ||
60 | +#endif | ||
61 | |||
62 | #include "extern.h" | ||
63 | #include "watch_err.h" | ||
64 | diff --git a/src/net.c b/src/net.c | ||
65 | index 21823ae..8930caf 100644 | ||
66 | --- a/src/net.c | ||
67 | +++ b/src/net.c | ||
68 | @@ -17,6 +17,7 @@ | ||
69 | #include <string.h> | ||
70 | #include <unistd.h> /* for gethostname() etc */ | ||
71 | #include <netdb.h> /* for gethostbyname() */ | ||
72 | +#include <sys/types.h> | ||
73 | #include <sys/param.h> /* for MAXHOSTNAMELEN */ | ||
74 | #include <sys/socket.h> | ||
75 | #include <netinet/in.h> | ||
76 | diff --git a/src/shutdown.c b/src/shutdown.c | ||
77 | index 74aafa5..46b99cf 100644 | ||
78 | --- a/src/shutdown.c | ||
79 | +++ b/src/shutdown.c | ||
80 | @@ -25,6 +25,7 @@ | ||
81 | |||
82 | #include "watch_err.h" | ||
83 | #include "extern.h" | ||
84 | +#include "ext2_mnt.h" | ||
85 | |||
86 | #if defined __GLIBC__ | ||
87 | #include "ext2_mnt.h" | ||
88 | @@ -123,7 +124,7 @@ static void mnt_off() | ||
89 | FILE *fp; | ||
90 | struct mntent *mnt; | ||
91 | |||
92 | - fp = setmntent(MNTTAB, "r"); | ||
93 | + fp = setmntent(_PATH_MNTTAB, "r"); | ||
94 | /* in some rare cases fp might be NULL so be careful */ | ||
95 | while (fp != NULL && ((mnt = getmntent(fp)) != (struct mntent *)0)) { | ||
96 | /* First check if swap */ | ||
97 | -- | ||
98 | 2.6.4 | ||
99 | |||
diff --git a/meta/recipes-extended/watchdog/watchdog_5.14.bb b/meta/recipes-extended/watchdog/watchdog_5.14.bb index 9cb89d586c..fc717bc53d 100644 --- a/meta/recipes-extended/watchdog/watchdog_5.14.bb +++ b/meta/recipes-extended/watchdog/watchdog_5.14.bb | |||
@@ -12,7 +12,9 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \ | |||
12 | file://fixsepbuild.patch \ | 12 | file://fixsepbuild.patch \ |
13 | file://fix-ping-failure.patch \ | 13 | file://fix-ping-failure.patch \ |
14 | file://watchdog-init.patch \ | 14 | file://watchdog-init.patch \ |
15 | file://watchdog-conf.patch" | 15 | file://watchdog-conf.patch \ |
16 | file://0001-Fix-build-issues-found-with-non-glibc-C-libraries.patch \ | ||
17 | " | ||
16 | 18 | ||
17 | SRC_URI[md5sum] = "5b2dba0c593942f4acc100bca0d560c4" | 19 | SRC_URI[md5sum] = "5b2dba0c593942f4acc100bca0d560c4" |
18 | SRC_URI[sha256sum] = "620b2f49e9879f2e85c73d4c1f422f9101e6b38e824fea2414befd8bb6866ad1" | 20 | SRC_URI[sha256sum] = "620b2f49e9879f2e85c73d4c1f422f9101e6b38e824fea2414befd8bb6866ad1" |
@@ -23,6 +25,10 @@ UPSTREAM_CHECK_REGEX = "/watchdog/(?P<pver>(\d+[\.\-_]*)+)/" | |||
23 | inherit autotools | 25 | inherit autotools |
24 | inherit update-rc.d | 26 | inherit update-rc.d |
25 | 27 | ||
28 | DEPENDS_append_libc-musl = " libtirpc " | ||
29 | CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc " | ||
30 | LDFLAGS_append_libc-musl = " -ltirpc " | ||
31 | |||
26 | INITSCRIPT_NAME = "watchdog.sh" | 32 | INITSCRIPT_NAME = "watchdog.sh" |
27 | INITSCRIPT_PARAMS = "start 15 1 2 3 4 5 . stop 85 0 6 ." | 33 | INITSCRIPT_PARAMS = "start 15 1 2 3 4 5 . stop 85 0 6 ." |
28 | 34 | ||