Date: Wed, 2 May 2012 19:24:21 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Dag-Erling Sm??rgrav <des@des.no> Cc: Baptiste Daroussin <bapt@freebsd.org>, freebsd-arch@freebsd.org Subject: Re: Switching /etc/*.db from bdb to tinycdb Message-ID: <20120502162421.GB2358@deviant.kiev.zoral.com.ua> In-Reply-To: <86txzyh87a.fsf@ds4.des.no> References: <20120502114115.GG31034@azathoth.lan> <CA%2BhQ2%2Bgv%2BQ7SXbK-G5Lybjt4XOF_b3EvyxtQiOCL7pGxmgWRcg@mail.gmail.com> <20120502123149.GI31034@azathoth.lan> <20120502140235.GA91732@onelab2.iet.unipi.it> <20120502134546.GM31034@azathoth.lan> <20120502144706.GZ2358@deviant.kiev.zoral.com.ua> <20120502145045.GP31034@azathoth.lan> <86txzyh87a.fsf@ds4.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
--/Gw7yEOBEhjvPbkH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 02, 2012 at 06:13:45PM +0200, Dag-Erling Sm??rgrav wrote: > Baptiste Daroussin <bapt@freebsd.org> writes: > > Konstantin Belousov <kostikbel@gmail.com> writes: > > > The reasoning is that we do not want our libc unneccessary interpose > > > symbols from third-party libs, and do not want to make a surprise for > > > somebody who wants to use the never version of the same library, or u= se > > > a symbol not documented in SUSv4 etc while linking to libc/libpthread > > > only. > > I do understand that, I know need to learn how we can do that cleaning >=20 > If we go that route, I would suggest having the complete library as > libcdb, and a copy of the read part hidden inside libc for getpw*() etc. >=20 > To hide the cdb code inside libc, you need to add >=20 > #define cdb_foo _cdb_foo >=20 > to src/lib/libc/include/namespace.h and >=20 > #undef cdb_foo >=20 > to src/lib/libc/include/un-namespace.h, for appropriate values of "foo" > ("init", "find" etc.), then wrap the #include directives in the cdb > source with #include <namespace.h> /* ... */ #include <un-namespace.h>. > Within libc, you must call _cdb_foo() instead of cdb_foo(); outside of > libc, you call cdb_foo() as usual, and link with -lcdb. >=20 > To avoid duplicating the cdb source code, you will need to create > src/lib/libcdb/{un-,}namespace.h as empty files and add -I${SRCDIR} to > CFLAGS in src/lib/libcdb/Makefile. The _[a-z] symbols are in application namespace, so the typical namespace.h gymnastic is somewhat doubtful. It is indeed needed for the exported symbols, to allow both interposing and libc usage of the right symbol internally. I do not think we need this at all for cdb, which symbols we should not export from libc. Just do not expose symbols, i.e. do not mention them in the version script for libc, is enough. The static linking is the lost case anyway. --/Gw7yEOBEhjvPbkH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk+hX7UACgkQC3+MBN1Mb4jIhACgkKYNxxWxFRNdcUmOgJccYImX +noAniTnCzcquvrR9eAABoTzD5zHrQwR =gFHk -----END PGP SIGNATURE----- --/Gw7yEOBEhjvPbkH--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120502162421.GB2358>