From owner-freebsd-arm@freebsd.org Mon Apr 4 04:48:27 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 072CAAEC718 for ; Mon, 4 Apr 2016 04:48:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDF4A1AAD for ; Mon, 4 Apr 2016 04:48:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ig0-x22b.google.com with SMTP id ui10so62780347igc.1 for ; Sun, 03 Apr 2016 21:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=7aOEOpNPmYLiTiqiKBSHa8jD1fI8K/0nsRoau8MDs70=; b=qEALOkA4B/BxzH16wMaZUYAVs0SbKey1NqFaZ/2P3PhPn8QR6IbDCHVsDF/WtMefdW rAQjT0/5CG4TCUjU76v7k9siox+Y2ph7gAl5UoohP8oaoEmHgs5VKW0qxHX6l36M4sJ4 4fVPcV9PpMKx9NqI/ddG0RLQIwQUAbLKDOpaellnzJ+WaWgWlyPiKzw1P/iW1mBngyn2 r+zTSfwLXbyUfTlnnbJnI+B64kVlmgrdEqlnrQGDirVSGCp59/9E9LbV4IL46vJzhyhT 8wu2ywTThTwzC/ajsdP/U7ibOcdtRPcwQGNzZlGHbOYfb+cOidYCcnMFv5vVEUXxX8yP YC2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=7aOEOpNPmYLiTiqiKBSHa8jD1fI8K/0nsRoau8MDs70=; b=WSrz4WVxcEFVjZtRbwt2K/Rw3J8hZ+foXVRhg7GN/LBh0PRS7mNRNw9r65wMJySkHV HcaTJSJyjkKotbTPZl26FckqrfFvRJCArHCMrAmZZJ9Ggatf+YCDmIwEpOotoNmCCEvw xJJpBXfPNTMlxdqA2gh7+SDv9mzm2AuKl6m0wLzEqkZ5BLZxF89mUSNfZOHVALSrEVtt 6lKYkURMbI6lb/QBx+ZBemFmpMVzgbZTXIHa+IpkZl+6TvYeh+2a3+Z6f0P0JV8qrbeE fg5osJ28o8ZodQgWrDnJBMBgQHOtlfGUFOr3kYSNeG+7XRQK3PopNEZRHI8eUSLSLA6/ egcg== X-Gm-Message-State: AD7BkJL6U1oN8bGgfBYWf/4K2cxutG67TCFfEE7Ua9JWP+SRtEchRE7x+MofGURDmzTAaRXJMgDHdLaq9inc6A== MIME-Version: 1.0 X-Received: by 10.50.108.108 with SMTP id hj12mr8130499igb.57.1459745305925; Sun, 03 Apr 2016 21:48:25 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.36.194.3 with HTTP; Sun, 3 Apr 2016 21:48:25 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: References: Date: Sun, 3 Apr 2016 22:48:25 -0600 X-Google-Sender-Auth: LA95CfgVlGcao6aQeXbvNrxy4o0 Message-ID: Subject: Re: 11.0: head/lib/libsysdecode/Makefile for . . ./libsoft/usr/include uses CPP when XCPP needed? From: Warner Losh To: Mark Millard Cc: FreeBSD Toolchain , freebsd-arm Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2016 04:48:27 -0000 On Sun, Apr 3, 2016 at 10:25 PM, Mark Millard 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 :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