11.0: head/lib/libsysdecode/Makefile for . . ./libsoft/usr/include uses CPP when XCPP needed?

Warner Losh imp at bsdimp.com
Mon Apr 4 04:48:27 UTC 2016


On Sun, Apr 3, 2016 at 10:25 PM, Mark Millard <markmi at dsl-only.net> wrote:

> For an amd64 -> armv7a (rpi2 targeting) cross-compile the code
>
> > # $FreeBSD: head/lib/libsysdecode/Makefile 295931 2016-02-23 20:00:55Z
> jhb $
> >
> > . . .
> > ioctl.c: mkioctls
> >         env MACHINE=${MACHINE} CPP="${CPP}" \
> >                 /bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} >
> ${.TARGET}
>
> (with its use of CPP instead of the XCPP) got:
>
> > --- all_subdir_lib/libsysdecode ---
> > --- ioctl.c ---
> > env MACHINE=arm CPP="/usr/bin/clang-cpp"  /bin/sh
> /usr/src/lib/libsysdecode/mkioctls
> /usr/obj/clang/arm.armv6/usr/src/libsoft/usr/include > ioctl.c
> > . . .
> > --- all_subdir_lib/libsysdecode ---
> > In file included from <stdin>:17:
> > In file included from
> /usr/obj/clang/arm.armv6/usr/src/libsoft/usr/include/dev/nvme/nvme.h:36:
> > In file included from
> /usr/obj/clang/arm.armv6/usr/src/libsoft/usr/include/sys/param.h:135:
> > In file included from
> /usr/obj/clang/arm.armv6/usr/src/libsoft/usr/include/machine/param.h:49:
> >
> /usr/obj/clang/arm.armv6/usr/src/libsoft/usr/include/machine/acle-compat.h:182:4:
> error: Unable to determine architecture version.
> > #  error Unable to determine architecture version.
> >    ^
>
> In my case I had the following in the in-use src.conf in order to control
> the cross compile specifics:
>
> > XCC=/usr/bin/clang -target ${TO_TYPE}--freebsd11.0-gnueabi -march=armv7a
> -mcpu=cortex-a7 -mno-unaligned-access
> > XCXX=/usr/bin/clang++ -target ${TO_TYPE}--freebsd11.0-gnueabi
> -march=armv7a -mcpu=cortex-a7 -mno-unaligned-access
> > XCPP=/usr/bin/clang-cpp -target ${TO_TYPE}--freebsd11.0-gnueabi
> -march=armv7a -mcpu=cortex-a7 -mno-unaligned-access
>
>
> (I've been doing such for a long time but only just progressed to a 11.0
> source vintage with libsoft involved.)
>
> Even if I'm out of bounds for technique in some way I expect that
>
> > ioctl.c: mkioctls
> >         env MACHINE=${MACHINE} CPP="${CPP}" \
> >                 /bin/sh ${.CURDIR}/mkioctls ${DESTDIR}${INCLUDEDIR} >
> ${.TARGET}
>
> is not doing everything it should to have the full context needed for . .
> ./machine/acle-compat.h .
>

It's gotta be upstream. XCPP XCC and XCXX are all exclusive to
Makefile.inc1. It's up to it to sort out the
rest...  And none of the X{AR,AS,LD,etc} are defined, so there's bound to
be an impedance mismatch. :)
In the past when I've seen this it's been due to some kind of variable
contamination, perhaps one that's
not otherwise known...

Warner


More information about the freebsd-toolchain mailing list