From owner-freebsd-current@FreeBSD.ORG Wed Jun 5 22:50:23 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2053CE47 for ; Wed, 5 Jun 2013 22:50:23 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 7A102186D for ; Wed, 5 Jun 2013 22:50:20 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r55MoKBu021714; Wed, 5 Jun 2013 17:50:20 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r55MoKSW021713; Wed, 5 Jun 2013 17:50:20 -0500 (CDT) (envelope-from brooks) Date: Wed, 5 Jun 2013 17:50:19 -0500 From: Brooks Davis To: dt71@gmx.com Subject: Re: another external compiler topic Message-ID: <20130605225019.GB20976@lor.one-eyed-alien.net> References: <51AF891A.3080906@gmx.com> <20130605193122.GD18357@lor.one-eyed-alien.net> <51AFA389.40607@gmx.com> <20130605212026.GA20976@lor.one-eyed-alien.net> <51AFB8BC.4080100@gmx.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5I6of5zJg18YgZEa" Content-Disposition: inline In-Reply-To: <51AFB8BC.4080100@gmx.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jun 2013 22:50:23 -0000 --5I6of5zJg18YgZEa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 06, 2013 at 12:16:28AM +0200, dt71@gmx.com wrote: > On 06/05/2013 23:20, Brooks Davis wrote: > > On Wed, Jun 05, 2013 at 10:46:01PM +0200, dt71@gmx.com wrote: > >> Now compiling with CC, CPP and CXX only in the environment (and XCC, X= CPP and XCXX in make.conf). >=20 > Success! >=20 > > 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. >=20 > There is no "cc" (/usr/bin/cc), so some form of CC is required. Makes sense. > >>>> Also, the following patch was applied to the source tree: > >>>> =3D=3D=3D=3D=3D=3D=3D diff begins =3D=3D=3D=3D=3D=3D=3D > >>>> Index: Makefile.inc1 > >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>>> --- Makefile.inc1 (revision 251352) > >>>> +++ Makefile.inc1 (working copy) > >>>> @@ -722,7 +722,7 @@ > >>>> ITOOLS=3D [ 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 > >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > >>>> --- usr.bin/xlint/llib/Makefile (revision 251352) > >>>> +++ usr.bin/xlint/llib/Makefile (working copy) > >>>> @@ -9,9 +9,9 @@ > >>>> CLEANFILES+=3D ${LIBS} > >>>> > >>>> llib-lposix.ln: llib-lposix > >>>> - ${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC} > >>>> + CC=3D${CC:Q} ${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC} > >>>> > >>>> llib-lstdc.ln: llib-lstdc > >>>> - ${LINT} ${LINTFLAGS} -Cstdc ${.ALLSRC} > >>>> + CC=3D${CC:Q} ${LINT} ${LINTFLAGS} -Cstdc ${.ALLSRC} > >>>> > >>>> .include > >>>> =3D=3D=3D=3D=3D=3D=3D diff ends =3D=3D=3D=3D=3D=3D=3D > >>> > >>> What do these patches work around? > >> > >> The 1st hunk works around an installkernel issue: in some cases (unkno= wn, but seemingly related to header updates), installkernel seems to involv= e some compiling, "cp"ing, "btxld"ing, etc.. > > > > Hmm, that seems weird. I've never seen that. >=20 > Actually, installworld, not installkernel. That should never happen AFACT. > >> 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. >=20 > 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 envi= ronment variable, such as when CC is set only in make.conf. As I said, this sounds like a legitimate makefile bug. > According to : > > To use XCC, you must not set any of the variables that can be overridde= n by X* variables in /etc/make.conf or /etc/src.conf as Makefile.inc1 will = be unable to change them. >=20 > Why? In my case, CC should always be /path/to/clang (however, CFLAGS shou= ld contain --sysroot=3D/usr/obj/<...>, when appropriate). It only works in your case because of your wrapper script and the fact that you aren't cross compiling. The XCC code needs to be able to set CC to include --sysroot and -B and -target. Doing it via CFLAGS proved to be too complex with the current build infrastructure. -- Brooks --5I6of5zJg18YgZEa Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRr8CrXY6L6fI4GtQRAispAKDW7ePl2qrkHCFdzZzS5dYDvtxuWQCeO+iU gQuMKhQiUA/oGLI9rpgz/uU= =YOyA -----END PGP SIGNATURE----- --5I6of5zJg18YgZEa--