From owner-freebsd-arch@FreeBSD.ORG Wed May 2 16:13:47 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D543A106566B; Wed, 2 May 2012 16:13:47 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 918EC8FC0C; Wed, 2 May 2012 16:13:47 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 144396D09; Wed, 2 May 2012 16:13:46 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id C302F8AF1; Wed, 2 May 2012 18:13:45 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Baptiste Daroussin 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> Date: Wed, 02 May 2012 18:13:45 +0200 In-Reply-To: <20120502145045.GP31034@azathoth.lan> (Baptiste Daroussin's message of "Wed, 2 May 2012 16:50:46 +0200") Message-ID: <86txzyh87a.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Konstantin Belousov , 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:13:47 -0000 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 use > > 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 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. To hide the cdb code inside libc, you need to add #define cdb_foo _cdb_foo to src/lib/libc/include/namespace.h and #undef cdb_foo 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. 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. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no