From owner-freebsd-toolchain@freebsd.org Sun Oct 29 06:11:22 2017 Return-Path: Delivered-To: freebsd-toolchain@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 53FFEE5A88F for ; Sun, 29 Oct 2017 06:11:22 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-131.reflexion.net [208.70.210.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 025846D079 for ; Sun, 29 Oct 2017 06:11:21 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 7209 invoked from network); 29 Oct 2017 05:11:19 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 29 Oct 2017 05:11:19 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sun, 29 Oct 2017 01:11:19 -0400 (EDT) Received: (qmail 23867 invoked from network); 29 Oct 2017 05:11:19 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 29 Oct 2017 05:11:19 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id CD4AAEC7C1F; Sat, 28 Oct 2017 22:11:18 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: External LLVM toolchain not consistently locating c++ when compiling ports From: Mark Millard X-Priority: 3 In-Reply-To: Date: Sat, 28 Oct 2017 22:11:18 -0700 Cc: freebsd-toolchain@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Sid X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Oct 2017 06:11:22 -0000 On 2017-Oct-28, at 9:40 PM, Sid wrote: > In /etc/make.conf, when I use, > XCC=3D /usr/local/bin/clang40 > XCXX=3D /usr/local/bin/clang++40 > XCPP=3D /usr/local/bin/clang-cpp40 > for ports that require c++ without clang in the base system, I get the = error code=20 > make: "/usr/ports/Mk/Uses/compiler.mk" line 112:warning: "c++ -### = /dev/null 2>&1" returned non-zero status Quoting https://wiki.freebsd.org/ExternalToolchain: XCC The XCC approach works with top level build targets (buildworld, = buildkernel, etc) and overrides common make variables such as CC, CXX, = and AS during the cross building portions of the build with values = specified by the XCC, XCPP, XAS, etc variables. This method touches few = files and is relatively easy to understand, but has drawbacks including = the inability to build individual programs easily.=20 END QUOTE. Does ports support "cross building" that would be expected to use XCC, XCXX, XCPP, and the like? To my knowledge there is no cross build environment for ports that can avoid qemu (or an equivalent): cross builds of parts are based on qemu, which use CC, CXX, CPP and the like as far as I know. > Base and the kernel builds well with this setting. Compiles that don't = need c++ also work with this setting. Unlike for ports builds. (That is my understanding.) > I've compensated by adding > CC=3D /usr/local/bin/clang40 > CXX=3D /usr/local/bin/clang++40 > CPP=3D /usr/local/bin/clang-cpp40 > to the above. While this works for many ports requiring c++, it = doesn't work for Rust, and programs that depend on it (Firefox, = Thunderbird). This is what I'd expect for "self hosted" (target=3Dbuild) types of contexts and for being in a qemu context that looks like the target. I'm not aware of another form of cross build for FreeBSD ports. (I'd like to be able to do powerpc64 and powerpc without a system qemu. User qemu does not work for targeting powerpc64 or for powerpc.) > It seems that XCXX is supposed to replace CXX fully, considering that = XCC replaces CC, and XCPP replaces CPP when compiling other ports. Can you provide evidence of this? Does the evidence involve cross building where the X prefix is involved? > The error message for compiling rust with all of the above (XCC, XCXX, = XCPP, CC, CXX, CPP) set is > couldn't find required command: "c++" Does the environment not have a c++ command in a place listed in path? Otherwise it should be found. > This error happens whether the port option for lang/rust is set to = compile with llvm40 or the bundled version. > This is affected by /usr/ports/Mk/Uses/compiler.mk and I think this = problem affects ports compiled with c++ in the base system as well. =3D=3D=3D Mark Millard markmi at dsl-only.net