Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Apr 2013 23:00:10 +0200
From:      deeptech71 <deeptech71@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: building world and kernel without ebuilding ("bootstrap"?) clang?
Message-ID:  <5164815A.6040908@gmail.com>

next in thread | raw e-mail | index | archive | help
Lev Serebryakov wrote:
> Is "system" version (system is snapshot from Mar 30) is "external" and "modern"?

No. The base version of Clang has been patched to work well with the base system, at least regarding the discussed issue of standard header files.



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!

Compiler headers are not the main problem. The base system is generally compilable with any compiler, modulo the main problem.

Source files in /usr/src should include (ie., #include <...>) headers from /usr/src/include, but in case of an external compiler, they don't, they actually include the headers from /usr/include (don't think about stdio.h, but rather about things like net80211/ieee80211_mesh.h)! The main problem occurs when library headers change (eg., an import of a newer version of /usr/src/contrib/somelib). It happens that the source files need a new definition (eg., #define IEEE80211_MESHRT_FLAGS_GATE 0x08), but such is not found in /usr/include, only in /usr/src/include. However, during ``make installworld'', headers get copied from /usr/src/include to /usr/include, so after that, /usr/include is equivalently usable. After that, compilation won't fail just due to this issue... until /usr/src is significantly updated again.

Again, this has nothing to do with compiler headers. If the latest (trunk) version of Clang/LLVM is used -- let's say it's in /home/me/llvm --, then stdio.h (etc.) needs to be removed from /home/me/llvm/include/... (at least I have no other solution), even if /usr/include and /usr/src/include are equivalent.

When Clang or GCC is built as part of "make buildworld", it is also built specially once: a bootstrapped compiler uses /usr/obj/tmp/usr/include (a copy of /usr/src/include) instead of /usr/include.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5164815A.6040908>