mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Nicholas Wilson <nicholas.wilson@realvnc.com>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: Re: [PATCH] Wasm support patch 2 (static syscalls)
Date: Tue, 28 Nov 2017 14:34:41 +0000	[thread overview]
Message-ID: <VI1PR0502MB38858056FA93260D12D25A99E73A0@VI1PR0502MB3885.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <20171128140531.GM15263@port70.net>

That's some sophisticated link-time optimisation you're expecting there! DCE on a single source file wouldn't do it.

When you have callers like __setxid, it's not until the final link that that kind of elimination could be run; just by examining setxid.c there's no way the compiler could eliminate anything. And, it would rely on several stages of inlining taking place, which you really can't guarantee. (Not to mention that the Clang LLD linker doesn't do LTO.) The traditional unix linking model isn't really geared up for this level of link-time inlining and optimising.

The current Emscripten fork of Musl implements the "static syscalls" a little differently. They have retained the numeric constants for the syscalls, but the calls are redirected to functions with names like "__syscall_42" instead of "__syscall_getpid". At the end of the day, there isn't a big difference between my approach here and the current Emscripten one - I've just reduced the amount of Musl code that needs to be touched to support the static syscalls, and I can't see how to reduce the changes further...

Nick

________________________________________
From: Szabolcs Nagy <nsz@port70.net>
Sent: 28 November 2017 14:05:31
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] Wasm support patch 2 (static syscalls)

* Nicholas Wilson <nicholas.wilson@realvnc.com> [2017-11-28 13:23:15 +0000]:
> With a jump table like that, you can't get static linkage. The compiler will link in *every* syscall.

use a better compiler with dce then.


  reply	other threads:[~2017-11-28 14:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28 12:31 Nicholas Wilson
2017-11-28 12:59 ` Szabolcs Nagy
2017-11-28 13:23   ` Nicholas Wilson
2017-11-28 14:05     ` Szabolcs Nagy
2017-11-28 14:34       ` Nicholas Wilson [this message]
2017-11-28 14:35         ` Szabolcs Nagy
2017-11-28 14:53           ` Nicholas Wilson
2017-11-28 15:08             ` Szabolcs Nagy
2017-11-28 15:50               ` Rich Felker
2017-11-28 16:20                 ` Nicholas Wilson
2017-11-28 16:51         ` John Starks
2017-11-28 17:52           ` Szabolcs Nagy
2017-11-28 18:55             ` Rich Felker
2017-11-28 17:53           ` Nicholas Wilson

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=VI1PR0502MB38858056FA93260D12D25A99E73A0@VI1PR0502MB3885.eurprd05.prod.outlook.com \
    --to=nicholas.wilson@realvnc.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).