> On Mar 26, 2015, at 2:12 AM, Craig Rodrigues <rodr...@freebsd.org> wrote:
> 
> 
> 
> On Tue, Mar 24, 2015 at 8:39 PM, Warner Losh <i...@bsdimp.com> wrote:
> 
> 
> No. The in-tree gcc doesn’t grok —sysroot.
> 
> We assume that version gcc 4.2.1 is special and our in-tree compiler 
> elsewhere,
> so please add a check for that and just go ahead and duplicate those two 
> lines.
> 
> Eg
> 
> +.else if ${COMPILER_VERSION} > 40201
> +XCFLAGS+=      --sysroot=${WORLDTMP} ${BFLAGS}
> +XCXXFLAGS+=    --sysroot=${WORLDTMP} ${BFLAGS}
> .endif
> 
> 
> The following worked for me.  Is it OK to commit?
> 
> Index: Makefile.inc1
> ===================================================================
> --- Makefile.inc1       (revision 280353)
> +++ Makefile.inc1       (working copy)
> @@ -375,10 +375,14 @@
>  .endif
>  .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc
>  XCFLAGS+=      -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib
>  XCXXFLAGS+=    -I${WORLDTMP}/usr/include/c++/v1 -std=gnu++11 
> -L${WORLDTMP}/../lib/libc++
>  DEPFLAGS+=     -I${WORLDTMP}/usr/include/c++/v1
> +.if ${COMPILER_VERSION} > 40201
> +XCFLAGS+=      --sysroot=${WORLDTMP} ${BFLAGS}
> +XCXXFLAGS+=    --sysroot=${WORLDTMP} ${BFLAGS}
> +.endif
>  .else
>  TARGET_ABI?=   unknown
>  TARGET_TRIPLE?=        
> ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd11.0
>  XCFLAGS+=      -target ${TARGET_TRIPLE}
>  XCFLAGS+=      --sysroot=${WORLDTMP} ${BFLAGS}

OK. I have a bit of egg on my face…

The test is for X_COMPILER_TYPE, so COMPILER_VERSION isn’t relevant. It’s 
always outside the tree.
So your original patch is correct. Please go ahead and commit that and accept 
my apologies for the wild goose chase.

Warner

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to