all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: "Sören Tempel" <tempel@uni-bremen.de>
Cc: 65486@debbugs.gnu.org
Subject: [bug#65486] [PATCH] syscalls: Add support for musl libc
Date: Wed, 13 Sep 2023 22:39:50 +0200	[thread overview]
Message-ID: <87cyylkdt5.fsf@gnu.org> (raw)
In-Reply-To: <3DOVAMAK0VD13.2XDJ9MT35902D@8pit.net> ("Sören Tempel"'s message of "Wed, 13 Sep 2023 12:23:50 +0200")

Hi,

Sören Tempel <tempel@uni-bremen.de> skribis:

> Ludovic Courtès <ludo@gnu.org> wrote:

[...]

>> So what we want to check is whether we’re using the GNU libc or Musl,
>> regardless of the kernel.
>
> Keep in mind that—contrary to glibc—musl only supports Linux and not
> GNU/Hurd. Therefore, it should be sufficient to simply check for a
> linux-musl host and then use statfs/readdir over statfs64/readdir64:
>
> 	(let ((proc (syscall->procedure (if linux-musl?
> 	                                      "readdir"
> 	                                      "readdir64"))))
> 	  ........
>
> Would that be acceptable?

You could call it ‘musl?’ instead, to (hopefully) convey we’re
interested in the C library specifically.

>> Now, instead of checking the libc’s identity, we could check whether
>> “statfs64” is available, and if not, fall back to “statfs”.
>
> You mean using a GNU ./configure check?

No no, I meant something like:

  (or (false-if-exception (dynamic-func "readdir64" (dynamic-link)))
      (dynamic-func "readdir" (dynamic-link)))

Of course, it’s not as simple as this because we’d rather have it
integrated with ‘syscall->procedure’ (maybe by adding an
#:alternative-name argument for the Musl name?), but you get the idea.

HTH!

Ludo’.




  reply	other threads:[~2023-09-13 20:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24  6:33 [bug#65486] [PATCH] syscalls: Add support for musl libc soeren
2023-09-09 13:04 ` [bug#65486] [PATCH v2] " soeren
2023-09-11 21:09   ` [bug#65486] [PATCH] " Ludovic Courtès
2023-09-13 10:23     ` Sören Tempel
2023-09-13 20:39       ` Ludovic Courtès [this message]
2023-09-15 10:57         ` Sören Tempel
2023-09-17 10:14           ` bug#65486: " Ludovic Courtès
2023-09-17 10:17           ` [bug#65486] " Ludovic Courtès
2023-09-17 11:38             ` Christopher Baines
2023-09-17 15:21             ` [bug#65486] [PATCH v3] syscalls: Consistently use existing linux? definition soeren
2023-09-17 15:21               ` [bug#65486] [PATCH v3] syscalls: Add support for musl libc soeren
2023-09-30 10:16             ` [bug#65486] [PATCH] " Sören Tempel
2023-10-10 17:15               ` Christopher Baines
2023-10-23 10:11             ` Ludovic Courtès

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=87cyylkdt5.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=65486@debbugs.gnu.org \
    --cc=tempel@uni-bremen.de \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

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.