From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9806 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: vfork on ARM Date: Thu, 31 Mar 2016 21:53:01 -0400 Message-ID: <20160401015301.GY21636@brightrain.aerifal.cx> References: <56FDC407.2030405@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1459475598 9636 80.91.229.3 (1 Apr 2016 01:53:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2016 01:53:18 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9819-gllmg-musl=m.gmane.org@lists.openwall.com Fri Apr 01 03:53:18 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aloH0-0003Xn-5H for gllmg-musl@m.gmane.org; Fri, 01 Apr 2016 03:53:18 +0200 Original-Received: (qmail 12057 invoked by uid 550); 1 Apr 2016 01:53:15 -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 12036 invoked from network); 1 Apr 2016 01:53:14 -0000 Content-Disposition: inline In-Reply-To: <56FDC407.2030405@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9806 Archived-At: On Fri, Apr 01, 2016 at 11:42:47AM +1100, Patrick Oppenlander wrote: > I'm looking at what would be involved in using musl on a nommu arm system. > > As far as I know SYS_vfork is available on ARM, but musl is > currently falling back to fork. > > Are there any plans to support vfork on ARM and other architectures? It's trivial to add vfork, but the usefulness is limited without other changes: 1. To my knowledge, all nommu ARM systems are thumb[2]-only, so supporting them as targets requires adapting all the asm files to support building as thumb. This is a task in progress and, as long as we only care about thumb2 (available on armv7-m, i.e. Corext-M3 and up, I think) it's almost done. 2. For pre-v7, there's no way to do atomics without kernel help, and no established kernel API for this as far as I know. For v7-m this is probably not a problem. 3. Running on nommu without shareable program text is not much fun; execve is really slow (memcpy of full program) and you need lots of memory. Some people at ST have implemented an FDPIC abi for ARM which solves this problem, but it's not upstream in the toolchain or kernel, and the relocation types it needs are not officially assigned. Getting it officially stabilized, supported, and forward-ported to modern tool versions is going to be a lot of work. Here are some slides on it: http://www.slideshare.net/linaroorg/sfo15406-arm-fdpic-toolset-kernel-libraries-for-cortexm-cortexr-mmuless-cores Without FDPIC, it's possible to build a toolchain that produces static-PIE executables that will work on nommu (with my recently committed kernel patch for running non-FDPIC PIE ELF files on nommu, and some additional work still needed to hook it up to work on ARM) but these cannot use a shared mapping of the program. If you or anyone else is up for helping with these tasks that would be great. Rich