Date: Wed, 10 Apr 2013 18:09:35 +0400 From: Lev Serebryakov <lev@FreeBSD.org> To: deeptech71 <deeptech71@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: building world and kernel without ebuilding ("bootstrap"?) clang? Message-ID: <1952710103.20130410180935@serebryakov.spb.ru> In-Reply-To: <5164815A.6040908@gmail.com> References: <5164815A.6040908@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello, deeptech71. You wrote 10 =D0=B0=D0=BF=D1=80=D0=B5=D0=BB=D1=8F 2013 =D0=B3., 1:00:10: d> Lev Serebryakov wrote: >> Is "system" version (system is snapshot from Mar 30) is "external" and "= modern"? d> Lev Serebryakov wrote: >>It is very sad, that external compiler cannot be used with "fresh" >> sources (when headers are different). We need some solution for this, >> for sure! When compilers are identical (same clang revision), but >> sources has updated headers. It does proper trick with libraries, but >> not with headers! d> Compiler headers are not the main problem. The base system is d> generally compilable with any compiler, modulo the main problem. d> Source files in /usr/src should include (ie., #include <...>) d> headers from /usr/src/include, but in case of an external compiler, d> they don't, they actually include the headers from /usr/include d> (don't think about stdio.h, but rather about things like d> net80211/ieee80211_mesh.h)! The main problem occurs when library d> headers change (eg., an import of a newer version of d> /usr/src/contrib/somelib). It happens that the source files need a d> new definition (eg., #define IEEE80211_MESHRT_FLAGS_GATE 0x08), but d> such is not found in /usr/include, only in /usr/src/include. I speak exactly about this situation. d> However, during ``make installworld'', headers get copied from d> /usr/src/include to /usr/include, so after that, /usr/include is d> equivalently usable. After that, compilation won't fail just due to d> this issue... until /usr/src is significantly updated again. Yep. And it happens rather often for -CURRENT. d> When Clang or GCC is built as part of "make buildworld", it is d> also built specially once: a bootstrapped compiler uses d> /usr/obj/tmp/usr/include (a copy of /usr/src/include) instead of /usr/in= clude. I wonder, is it possible to add some options to base compiler to make it use /usr/obj/tmp/usr/include when it build world... Reduction of build time from 1:27 to just 0:27 is very impressive and useful. Also, it looks like clang is cross-compiler always, i.e base clang could build binaries for any supported platform, not only for platform which is the same as host one... It expands possibility of using base compiler to fast build experimental builds for embedded devices even more. --=20 // Black Lion AKA Lev Serebryakov <lev@FreeBSD.org>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1952710103.20130410180935>