Re: another external compiler topic

From: <dt71_at_gmx.com>
Date: Thu, 06 Jun 2013 00:16:28 +0200
On 06/05/2013 23:20, Brooks Davis wrote:
> On Wed, Jun 05, 2013 at 10:46:01PM +0200, dt71_at_gmx.com wrote:
>> Now compiling with CC, CPP and CXX only in the environment (and XCC, XCPP and XCXX in make.conf).

Success!

> If you XCC, XCPP, and XCXX you may not need CC, CPP, and CXX at all,
> though your environment is weird enough I won't assert that.

There is no "cc" (/usr/bin/cc), so some form of CC is required.

>>>> Also, the following patch was applied to the source tree:
>>>> ======= diff begins =======
>>>> Index: Makefile.inc1
>>>> ===================================================================
>>>> --- Makefile.inc1	(revision 251352)
>>>> +++ Makefile.inc1	(working copy)
>>>> _at__at_ -722,7 +722,7 _at__at_
>>>>     ITOOLS=	[ awk cap_mkdb cat chflags chmod chown \
>>>>     	date echo egrep find grep id install ${_install-info} \
>>>>     	ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \
>>>> -	rm sed sh sysctl test true uname wc ${_zoneinfo}
>>>> +	rm sed sh sysctl test true uname wc ${_zoneinfo} btxld ls mv cp dd
>>>>
>>>>     #
>>>>     # distributeworld
>>>> Index: usr.bin/xlint/llib/Makefile
>>>> ===================================================================
>>>> --- usr.bin/xlint/llib/Makefile	(revision 251352)
>>>> +++ usr.bin/xlint/llib/Makefile	(working copy)
>>>> _at__at_ -9,9 +9,9 _at__at_
>>>>     CLEANFILES+= ${LIBS}
>>>>
>>>>     llib-lposix.ln: llib-lposix
>>>> -	${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC}
>>>> +	CC=${CC:Q} ${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC}
>>>>
>>>>     llib-lstdc.ln: llib-lstdc
>>>> -	${LINT} ${LINTFLAGS} -Cstdc ${.ALLSRC}
>>>> +	CC=${CC:Q} ${LINT} ${LINTFLAGS} -Cstdc ${.ALLSRC}
>>>>
>>>>     .include <bsd.prog.mk>
>>>> ======= diff ends =======
>>>
>>> What do these patches work around?
>>
>> The 1st hunk works around an installkernel issue: in some cases (unknown, but seemingly related to header updates), installkernel seems to involve some compiling, "cp"ing, "btxld"ing, etc..
>
> Hmm, that seems weird.  I've never seen that.

Actually, installworld, not installkernel.

>> Without the 2nd hunk, the lint program would call "cc", which does not exist (ie., there is no /usr/bin/cc, but there is a ${CC}).
>
> This sounds like a bug.

Well, now, with a CC environment variable, the hunk is no longer required for me. But then again, the lint program calls "cc" if there is no CC environment variable, such as when CC is set only in make.conf.


According to <https://wiki.freebsd.org/ExternalToolchain>:
> To use XCC, you must not set any of the variables that can be overridden by X* variables in /etc/make.conf or /etc/src.conf as Makefile.inc1 will be unable to change them.

Why? In my case, CC should always be /path/to/clang (however, CFLAGS should contain --sysroot=/usr/obj/<...>, when appropriate).
Received on Wed Jun 05 2013 - 20:16:44 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:38 UTC