mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: jane400 <jane400@postmarketos.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] sys/prctl.h: use linux uapi header
Date: Fri, 6 Sep 2024 12:42:49 -0400	[thread overview]
Message-ID: <20240906164249.GO32249@brightrain.aerifal.cx> (raw)
In-Reply-To: <f205094d-d090-4a06-904a-d74bd244a7cb@postmarketos.org>

On Fri, Sep 06, 2024 at 04:12:23PM +0200, jane400 wrote:
> On 06.09.24 14:45, Rich Felker wrote:
> > On Fri, Sep 06, 2024 at 01:49:30PM +0200, jane400 wrote:
> > > The file also includes backports until 2023 for older kernels.
> > > 
> > > There are no exisiting UAPI guards in the kernel for this header
> > > and as complex projects like systemd sometimes use both, it was
> > > easiest to just use the defintions from the kernel directly instead
> > > of copying in them. This way we're never redefining stuff in end-user
> > > applications and get the benefit of using the latest API that is
> > > available on this system.
> > Using both is not a supported usage. This comes up in multiple places
> > other than sys/prctl.h, like lots of network stuff, and the
> > applications doing it just need to be fixed. Generally we do not use
> > uapi headers at all from musl, and offer a working compilation
> > environment without uapi headers installed. This would also be a
> > breaking change if we ever needed to call prctls internally from libc,
> > as then building musl itself would depend on kernel headers.
> 
> Another solution of course is expanding the linux/libc-compat.h a lot and
> use the `#if !__UAPI_DEF_FOO` in musl, as intended by the kernel. I can poke
> at bit at the kernel and bring that forward if you want?

We intentionally don't support having types defined from the kernel
headers because of ways they could potentially disagree. The other
direction, musl defining the __UAPI_* macros to suppress kernel header
definitions, is supported, and should be acceptable to add here if the
kernel honored it. This requires including the libc headers first,
which is already the policy for network headers.

Rich

      parent reply	other threads:[~2024-09-06 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 11:49 jane400
2024-09-06 12:45 ` Rich Felker
     [not found]   ` <f205094d-d090-4a06-904a-d74bd244a7cb@postmarketos.org>
2024-09-06 16:42     ` Rich Felker [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=20240906164249.GO32249@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=jane400@postmarketos.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).