All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: Brahmajit Das <listout@listout.xyz>, kees@kernel.org
Cc: linux-kernel@vger.kernel.org, gnoack3000@gmail.com
Subject: Re: [RFC PATCH] samples/check-exec: Fix building on musl libc
Date: Tue, 1 Jul 2025 11:07:06 +0200	[thread overview]
Message-ID: <20250701.daeghaimaL0s@digikod.net> (raw)
In-Reply-To: <20250630202353.28439-1-listout@listout.xyz>

On Tue, Jul 01, 2025 at 01:53:53AM +0530, Brahmajit Das wrote:
> Building with make allyesconfig on musl results in the following
> 
> In file included from samples/check-exec/inc.c:23:
> /usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
>    88 | struct prctl_mm_map {
>       |        ^~~~~~~~~~~~
> In file included from samples/check-exec/inc.c:17:
> 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!

Reviewed-by: Mickaël Salaün <mic@digikod.net>

Kees, feel free to take it in your tree.  FYI, for the equivalent
changes in Landlock, I moved down the if/include/endif block to ease
sorting of include lines.

> ---
>  samples/check-exec/inc.c      | 2 ++
>  samples/check-exec/set-exec.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/samples/check-exec/inc.c b/samples/check-exec/inc.c
> index 7f6ef06a2f06..775ae8613782 100644
> --- a/samples/check-exec/inc.c
> +++ b/samples/check-exec/inc.c
> @@ -14,7 +14,9 @@
>  #define _GNU_SOURCE
>  #include <errno.h>
>  #include <linux/fcntl.h>
> +#if defined(__GLIBC__)
>  #include <linux/prctl.h>
> +#endif
>  #include <linux/securebits.h>
>  #include <stdbool.h>
>  #include <stdio.h>
> diff --git a/samples/check-exec/set-exec.c b/samples/check-exec/set-exec.c
> index ba86a60a20dd..a75b8c6e6b11 100644
> --- a/samples/check-exec/set-exec.c
> +++ b/samples/check-exec/set-exec.c
> @@ -9,7 +9,9 @@
>  #define _GNU_SOURCE
>  #define __SANE_USERSPACE_TYPES__
>  #include <errno.h>
> +#if defined(__GLIBC__)
>  #include <linux/prctl.h>
> +#endif
>  #include <linux/securebits.h>
>  #include <stdbool.h>
>  #include <stdio.h>
> -- 
> 2.50.0
> 

      reply	other threads:[~2025-07-01  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 20:23 [RFC PATCH] samples/check-exec: Fix building on musl libc Brahmajit Das
2025-07-01  9:07 ` 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.daeghaimaL0s@digikod.net \
    --to=mic@digikod.net \
    --cc=gnoack3000@gmail.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.