From: Alex Suykov <alex.suykov@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] collectd: fix musl builds (ipc module)
Date: Mon, 23 Nov 2015 13:12:42 +0200 [thread overview]
Message-ID: <20151123111242.GA15180@vostro> (raw)
src/ipc.c uses shm_info.used_ids which musl only provides when
_GNU_SOURCE is defined.
The issue has been fixed upstream, but the fix is not in their
latest 5.5.0 release. Adding their patch as a temporary fix
to be removed on the next version bump.
https://github.com/collectd/collectd/issues/1147
https://github.com/collectd/collectd/commit/3e3848349b753d78a0b1d19648fb394866856bda
Fixes
http://autobuild.buildroot.net/results/e981c08f01d2916246a17b1dc112e8b3e8c628e2/
Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
---
v2: s-o-b line for the patch itself
package/collectd/0002-ipc-enable-gnu-source.patch | 28 +++++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 package/collectd/0002-ipc-enable-gnu-source.patch
diff --git a/package/collectd/0002-ipc-enable-gnu-source.patch b/package/collectd/0002-ipc-enable-gnu-source.patch
new file mode 100644
index 0000000..459fdbd
--- /dev/null
+++ b/package/collectd/0002-ipc-enable-gnu-source.patch
@@ -0,0 +1,28 @@
+https://github.com/collectd/collectd/commit/3e3848349b753d78a0b1d19648fb394866856bda
+
+ ipc: enable _GNU_SOURCE to fix build with musl libc
+
+ This fixes compile the compile error:
+
+ > ipc.c:154:49: error: 'struct shm_info' has no member named 'used_ids'
+ > ipc_submit_g("shm", "segments", NULL, shm_info.used_ids);
+ > ^
+
+ Fixes #1147
+
+Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
+
+diff --git a/src/ipc.c b/src/ipc.c
+index 3763f24..b403847 100644
+--- a/src/ipc.c
++++ b/src/ipc.c
+@@ -32,6 +32,9 @@
+ #include "configfile.h"
+
+ #if KERNEL_LINUX
++ /* _GNU_SOURCE is needed for struct shm_info.used_ids on musl libc */
++# define _GNU_SOURCE
++
+ /* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
+ /* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */
+ /* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */
--
2.0.3
next reply other threads:[~2015-11-23 11:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-23 11:12 Alex Suykov [this message]
2015-11-26 21:28 ` [Buildroot] [PATCH v2] collectd: fix musl builds (ipc module) Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151123111242.GA15180@vostro \
--to=alex.suykov@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox