New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build failure with musl libc due to struct shm_info.used_ids #1147
Comments
I can confirm that this fixes the build on musl. If you could send a pull request that would be great. |
Where did you get that from? I can not see anything in documentation that indicates that _GNU_SOURCE is deprecated. Are you sure you don't mean _BSD_SOURCE? I can On musl the only effect it has is that it enables _BSD_SOURCE in addition: #if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE)
#define _BSD_SOURCE 1
#endif |
Ah yes you're right, I confused _GNU_SOURCE with _BSD_SOURCE. |
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 collectd#1147
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
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. collectd/collectd#1147 collectd/collectd@3e38483 Fixes http://autobuild.buildroot.net/results/e981c08f01d2916246a17b1dc112e8b3e8c628e2/ Signed-off-by: Alex Suykov <alex.suykov@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
With musl libc it fails to build with the error:
You need to define _GNU_SOURCE on musl libc for the member 'used_ids', probably due to it is not required in POSIX.
I have two different suggestions on how to fix it:
or:
I can prepare a signed-off patch that you can git am if you tell me which way you prefer.
The text was updated successfully, but these errors were encountered: