Date: Fri, 5 Mar 2010 09:12:09 +0000 (GMT) From: Robert Watson <rwatson@FreeBSD.org> To: Xin LI <delphij@gmail.com> Cc: freebsd-current@freebsd.org, "M. Warner Losh" <imp@bsdimp.com>, ddkprog@yahoo.com Subject: Re: propose: all arch move into a separate dir Message-ID: <alpine.BSF.2.00.1003050906410.5181@fledge.watson.org> In-Reply-To: <a78074951003041036i728a3ce8v8b8fc213a808cf94@mail.gmail.com> References: <401095.35021.qm@web59107.mail.re1.yahoo.com> <20100304.102007.1151864885495261672.imp@bsdimp.com> <a78074951003041036i728a3ce8v8b8fc213a808cf94@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 4 Mar 2010, Xin LI wrote: > One good thing (in my opinion) that NetBSD and Darwin have is that they have > a "common" tree which holds the common files that shared between kernel and > userland libc. Currently we have 2 or more copies of certain files in the > tree but I'm not sure if it's a good idea to migrate them together into a > src/common tree, or just modify the Makefile to reference the one copy? > Eliminating duplicated files makes it easier for changes to propagate into > different areas (like, we have optimization apply against all components, or > have bug fixed in one time). Is this really widely a problem, or just a problem in a few specific cases? libc and other code depends on countless kernel files to get API definitions, system call lists, etc, without duplicating kernel code. Similarly, userland libraries sharing significant kernel code, such as libsbuf, will directly reference the kernel file, and in ipfilter, code is shared between the kernel and userspace directly as part of the test suite. The only real exceptions to this rule are libkern, which contains a very constrained part of libc, and the audit code, where the code structure is very similar but there are lots of small differences due to differing semantics for memory allocation in the kernel (M_WAITOK can't fail), so we maintain that copy/merge with the help of Perforce. Robert N M Watson Computer Laboratory University of Cambridge
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1003050906410.5181>