From owner-freebsd-arch@FreeBSD.ORG Thu Feb 28 17:19:54 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CCBE6648 for ; Thu, 28 Feb 2013 17:19:54 +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 768EE344 for ; Thu, 28 Feb 2013 17:19:53 +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 r1SHJm3b033095; Thu, 28 Feb 2013 11:19:48 -0600 (CST) (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 r1SHJlOL033094; Thu, 28 Feb 2013 11:19:47 -0600 (CST) (envelope-from brooks) Date: Thu, 28 Feb 2013 11:19:47 -0600 From: Brooks Davis To: "Simon J. Gerraty" Subject: Re: [RFC] external compiler support Message-ID: <20130228171947.GA20864@lor.one-eyed-alien.net> References: <20130227003517.GB7348@lor.one-eyed-alien.net> <28404C12-67F3-44F0-AB28-02B749472873@bsdimp.com> <51BB3E17-128A-4989-B272-D8B40D4B854B@bsdimp.com> <20130227175006.A604A58096@chaos.jnpr.net> <20130227195807.GA19255@lor.one-eyed-alien.net> <20130227202822.8F53B58096@chaos.jnpr.net> <20130227220520.GB19594@lor.one-eyed-alien.net> <20130227232632.74C2F58096@chaos.jnpr.net> <20130227235952.GE19594@lor.one-eyed-alien.net> <20130228013915.DF81E58096@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <20130228013915.DF81E58096@chaos.jnpr.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 17:19:54 -0000 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 27, 2013 at 05:39:15PM -0800, Simon J. Gerraty wrote: >=20 > On Wed, 27 Feb 2013 17:59:52 -0600, Brooks Davis writes: > >> CFLAGS_LAST.clang +=3D3D -isystem ${STAGE_OBJTOP}/usr/include/clang/3.2 > >> CXXFLAGS_LAST +=3D3D ${CFLAGS_LAST.${COMPILER_TYPE}} > > > >Hmm, I've not had to do that, but it seems likely that similar things > >could be required. >=20 > I was even more suprised to find that clang needed=20 >=20 > -isystem ${STAGE_OBJTOP}/usr/include/c++/${GCCVER:U4.2} >=20 > .meta files are great for finding out what the compiler is really doing ;= -) I'm curious, is there a way to log failed fail accesses in metamode? I know clang does a fair bit of probing for things like binutils bits and I believe it does the same with headers. This could lead to some interesting surprises. > Of course all these -isystem's are needed because I use -nostdinc to > avoid accidentally pulling headers from /usr/include. > With sysroot support that wouldn't be necessary. Ah, I see. The only thing I know of that currently stops the base system compiler from being used with --sysroot is that ld doesn't support it unless it's compiled with a sysroot. This seems inane to me. I've been tempted for a while to compile it with a default sysroot of "/" to enable sysroot support. > >I think remember the issue now. The problem was that I was setting a > >variable (SYSROOT) that would cause additions to CFLAGS. Because the > >crunch environment is set by crunchgen I wasn't able to figure out a good >=20 > looks like crunchgen uses 'env MAKEOBJDIRPREFIX=3D$(MAKEOBJDIRPREFIX) $(M= AKE)' > not env -i, so if you export SYSROOT it should be seen. >=20 > >An example of a problem boot related Makefile is > >sys/boot/i386/gptboot/Makefile. >=20 > Yep, and this is where CFLAGS_LAST comes in handy with=20 >=20 > CFLAGS+=3D ${CFLAGS_LAST} >=20 > in bsd.init.mk or bsd.sys.mk OK, that makes sense and should work. I think I'm inclined to go with my current approach for now and then migrate to what ever form of ${CFLAGS_LAST} and friends that we end up with after we've debated the issues there and decided how much abstraction we really want. -- Brooks --azLHFNyN32YCQGCU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRL5GzXY6L6fI4GtQRAsaBAJ0fPJDfhE/lXkp132e+qnhM2hAMXQCghEsE kGPaYBPAeE7ePcYk6ZeoRKQ= =n3YK -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU--