Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 2015 18:32:26 -0800
From:      Peter Grehan <grehan@freebsd.org>
To:        freebsd-toolchain@freebsd.org
Subject:   Resurrecting clang external toolchain support in Makefile.inc
Message-ID:  <54DABF3A.8060003@freebsd.org>

next in thread | raw e-mail | index | archive | help
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 ?

later,

Peter.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54DABF3A.8060003>