Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Apr 2018 22:39:44 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Brooks Davis <brooks@one-eyed-alien.net>
Cc:        freebsd-toolchain@freebsd.org, Ali Mashtizadeh <ali@mashtizadeh.com>
Subject:   Re: splitting libc -> libc + libsys and static linking
Message-ID:  <DCA75254-34A6-4391-9E26-780722484BF0@FreeBSD.org>
In-Reply-To: <20180403203210.GA23045@spindle.one-eyed-alien.net>
References:  <20180403203210.GA23045@spindle.one-eyed-alien.net>

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

[-- Attachment #1 --]
On 3 Apr 2018, at 22:32, Brooks Davis <brooks@one-eyed-alien.net> 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?

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=321369&view=markup#l61

and:
https://svnweb.freebsd.org/base/head/gnu/lib/libstdc%2B%2B/Makefile?revision=315175&view=markup#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


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.2

iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWsPmkAAKCRCwXqMKLiCW
ow+qAJ9PzuLj6du9JiO8vr4H0JUh2H4u5QCg36UrkMnV/LiuaOQMGUL1mQotNFs=
=XCPQ
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DCA75254-34A6-4391-9E26-780722484BF0>