diff options
author | Khem Raj <raj.khem@gmail.com> | 2018-03-05 21:12:41 -0800 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2018-03-12 10:01:17 -0700 |
commit | 404a37a9efd32cd985608023a8829c558f93a8c1 (patch) | |
tree | c9a8c5b0e37ab33d02fb34b26cb8cc3c0c6f988b /meta-oe | |
parent | 154d1cc86359550046ef99ef8686920a91663dd2 (diff) | |
download | meta-openembedded-404a37a9efd32cd985608023a8829c558f93a8c1.tar.gz |
umip: Fix build incompatibilities
musl exposes some build issues which require portable code.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe')
3 files changed, 194 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/umip/files/0001-replace-SIGCLD-with-SIGCHLD-and-include-sys-types.h.patch b/meta-oe/recipes-connectivity/umip/files/0001-replace-SIGCLD-with-SIGCHLD-and-include-sys-types.h.patch new file mode 100644 index 000000000..8192056d1 --- /dev/null +++ b/meta-oe/recipes-connectivity/umip/files/0001-replace-SIGCLD-with-SIGCHLD-and-include-sys-types.h.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From f567740cf64978ac9db014c786b6d0267b244f33 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 4 Mar 2018 22:30:30 -0800 | ||
4 | Subject: [PATCH 1/2] replace SIGCLD with SIGCHLD and include sys/types.h | ||
5 | |||
6 | Fixes | ||
7 | main.c:129:10: error: 'SIGCLD' undeclared (first use in this function); did you mean 'SIGCHLD'? | ||
8 | signal(SIGCLD, sig_child); | ||
9 | ^~~~~~ | ||
10 | SIGCHLD | ||
11 | |||
12 | main.c:125:2: warning: implicit declaration of function 'umask' [-Wimplicit-function-declaration] | ||
13 | umask(0); | ||
14 | ^~~~~ | ||
15 | |||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | Upstream-Status: Pending | ||
19 | |||
20 | src/main.c | 5 +++-- | ||
21 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/src/main.c b/src/main.c | ||
24 | index 3cf4072..cd34196 100644 | ||
25 | --- a/src/main.c | ||
26 | +++ b/src/main.c | ||
27 | @@ -31,6 +31,7 @@ | ||
28 | #include <sys/ioctl.h> | ||
29 | #include <sys/wait.h> | ||
30 | #include <sys/param.h> | ||
31 | +#include <sys/types.h> | ||
32 | #include <pthread.h> | ||
33 | #include <fcntl.h> | ||
34 | #include <unistd.h> | ||
35 | @@ -126,9 +127,9 @@ static void daemon_start(int ignsigcld) | ||
36 | |||
37 | if (ignsigcld) { | ||
38 | #ifdef SIGTSTP | ||
39 | - signal(SIGCLD, sig_child); | ||
40 | + signal(SIGCHLD, sig_child); | ||
41 | #else | ||
42 | - signal(SIGCLD, SIG_IGN); | ||
43 | + signal(SIGCHLD, SIG_IGN); | ||
44 | #endif | ||
45 | } | ||
46 | } | ||
47 | -- | ||
48 | 2.16.2 | ||
49 | |||
diff --git a/meta-oe/recipes-connectivity/umip/files/0002-replace-PTHREAD_MUTEX_FAST_NP-with-PTHREAD_MUTEX_NOR.patch b/meta-oe/recipes-connectivity/umip/files/0002-replace-PTHREAD_MUTEX_FAST_NP-with-PTHREAD_MUTEX_NOR.patch new file mode 100644 index 000000000..90d12da14 --- /dev/null +++ b/meta-oe/recipes-connectivity/umip/files/0002-replace-PTHREAD_MUTEX_FAST_NP-with-PTHREAD_MUTEX_NOR.patch | |||
@@ -0,0 +1,143 @@ | |||
1 | From 19b6cf8099e1974b5fc39086fc54103b0cbc2658 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 4 Mar 2018 23:01:25 -0800 | ||
4 | Subject: [PATCH 2/2] replace PTHREAD_MUTEX_FAST_NP with PTHREAD_MUTEX_NORMAL | ||
5 | |||
6 | PTHREAD_MUTEX_FAST_NP is not available on non-posix systems | ||
7 | e.g. musl | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | Upstream-Status: Pending | ||
12 | |||
13 | src/ha.c | 2 +- | ||
14 | src/icmp6.c | 2 +- | ||
15 | src/mh.c | 2 +- | ||
16 | src/mn.c | 2 +- | ||
17 | src/movement.c | 2 +- | ||
18 | src/mpdisc_ha.c | 2 +- | ||
19 | src/mpdisc_mn.c | 2 +- | ||
20 | src/tqueue.c | 2 +- | ||
21 | src/tunnelctl.c | 2 +- | ||
22 | 9 files changed, 9 insertions(+), 9 deletions(-) | ||
23 | |||
24 | diff --git a/src/ha.c b/src/ha.c | ||
25 | index fbdcff0..b2f811e 100644 | ||
26 | --- a/src/ha.c | ||
27 | +++ b/src/ha.c | ||
28 | @@ -1246,7 +1246,7 @@ int ha_init(void) | ||
29 | { | ||
30 | pthread_mutexattr_t mattrs; | ||
31 | pthread_mutexattr_init(&mattrs); | ||
32 | - pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP); | ||
33 | + pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL); | ||
34 | if (pthread_mutex_init(&bu_worker_mutex, &mattrs) || | ||
35 | pthread_cond_init(&cond, NULL)) | ||
36 | return -1; | ||
37 | diff --git a/src/icmp6.c b/src/icmp6.c | ||
38 | index 3695135..6460634 100644 | ||
39 | --- a/src/icmp6.c | ||
40 | +++ b/src/icmp6.c | ||
41 | @@ -243,7 +243,7 @@ int icmp6_init(void) | ||
42 | return -1; | ||
43 | /* create ICMP listener thread */ | ||
44 | pthread_mutexattr_init(&mattrs); | ||
45 | - pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP); | ||
46 | + pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL); | ||
47 | if (pthread_mutex_init(&icmp6_sock.send_mutex, &mattrs) || | ||
48 | pthread_rwlock_init(&handler_lock, NULL) || | ||
49 | pthread_create(&icmp6_listener, NULL, icmp6_listen, NULL)) | ||
50 | diff --git a/src/mh.c b/src/mh.c | ||
51 | index 60e345e..7928f4c 100644 | ||
52 | --- a/src/mh.c | ||
53 | +++ b/src/mh.c | ||
54 | @@ -204,7 +204,7 @@ int mh_init(void) | ||
55 | return -1; | ||
56 | |||
57 | pthread_mutexattr_init(&mattrs); | ||
58 | - pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP); | ||
59 | + pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL); | ||
60 | if (pthread_mutex_init(&mh_sock.send_mutex, &mattrs) || | ||
61 | pthread_rwlock_init(&handler_lock, NULL) || | ||
62 | pthread_create(&mh_listener, NULL, mh_listen, NULL)) | ||
63 | diff --git a/src/mn.c b/src/mn.c | ||
64 | index 092cfcb..8f7f448 100644 | ||
65 | --- a/src/mn.c | ||
66 | +++ b/src/mn.c | ||
67 | @@ -1478,7 +1478,7 @@ static struct home_addr_info *hai_copy(struct home_addr_info *conf_hai) | ||
68 | if (hai != NULL) { | ||
69 | pthread_mutexattr_t mattrs; | ||
70 | pthread_mutexattr_init(&mattrs); | ||
71 | - pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP); | ||
72 | + pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL); | ||
73 | |||
74 | memcpy(hai, conf_hai, sizeof(struct home_addr_info)); | ||
75 | |||
76 | diff --git a/src/movement.c b/src/movement.c | ||
77 | index d985937..6400448 100644 | ||
78 | --- a/src/movement.c | ||
79 | +++ b/src/movement.c | ||
80 | @@ -2013,7 +2013,7 @@ int md_init(void) | ||
81 | int val; | ||
82 | |||
83 | pthread_mutexattr_init(&mattrs); | ||
84 | - pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP); | ||
85 | + pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL); | ||
86 | if (pthread_mutex_init(&iface_lock, &mattrs)) | ||
87 | return -1; | ||
88 | |||
89 | diff --git a/src/mpdisc_ha.c b/src/mpdisc_ha.c | ||
90 | index 40ba05f..fd7a90d 100644 | ||
91 | --- a/src/mpdisc_ha.c | ||
92 | +++ b/src/mpdisc_ha.c | ||
93 | @@ -559,7 +559,7 @@ int mpd_ha_init(void) | ||
94 | { | ||
95 | pthread_mutexattr_t mattrs; | ||
96 | pthread_mutexattr_init(&mattrs); | ||
97 | - pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP); | ||
98 | + pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL); | ||
99 | if (pthread_mutex_init(&mpa_lock, &mattrs) || | ||
100 | pthread_rwlock_init(&prefix_lock, NULL) || | ||
101 | hash_init(&mpa_hash, DOUBLE_ADDR, MPA_BUCKETS) < 0) | ||
102 | diff --git a/src/mpdisc_mn.c b/src/mpdisc_mn.c | ||
103 | index 4873bd6..ada02bd 100644 | ||
104 | --- a/src/mpdisc_mn.c | ||
105 | +++ b/src/mpdisc_mn.c | ||
106 | @@ -267,7 +267,7 @@ int mpd_mn_init(void) | ||
107 | { | ||
108 | pthread_mutexattr_t mattrs; | ||
109 | pthread_mutexattr_init(&mattrs); | ||
110 | - pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP); | ||
111 | + pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL); | ||
112 | if (pthread_mutex_init(&mps_lock, &mattrs)) | ||
113 | return -1; | ||
114 | if (hash_init(&mps_hash, DOUBLE_ADDR, MPS_BUCKETS) < 0) | ||
115 | diff --git a/src/tqueue.c b/src/tqueue.c | ||
116 | index 2f7aa0b..9c185b8 100644 | ||
117 | --- a/src/tqueue.c | ||
118 | +++ b/src/tqueue.c | ||
119 | @@ -65,7 +65,7 @@ int taskqueue_init(void) | ||
120 | { | ||
121 | pthread_mutexattr_t mattrs; | ||
122 | pthread_mutexattr_init(&mattrs); | ||
123 | - pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP); | ||
124 | + pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL); | ||
125 | if (pthread_mutex_init(&mutex, &mattrs) || | ||
126 | pthread_cond_init(&cond, NULL) || | ||
127 | pthread_create(&tq_runner, NULL, runner, NULL)) | ||
128 | diff --git a/src/tunnelctl.c b/src/tunnelctl.c | ||
129 | index 23fc20b..813b8ec 100644 | ||
130 | --- a/src/tunnelctl.c | ||
131 | +++ b/src/tunnelctl.c | ||
132 | @@ -433,7 +433,7 @@ int tunnelctl_init(void) | ||
133 | return -1; | ||
134 | |||
135 | pthread_mutexattr_init(&mattrs); | ||
136 | - pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_FAST_NP); | ||
137 | + pthread_mutexattr_settype(&mattrs, PTHREAD_MUTEX_NORMAL); | ||
138 | if (pthread_mutex_init(&tnl_lock, &mattrs)) | ||
139 | return -1; | ||
140 | |||
141 | -- | ||
142 | 2.16.2 | ||
143 | |||
diff --git a/meta-oe/recipes-connectivity/umip/umip_1.0.bb b/meta-oe/recipes-connectivity/umip/umip_1.0.bb index 2129e379c..0c120bfd8 100644 --- a/meta-oe/recipes-connectivity/umip/umip_1.0.bb +++ b/meta-oe/recipes-connectivity/umip/umip_1.0.bb | |||
@@ -14,6 +14,8 @@ SRC_URI = "git://github.com/jlanza/umip \ | |||
14 | file://mip6d \ | 14 | file://mip6d \ |
15 | file://mip6d.service \ | 15 | file://mip6d.service \ |
16 | file://0001-Add-format-string-to-fprintf-call.patch \ | 16 | file://0001-Add-format-string-to-fprintf-call.patch \ |
17 | file://0001-replace-SIGCLD-with-SIGCHLD-and-include-sys-types.h.patch \ | ||
18 | file://0002-replace-PTHREAD_MUTEX_FAST_NP-with-PTHREAD_MUTEX_NOR.patch \ | ||
17 | " | 19 | " |
18 | SRCREV = "7d67209cd1bba2dd0e183a0fa07eeef07964dd14" | 20 | SRCREV = "7d67209cd1bba2dd0e183a0fa07eeef07964dd14" |
19 | 21 | ||