Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Apr 2018 21:16:10 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Shawn Webb <shawn.webb@hardenedbsd.org>
Cc:        Brooks Davis <brooks@one-eyed-alien.net>, freebsd-toolchain@freebsd.org, Ali Mashtizadeh <ali@mashtizadeh.com>
Subject:   Re: splitting libc -> libc + libsys and static linking
Message-ID:  <20180403211610.GB23045@spindle.one-eyed-alien.net>
In-Reply-To: <20180403204410.zfxziemnzeiejqlp@mutt-hbsd>
References:  <20180403203210.GA23045@spindle.one-eyed-alien.net> <20180403204410.zfxziemnzeiejqlp@mutt-hbsd>

next in thread | previous in thread | raw e-mail | index | archive | help

--xXmbgvnjoT4axfJE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 03, 2018 at 04:44:10PM -0400, Shawn Webb wrote:
> On Tue, Apr 03, 2018 at 08:32:10PM +0000, Brooks Davis wrote:
> > We (mostly Ali) are working on a patch to to split the actual syscalls
> > (__sys_<foo>) out of libc and into a libsys.  For dynamic linking,
> > this is fairly straightforward (link libc against libsys, maybe as a
> > filter).  For static linking, I'm looking for feedback on the right
> > approach.  Do we link libsys.a into libc.a?  Do we try to teach all the
> > compilers to add -lsys?  I'm pretty sure we don't modify all the ports
> > that statically link programs.  Is there some easy approach I'm missing?
>=20
> I'm curious about the reasoning behind this change. Could you explain
> in more detail why you'd like to create a libsys?

In CheriBSD I use something like this to let me use the same libc
inside and outside sandboxes while varying the syscall implementation.
Ali is (IIRC) using it in a record and playback framework.  It could
potentially let us link a libsys_pic.a into libthr.so and rtld to
eliminate the need for syscall(2).  It could also ease experimentation
with alternative syscall invocation methods (e.g. I've got a branch of
CheriBSD where the ability to make a given syscall is controlled by
possession of an unforgable token.)

Having a clear interface in a separate library makes it easier to know
what to replace and gives a clear place to do it.

-- Brooks

--xXmbgvnjoT4axfJE
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJaw+8aAAoJEKzQXbSebgfAGXcH/jhPtivSOGvx69L4cUadt0mb
61Yy0bJyp3Vyx7SJb2zBA5ZJ/XXR9l+mC9H2QrAu5fZuYW6e3pLGQzHf+J1e1bH5
hFH7AEPnp36/2rNvX9jzYFZONCpiRa180TfvRhVANMEpEclUlWGfIspmPiOVhWPy
Eymud4srw/+ryoWzl/bsdAcAIsTQqp7SooDulDMkNngn3OsGlOVMFV57s/lTiHnR
qN1HVuwG8AVXE0/zmIgpLd9XGCaFITaTFzGBBxeeCEttRvdWj0ZubcNyS1j30byx
2AK5i3RlYtBcT3wphZVsO1aK48A2jUFE1QTREfaRDTPZ3ibHu4e8gh6uCY2KlQo=
=d1qH
-----END PGP SIGNATURE-----

--xXmbgvnjoT4axfJE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180403211610.GB23045>