On 3 Apr 2018, at 22:32, Brooks Davis <bro...@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
signature.asc
Description: Message signed with OpenPGP