From: "Mickaël Salaün" <mic@digikod.net>
To: Brahmajit Das <listout@listout.xyz>
Cc: linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, gnoack@google.com,
jamorris@linux.microsoft.com
Subject: Re: [RFC PATCH] samples/landlock: Fix building on musl libc
Date: Tue, 1 Jul 2025 10:50:55 +0200 [thread overview]
Message-ID: <20250701.Ahj9ohkee3wu@digikod.net> (raw)
In-Reply-To: <20250630203248.16273-1-listout@listout.xyz>
On Tue, Jul 01, 2025 at 02:02:48AM +0530, Brahmajit Das wrote:
> Building with make allyesconfig on musl results in the following
>
> In file included from samples/landlock/sandboxer.c:22:
> /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
> 88 | struct prctl_mm_map {
> | ^~~~~~~~~~~~
> In file included from samples/landlock/sandboxer.c:16:
> usr/include/linux/prctl.h:134:8: note: originally defined here
> 134 | struct prctl_mm_map {
> | ^~~~~~~~~~~~
>
> This is mainly due to differnece in the sys/prctl.h between glibC and
> musl. The struct prctl_mm_map is defined in sys/prctl.h in musl.
>
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
Thanks, applied to my -next tree. I just moved down the if/include/endif
block.
I tested it with check-linux.sh from
https://github.com/landlock-lsm/landlock-test-tools
ARCH=x86_64 CC=musl-gcc check-linux.sh build
> ---
> samples/landlock/sandboxer.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/samples/landlock/sandboxer.c b/samples/landlock/sandboxer.c
> index 4e2854c6f9a3..3cc990618f5b 100644
> --- a/samples/landlock/sandboxer.c
> +++ b/samples/landlock/sandboxer.c
> @@ -13,7 +13,9 @@
> #include <errno.h>
> #include <fcntl.h>
> #include <linux/landlock.h>
> +#if defined(__GLIBC__)
> #include <linux/prctl.h>
> +#endif
> #include <linux/socket.h>
> #include <stddef.h>
> #include <stdio.h>
> --
> 2.50.0
>
>
prev parent reply other threads:[~2025-07-01 8:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-30 20:32 Brahmajit Das
2025-07-01 8:50 ` Mickaël Salaün [this message]
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=20250701.Ahj9ohkee3wu@digikod.net \
--to=mic@digikod.net \
--cc=gnoack@google.com \
--cc=jamorris@linux.microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=listout@listout.xyz \
/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
all inboxes | Powered by JetHome®