From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12161 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:34:41 +0000 Message-ID: References: <20171128125948.GK15263@port70.net> ,<20171128140531.GM15263@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 1511879703 29047 195.159.176.226 (28 Nov 2017 14:35:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Nov 2017 14:35:03 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-12177-gllmg-musl=m.gmane.org@lists.openwall.com Tue Nov 28 15:34:51 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 1eJgyI-0006pw-Nh for gllmg-musl@m.gmane.org; Tue, 28 Nov 2017 15:34:50 +0100 Original-Received: (qmail 11835 invoked by uid 550); 28 Nov 2017 14:34:55 -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 11808 invoked from network); 28 Nov 2017 14:34:55 -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=6bc0YRqcpJOLA/JE9nJjPRD22TXZ1VtUxFmUlquxLv8=; b=Rq+FBbj9QnsPG8fxjlJ3m96FBbJkJd7PMm8tN1r6Nxz7325fprXlFwKvx31JaSfh4zrkVRQcofjCIvJ6+lpB4qmxkC2cfYVWhDBYtApN+DTAP4PrQKM9t2VUV2BaoRh0DanfGJYEWjD3xrEGVy/LKzde6yXJTqtQa6do5+IW5IQ= Thread-Topic: [musl] [PATCH] Wasm support patch 2 (static syscalls) Thread-Index: AQHTaEFVgDgYeA7kVEKWz4n1+gEDaKMpwQcAgAACxiWAAA+XgIAABULS In-Reply-To: <20171128140531.GM15263@port70.net> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2a02:390:a001:192:d6be:d9ff:fe9c:1892] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0502MB3886;6:dLRpivBy/HUVZGne3zA9vQOau3x1Ea5H+jveewoWDRL00uk6qj3dBgCoKq+ft28XXPRXeBmYV7R8EvQwBa5oHPsJKDfEClYA02Plxb3WTURMGEae8lF3Ssfmiz0rFdzbvypc2uFY9UBxoE76xbGS9Tzr5V2dOY/82tPV6pbFAmg3zN+WbuFQMatR78UFtnkn7rg4foikmc6X7ulWVhKld7xCfwCQ/s7ip8Q+ZwVDKggSzP2cWZyah3E2N9hFNLwU5joobLYF718bE2CGYvOh54ZVlyFt970SH1FCIROnn+4iTuHEys11u+XpXqkiX38MLAJ8fKcIIv3dE8ml0YDJhWDl0M9mP10FNrIABLViINI=;5:Mqc5KyoIMhVE3eZIyfulGMSTqXQFqr6SNbo+GAe//eUmLQknocpD4wZhE0cjHjRAK/m5MApHAxsiyk8r3FL/sGtN+fj0vUWLfCWsHV93EOGAppK+QAfN/tMmCZzzzgD+nc65p0GLKQCJL63g+yPgcqv7aocCmFMc9gZ+5jl4NUE=;24:KHIsUwYMB7OFPf5cQUaa/1zse8Nzf2Tqz/pfRwbeBBee5bQwgDr9v8YeTcGFMkjaQDmYo3JiPr/pj1FYDVbAjVRYwAeJEy4dj3IDJOHEV2o=;7:4gZZtphKqLkVLXNJMIKbA7NM4exbkTqSOUXv9XuhcGPvzlwwtqfc90RogH2hq52sOtqo1zzJ1PpylLQiEQKnP26fyB0W LJN7KfGVsfxmjInBWhuLuPob1iMUSMUAHyYByNWxv1Pcr0vIgrsACQW24NuWuj+53xvNdHZvWEfw5IuJtmTkohh+FF5vEM1NuO x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: cdf44fc4-95fd-4389-4d6f-08d5366d29a3 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4603075)(4627115)(201702281549075)(5600026)(4604075)(2017052603258);SRVR:VI1PR0502MB3886; x-ms-traffictypediagnostic: VI1PR0502MB3886: authentication-results: spf=none (sender IP is ) smtp.mailfrom=nicholas.wilson@realvnc.com; 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)(10201501046)(93006095)(93001095)(3231022)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(2016111802025)(20161123564025)(6072148)(6043046)(201708071742011);SRVR:VI1PR0502MB3886;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:VI1PR0502MB3886; x-forefront-prvs: 0505147DDB x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(366004)(346002)(376002)(377424004)(189002)(199003)(3660700001)(68736007)(53936002)(99286004)(5660300001)(50986999)(93886005)(3280700002)(54356999)(14454004)(76176999)(81156014)(105586002)(5640700003)(5250100002)(6916009)(81166006)(1730700003)(2900100001)(2351001)(9686003)(2950100002)(2501003)(53546010)(4001150100001)(97736004)(305945005)(106356001)(6246003)(33656002)(7736002)(86362001)(8936002)(102836003)(6116002)(8676002)(74316002)(189998001)(7696005)(2906002)(25786009)(55016002)(316002)(6436002)(6506006)(229853002)(101416001)(478600001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0502MB3886;H:VI1PR0502MB3885.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A: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: cdf44fc4-95fd-4389-4d6f-08d5366d29a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2017 14:34:41.9446 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9ad766d3-c6a5-4458-8c58-244e7c118728 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0502MB3886 X-OriginatorOrg: realvnc.com Xref: news.gmane.org gmane.linux.lib.musl.general:12161 Archived-At: That's some sophisticated link-time optimisation you're expecting there! DC= E on a single source file wouldn't do it. When you have callers like __setxid, it's not until the final link that tha= t kind of elimination could be run; just by examining setxid.c there's no w= ay the compiler could eliminate anything. And, it would rely on several sta= ges of inlining taking place, which you really can't guarantee. (Not to men= tion that the Clang LLD linker doesn't do LTO.) The traditional unix linkin= g model isn't really geared up for this level of link-time inlining and opt= imising. The current Emscripten fork of Musl implements the "static syscalls" a litt= le differently. They have retained the numeric constants for the syscalls, = but the calls are redirected to functions with names like "__syscall_42" in= stead of "__syscall_getpid". At the end of the day, there isn't a big diffe= rence between my approach here and the current Emscripten one - I've just r= educed the amount of Musl code that needs to be touched to support the stat= ic syscalls, and I can't see how to reduce the changes further... Nick ________________________________________ From: Szabolcs Nagy Sent: 28 November 2017 14:05:31 To: musl@lists.openwall.com Subject: Re: [musl] [PATCH] Wasm support patch 2 (static syscalls) * Nicholas Wilson [2017-11-28 13:23:15 +0000]= : > With a jump table like that, you can't get static linkage. The compiler w= ill link in *every* syscall. use a better compiler with dce then.