From owner-freebsd-toolchain@freebsd.org Tue Apr 3 20:39:47 2018 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEB09F7E740 for ; Tue, 3 Apr 2018 20:39:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8AA31726C6 for ; Tue, 3 Apr 2018 20:39:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id BE4063FAAB; Tue, 3 Apr 2018 22:39:44 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_56106A58-63DD-4D38-BC75-13A0C1F29CFA"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: splitting libc -> libc + libsys and static linking Date: Tue, 3 Apr 2018 22:39:44 +0200 In-Reply-To: <20180403203210.GA23045@spindle.one-eyed-alien.net> Cc: freebsd-toolchain@freebsd.org, Ali Mashtizadeh To: Brooks Davis References: <20180403203210.GA23045@spindle.one-eyed-alien.net> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2018 20:39:47 -0000 --Apple-Mail=_56106A58-63DD-4D38-BC75-13A0C1F29CFA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 3 Apr 2018, at 22:32, Brooks Davis wrote: >=20 > We (mostly Ali) are working on a patch to to split the actual syscalls > (__sys_) 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? The approach chosen for e.g. libc++ (and before that, libstdc++), was to put all needed objects from the dependent libs in the same .a file. See: = https://svnweb.freebsd.org/base/head/lib/libc%2B%2B/Makefile?revision=3D32= 1369&view=3Dmarkup#l61 and: = https://svnweb.freebsd.org/base/head/gnu/lib/libstdc%2B%2B/Makefile?revisi= on=3D315175&view=3Dmarkup#l57 For dynamic linking, you could use your approach of putting libsys in the NEEDED section, or add it to the libc.so linker script, like what is done for libc++.so. -Dimitry --Apple-Mail=_56106A58-63DD-4D38-BC75-13A0C1F29CFA Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWsPmkAAKCRCwXqMKLiCW ow+qAJ9PzuLj6du9JiO8vr4H0JUh2H4u5QCg36UrkMnV/LiuaOQMGUL1mQotNFs= =XCPQ -----END PGP SIGNATURE----- --Apple-Mail=_56106A58-63DD-4D38-BC75-13A0C1F29CFA--