Resurrecting clang external toolchain support in Makefile.inc

Peter Grehan grehan at freebsd.org
Thu Feb 12 00:02:20 UTC 2015


Hi Bapt,

> 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.

  How about the appended ? It moves the sysroot definition into the 
non-GCC XC/XCXXFLAGS defs, and renames XFLAGS to BFLAGS. This should be 
identical to pre r273755 behaviour.

later,

Peter.

--- Makefile.inc1	(revision 278542)
+++ Makefile.inc1	(working copy)
@@ -348,16 +348,15 @@
  		SIZE="${XSIZE}"

  .if ${XCC:M/*}
-XFLAGS=		--sysroot=${WORLDTMP}
  .if defined(CROSS_BINUTILS_PREFIX)
  # In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
  # directory, but the compiler will look in the right place for it's
  # tools so we don't need to tell it where to look.
  .if exists(${CROSS_BINUTILS_PREFIX})
-XFLAGS+=	-B${CROSS_BINUTILS_PREFIX}
+BFLAGS+=	-B${CROSS_BINUTILS_PREFIX}
  .endif
  .else
-XFLAGS+=	-B${WORLDTMP}/usr/bin
+BFLAGS+=	-B${WORLDTMP}/usr/bin
  .endif
  .if ${TARGET} == "arm"
  .if ${TARGET_ARCH:M*hf*} != ""
@@ -374,6 +373,8 @@
  TARGET_ABI?=	unknown
  TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
  XCFLAGS+=	-target ${TARGET_TRIPLE}
+XCFLAGS+=	--sysroot=${WORLDTMP} ${BFLAGS}
+XCXXFLAGS+=	--sysroot=${WORLDTMP} ${BFLAGS}
  .endif
  .endif




More information about the freebsd-toolchain mailing list