From owner-freebsd-arch@FreeBSD.ORG Wed May 2 16:24:34 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3BB3106564A; Wed, 2 May 2012 16:24:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 0653D8FC14; Wed, 2 May 2012 16:24:33 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q42GOMqx059251; Wed, 2 May 2012 19:24:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q42GOL19062796; Wed, 2 May 2012 19:24:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q42GOLoJ062795; Wed, 2 May 2012 19:24:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 May 2012 19:24:21 +0300 From: Konstantin Belousov To: Dag-Erling Sm??rgrav Message-ID: <20120502162421.GB2358@deviant.kiev.zoral.com.ua> References: <20120502114115.GG31034@azathoth.lan> <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> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/Gw7yEOBEhjvPbkH" Content-Disposition: inline In-Reply-To: <86txzyh87a.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Baptiste Daroussin , freebsd-arch@freebsd.org Subject: Re: Switching /etc/*.db from bdb to tinycdb X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2012 16:24:34 -0000 --/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 writes: > > Konstantin Belousov 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 /* ... */ #include . > 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--