From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12164 Path: news.gmane.org!.POSTED!not-for-mail From: Nicholas Wilson Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Wasm support patch 2 (static syscalls) Date: Tue, 28 Nov 2017 14:53:58 +0000 Message-ID: References: <20171128125948.GK15263@port70.net> <20171128140531.GM15263@port70.net> ,<20171128143549.GN15263@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1511880857 20745 195.159.176.226 (28 Nov 2017 14:54:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Nov 2017 14:54:17 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-12180-gllmg-musl=m.gmane.org@lists.openwall.com Tue Nov 28 15:54:12 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1eJhGx-0004rq-46 for gllmg-musl@m.gmane.org; Tue, 28 Nov 2017 15:54:07 +0100 Original-Received: (qmail 28264 invoked by uid 550); 28 Nov 2017 14:54:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 28246 invoked from network); 28 Nov 2017 14:54:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realvnc.onmicrosoft.com; s=selector1-realvnc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/o2LJqdwmiCpBRuOb9gvGWuEJoe4GuE4jmvJORgtaxo=; b=Ax1MKvMrU8F9lTcRZ7XRaLA9o5riyxEqu8DUx83EtRzQwci37y5bF8P5LLl4YS31VEbiasgBTID3T4ckVIpiByqZg6aPtDPVEeBVoUbx8+SZ6+pa+jThlMxu3t+dux4nwLvdJ6Pa3EYkI3qAiJcI24OTmmQxnq8Vmu/AG/vu+fo= Thread-Topic: [musl] [PATCH] Wasm support patch 2 (static syscalls) Thread-Index: AQHTaEFVgDgYeA7kVEKWz4n1+gEDaKMpwQcAgAACxiWAAA+XgIAABULSgAADNgCAAAJksA== In-Reply-To: <20171128143549.GN15263@port70.net> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=nicholas.wilson@realvnc.com; x-originating-ip: [2a02:390:a001:192:d6be:d9ff:fe9c:1892] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0502MB3887;6:9eMfsjZ8MZhhoqJrd8ocva7K3HRHCkF4z53CA6WsPoJLnnt1KvD0DrnWOLwHdExursVgpPgzexffz8ers9vObvb/4bDvaaCXJeCvWflMOx340bsPBLxaUnVk5nYNfUJwZ+UfioYCA5ecr4vdCtoAKbs2riBNqyzqVssm2VWkT+/lcvLnQqHa9AiJTzcDyZE5+fOFqnouFUzif7PSQrH6vPvvsqzr4afUZjLHGpOKEVJzZI8wV/OvcyJOxYIV6ScaKCnA7RRaHo4E+Th42bDx4jkGdTG7I6zVSfEOWfBMSKlxhWx/zjhP+I/fOjbjP1ql6QZ3n6cxFkrH6sA3Wt7bvDyD9OWJ/wwXpCEJvUzI4/c=;5:qWOcWznK8loeHC+9L9sD2qUT42x60MhjC9OIngjX9AzNduVQInaYxVyxOD791C6pKtp96wFuhId+TvrDpy32mcfbvf0Jms4djpQRHYhIkcmdCidXb7eKpAkRLyc7uWukYphxxI57/zSZ5q2LReZxjiv7CLWW1TwIz4MX9F/gcYc=;24:MuW2f5muTZ/Hzn4NjW4h+DkbS8m2tiyjsBcGiF1v1bofP6ObFqKEBSgZaVncg9n0x0D5zlbArkKnIPcfp7uA+5vCSDajsoGGkhC1hpBKd3Y=;7:A3gz2ZvAgNJU0g0Sjv0SDyhiiFq8Q7VBcCGBniRDAxUGoR89kAjs2sGx0/tZiGLHrA3wSTqAdHpAXnrNNGzcTaXxfLVG 5vNUQ57yzWHo1Jvd27jVPrOL74mucZur2DtKF6uyKgm2qk+KO8gz1tigomJd4iJu6OnzW+hKrDRM8YRit1DGCLfl6k9gGtNgkr x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 1f1344a6-530a-4ef9-6864-08d5366fdaf2 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4603075)(4627115)(201702281549075)(5600026)(4604075)(2017052603199);SRVR:VI1PR0502MB3887; x-ms-traffictypediagnostic: VI1PR0502MB3887: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231022)(6041248)(20161123562025)(20161123555025)(2016111802025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(6043046)(201708071742011);SRVR:VI1PR0502MB3887;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:VI1PR0502MB3887; x-forefront-prvs: 0505147DDB x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(366004)(346002)(376002)(199003)(189002)(377424004)(6116002)(5640700003)(2501003)(25786009)(2900100001)(86362001)(105586002)(8936002)(106356001)(2351001)(5660300001)(6436002)(4001150100001)(55016002)(97736004)(53546010)(7696005)(2950100002)(6916009)(316002)(7736002)(102836003)(2906002)(5250100002)(76176999)(54356999)(14454004)(50986999)(8676002)(3280700002)(229853002)(3660700001)(81156014)(305945005)(1730700003)(81166006)(33656002)(93886005)(6506006)(68736007)(189998001)(9686003)(74316002)(53936002)(99286004)(6246003)(101416001)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0502MB3887;H:VI1PR0502MB3885.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: realvnc.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM X-MS-Exchange-CrossTenant-Network-Message-Id: 1f1344a6-530a-4ef9-6864-08d5366fdaf2 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2017 14:53:58.4132 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9ad766d3-c6a5-4458-8c58-244e7c118728 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0502MB3887 X-OriginatorOrg: realvnc.com Xref: news.gmane.org gmane.linux.lib.musl.general:12164 Archived-At: I think LTO would be required - but I might be missing something in your sc= heme? I'm considering the cases like __setxid and pthread_cancel, where the= compiler can't work out which syscall numbers are possible (because the nu= mbers come from another translation unit). In these cases, there's no way t= o eliminate any of the branches in your switch statement. In particular, getuid() is such a common library call that I think we do wa= nt to be able to support it on Wasm, without having Musl link in everything= . I mean, it's not an obscure piece of functionality, so it's worth a small= refactor to make it usable with Wasm. It would be a bit awkward but acceptable I suppose to not support Wasm at -= O0 (ie link in hundreds of syscalls when the optimiser is off). Nick ________________________________________ From: Szabolcs Nagy Sent: 28 November 2017 14:35:50 To: musl@lists.openwall.com Subject: Re: [musl] [PATCH] Wasm support patch 2 (static syscalls) * Nicholas Wilson [2017-11-28 14:34:41 +0000]= : > That's some sophisticated link-time optimisation you're expecting there! = DCE on a single source file wouldn't do it. it's a static inline function, no lto involved.