From nobody Sat Feb 03 16:05:10 2024 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRyCr0X48z59djt for ; Sat, 3 Feb 2024 16:05:28 +0000 (UTC) (envelope-from eischen@vigrid.com) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRyCq5wMMz4Nh5; Sat, 3 Feb 2024 16:05:27 +0000 (UTC) (envelope-from eischen@vigrid.com) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (ip-414b102e.ct.fixed.ntplx.com [65.75.16.46]) (authenticated bits=0) by mail.netplex.net (8.16.1/8.15.1/NETPLEX) with ESMTPSA id 413FdWSq055759 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 3 Feb 2024 10:39:32 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Sat, 03 Feb 2024 10:39:33 -0500 (EST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Daniel Eischen List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: libc/libsys split coming soon Date: Sat, 3 Feb 2024 11:05:10 -0500 Message-Id: <082DBB76-B8B0-4583-BDE4-B6DCD1DAD133@vigrid.com> References: <458c2a3b-1139-4449-a4a9-f23782686dea@app.fastmail.com> Cc: current@freebsd.org, Dave Cottlehuber In-Reply-To: <458c2a3b-1139-4449-a4a9-f23782686dea@app.fastmail.com> To: Brooks Davis X-Mailer: iPhone Mail (21D50) X-Rspamd-Queue-Id: 4TRyCq5wMMz4Nh5 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6062, ipnet:204.213.176.0/20, country:US] Will this break binary compatibility with older programs expecting those sym= bols in libc and not linked to libsys? > On Feb 3, 2024, at 3:39=E2=80=AFAM, Dave Cottlehuber w= rote: >=20 > =EF=BB=BFOn Fri, 2 Feb 2024, at 23:31, Brooks Davis wrote: >> TL;DR: The implementation of system calls is moving to a seperate >> library (libsys). No changes are required to existing software (except >> to ensure that libsys is present when building custom disk images). >>=20 >> Code: https://github.com/freebsd/freebsd-src/pull/908 >>=20 >> After nearly a decade of intermittent work, I'm about to land a series >> of patches which moves system calls, vdso support, and libc's parsing of >> the ELF auxiliary argument vector into a separate library (libsys). I >> plan to do this early next week (February 5th). >>=20 >> This change serves three primary purposes: >> 1. It's easier to completely replace system call implementations for >> tracing or compartmentalization purposes. >> 2. It simplifies the implementation of restrictions on system calls such= >> as those implemented by OpenBSD's msyscall(2) >> (https://man.openbsd.org/msyscall.2). >> 3. It allows language runtimes to link with libsys for system call >> implementations without requiring libc. >=20 > Awesome! So (3) is generally considered ideal for languages like zig[1], r= ust or go, to use directly? >=20 > What=E2=80=99s the appropriate mechanism for such a language to know which= version of FreeBSD it=E2=80=99s talking to, to ensure syscall table matches= the languages expectations? >=20 > It would be nice to hear about any experiments in (2) and how that compare= s to things such as capsicum. >=20 > [1]: https://github.com/ziglang/zig/issues/165 >=20 > A+ > Dave >=20 >=20