Resurrecting clang external toolchain support in Makefile.inc

Baptiste Daroussin bapt at FreeBSD.org
Wed Feb 11 08:45:39 UTC 2015


On Tue, Feb 10, 2015 at 07:50:59PM -0700, Warner Losh wrote:
> 
> > On Feb 10, 2015, at 7:32 PM, Peter Grehan <grehan at FreeBSD.org> wrote:
> > 
> > Hi toolchain folk,
> > 
> > I've recently tried using the base system clang as an external toolchain i.e.
> > 
> >   make CROSS_COMPILER_PREFIX=/usr/bin/ buildworld
> > 
> > .. and found that this no longer works after r273755 which split XFLAGS into XC/XCXXFLAGS. This appears to be because the XFLAGS definitions that define --sysroot and -B options aren't being passed through to clang, resulting in using header files from the host system.
> > 
> > My quick hack was
> > 
> > --- Makefile.inc1	(revision 278542)
> > +++ Makefile.inc1	(working copy)
> > @@ -374,6 +374,8 @@
> > TARGET_ABI?=	unknown
> > TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
> > XCFLAGS+=	-target ${TARGET_TRIPLE}
> > +XCFLAGS+=	${XFLAGS}
> > +XCXXFLAGS+=	${XFLAGS}
> > .endif
> > .endif
> > 
> > However, this doesn't look to be the right way to fix this.
> > 
> > Any opinions on a proper fix ?
> 
> I have a similar “fix” in my tree as well, but hadn’t pushed it because I wasn’t quite sure the right way either.
> 
> Warner

In my opinion we should track down the last traces of XFLAGS and turn them into
proper XCFLAGS and XCXXFLAGS, the intent was to get rid of XFLAGS because the
name was confusing.

so instead of adding XFLAGS to XC*FLAGS, the XFLAGS should juste be converted
into XC*FLAGS directly in my opinion.

Best regards,
Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20150211/e1553697/attachment.sig>


More information about the freebsd-toolchain mailing list