diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-01-06 14:18:00 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-22 23:42:50 +0000 |
commit | 3c54b18797eb26d2045fd506d2b0c8b996a0396c (patch) | |
tree | 978f5decd640b605e5084895d7f3ac41fa5d47ad /meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch | |
parent | 49e8fc6c4511e026dee176422cf3a7b7558c7cfc (diff) | |
download | openembedded-core-3c54b18797eb26d2045fd506d2b0c8b996a0396c.tar.gz |
iputils: Use member based initialization for mrghdr struct
Fix build with musl
uclibc and glibc dont agree on structure of the struct, musl rightly
adds padding elements, so when doing anonymous initialization struct
elements gets wrongly mapped on 64bit arches
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch')
-rw-r--r-- | meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch b/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch new file mode 100644 index 0000000000..6da01dc616 --- /dev/null +++ b/meta/recipes-extended/iputils/files/0001-Intialize-struct-elements-by-name.patch @@ -0,0 +1,52 @@ +From 000629f74908a2a95f6104444c77ad93cf40d62d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 13 Jan 2016 08:50:50 +0000 +Subject: [PATCH] Intialize struct elements by name + +makes it portable across glibc and musl + +Fixes errors + +| ping.c: In function 'send_probe': +| ping.c:735:19: warning: initialization makes integer from pointer +without a cast [-Wint-conversion] +| &iov, 1, &cmsg, 0, 0 }; +| ^ +| ping.c:735:19: note: (near initialization for 'm.__pad1') +| ping.c:735:19: error: initializer element is not computable at load +time +| ping.c:735:19: note: (near initialization for 'm.__pad1') +| make: *** [ping.o] Error 1 + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- +Upstream-Status: Pending + + ping.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/ping.c b/ping.c +index 4989760..e67f381 100644 +--- a/ping.c ++++ b/ping.c +@@ -731,8 +731,15 @@ int send_probe() + + do { + static struct iovec iov = {outpack, 0}; +- static struct msghdr m = { &whereto, sizeof(whereto), +- &iov, 1, &cmsg, 0, 0 }; ++ static struct msghdr m = { ++ .msg_name = &whereto, ++ .msg_namelen = sizeof(whereto), ++ .msg_iov = &iov, ++ .msg_iovlen = 1, ++ .msg_control = &cmsg, ++ .msg_controllen = 0, ++ .msg_flags= 0, ++ }; + m.msg_controllen = cmsg_len; + iov.iov_len = cc; + +-- +2.7.0 + |