Date: Thu, 28 Feb 2013 11:19:47 -0600 From: Brooks Davis <brooks@freebsd.org> To: "Simon J. Gerraty" <sjg@juniper.net> Cc: freebsd-arch@freebsd.org Subject: Re: [RFC] external compiler support Message-ID: <20130228171947.GA20864@lor.one-eyed-alien.net> In-Reply-To: <20130228013915.DF81E58096@chaos.jnpr.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>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Wed, Feb 27, 2013 at 05:39:15PM -0800, Simon J. Gerraty wrote:
>
> On Wed, 27 Feb 2013 17:59:52 -0600, Brooks Davis writes:
> >> CFLAGS_LAST.clang +=3D -isystem ${STAGE_OBJTOP}/usr/include/clang/3.2
> >> CXXFLAGS_LAST +=3D ${CFLAGS_LAST.${COMPILER_TYPE}}
> >
> >Hmm, I've not had to do that, but it seems likely that similar things
> >could be required.
>
> I was even more suprised to find that clang needed
>
> -isystem ${STAGE_OBJTOP}/usr/include/c++/${GCCVER:U4.2}
>
> .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
>
> looks like crunchgen uses 'env MAKEOBJDIRPREFIX=$(MAKEOBJDIRPREFIX) $(MAKE)'
> not env -i, so if you export SYSROOT it should be seen.
>
> >An example of a problem boot related Makefile is
> >sys/boot/i386/gptboot/Makefile.
>
> Yep, and this is where CFLAGS_LAST comes in handy with
>
> CFLAGS+= ${CFLAGS_LAST}
>
> 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
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)
iD8DBQFRL5GzXY6L6fI4GtQRAsaBAJ0fPJDfhE/lXkp132e+qnhM2hAMXQCghEsE
kGPaYBPAeE7ePcYk6ZeoRKQ=
=n3YK
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130228171947.GA20864>
