[RFC] external compiler support

Brooks Davis brooks at freebsd.org
Thu Feb 28 17:19:54 UTC 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20130228/bc3b3f50/attachment.sig>


More information about the freebsd-arch mailing list