mailing list of musl libc
 help / color / mirror / code / Atom feed
From: ardi <ardillasdelmonte@gmail.com>
To: musl@lists.openwall.com
Subject: Re: Feature request: building musl in a portable way
Date: Fri, 22 Dec 2017 20:04:31 +0100	[thread overview]
Message-ID: <CA+fZqCX14DyRp+ivD-r40yyV9c4mbLEidt0+UYiO1QHY_e6GTw@mail.gmail.com> (raw)
In-Reply-To: <20171222164339.GB1627@brightrain.aerifal.cx>

On Fri, Dec 22, 2017 at 5:43 PM, Rich Felker <dalias@libc.org> wrote:
> [...] You can change the syscall layer just by
> making a new arch that defines (in syscall_arch.h and bits/syscall.h)
> your mechanism. See the recent wasm thread or midipix for examples of
> more exotic ways this can be done.

Thanks a lot!! I'll try to follow this path. It looks clean.


> But be aware that the ability to
> get a POSIX-conforming implementation where EINTR and thread
> cancellation work requires some sort of atomic boundary that
> determines when a syscall has passed the point of having successful
> side effects, which makes implementing the syscalls just as functions
> hard.

I'm not sure if I can hit this scenario but I'll research this. Thanks!


> Stepping back a bit, I suspect what you want is to just be able to
> implement functions like open(), read(), etc. on your own instead of
> implement something like actual syscalls, based on a notion that
> open(), read(), etc. "are the syscalls".

Not based on that notion, but thinking that the number of functions
issuing syscalls would be reduced, and substituting such functions
would be less work than translating syscalls. But the approach you
suggested above is better.


> [...]
> As long as you do it the way that acknowledges the above, the "heavy
> editing" is isolated to the arch directories you add.

That's really what I want!


> [...]
> There are indeed a small number of places where workarounds or other
> considerations for Linux-specific parts of the syscall interface
> boundary are in general source files rather than in the syscall glue
> layer, but I think the number is quite small. If there are
> particularly egregious ones that you think could be improved upon,
> please let me know.

Yes, I believe that whenever there are assembly source files in some
directory in the musl tree, there're functions there that make
syscalls without going through the interface you defined above. I'll
look at this and I'll see if it can be improved somehow.

Thanks a lot!

ardi


  reply	other threads:[~2017-12-22 19:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21 16:25 ardi
2017-12-21 21:38 ` Rich Felker
2017-12-22 16:09   ` ardi
2017-12-22 16:43     ` Rich Felker
2017-12-22 19:04       ` ardi [this message]
2017-12-23  8:18         ` Markus Wichmann
2017-12-23 20:57           ` ardi
2017-12-22 17:10     ` Nicholas Wilson
2017-12-22 17:49       ` Rich Felker
2017-12-22 18:01         ` Nicholas Wilson
2017-12-22 18:08           ` Rich Felker
2017-12-22 19:06             ` Nicholas Wilson
2017-12-22 19:27       ` ardi

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=CA+fZqCX14DyRp+ivD-r40yyV9c4mbLEidt0+UYiO1QHY_e6GTw@mail.gmail.com \
    --to=ardillasdelmonte@gmail.com \
    --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).