Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2013 16:02:25 +0100
From:      deeptech71 <deeptech71@gmail.com>
To:        freebsd-current@freebsd.org
Subject:   CC in /etc/make.conf and headers in ${WORLDTMP}
Message-ID:  <512E2001.1040305@gmail.com>

next in thread | raw e-mail | index | archive | help
Recently, I've posted several build errors that only I seemed to run into. The errors were based on "incompatible/missing declarations". The bottom line of those is actually the following, as I gather:

I, without any compilers in /usr/bin, was trying to build the world and kernel by setting CC to basically /home/me/my_compilers/bin/clang.

As the handbook says, the FreeBSD build system uses the compiler in /usr/obj, ie., the one "just built for further purposes". As I can see, that compiler is specifically crafted to use the include files in ${WORLDTMP}, ie., in /usr/obj/usr/src/tmp/usr/include (not /usr/include), where "new" headers are placed in an early phase of the build process. This is required for when the source tree has been "significantly" changed since the last installworld -- the new code won't build with the headers in /usr/include. In such cases, of course compilation breaks when an unaware compiler (eg., /usr/bin/cc, /home/me/my_compilers/bin/clang, etc.) is used.

I was able to compile the world and kernel by changing CC from /home/me/my_compilers/bin/clang to /usr/obj/usr/src/tmp/usr/bin/cc upon the first compilation error, by which time the latter compiler was available.

However, after a successful build and install, and no following update of the source tree, an external compiler can be used, because by then, the new headers will have been installed in /usr/include.

So it appears that specifying an external compiler as CC in /etc/make.conf is not supposed to work in general. Life sux. Is there any intention to remedy this?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?512E2001.1040305>