From owner-freebsd-toolchain@freebsd.org Sun Oct 29 09:46:33 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 1BE5EE5EDCC for ; Sun, 29 Oct 2017 09:46:33 +0000 (UTC) (envelope-from sid@bsdmail.com) Received: from mout.gmx.com (mout.gmx.com [74.208.4.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mail.gmx.com", Issuer "thawte SSL CA - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D676D734EB for ; Sun, 29 Oct 2017 09:46:32 +0000 (UTC) (envelope-from sid@bsdmail.com) Received: from [108.70.50.7] by 3c-app-mailcom-lxa14.server.lan (via HTTP); Sun, 29 Oct 2017 10:46:29 +0100 MIME-Version: 1.0 Message-ID: From: Sid To: "Mark Millard" , freebsd-toolchain@freebsd.org Subject: Re: External LLVM toolchain not consistently locating c++ when compiling ports Content-Type: text/plain; charset=UTF-8 Date: Sun, 29 Oct 2017 10:46:29 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <3E01A2C6-0728-4295-90AE-76A7CE5955EF@dsl-only.net> References: <3E01A2C6-0728-4295-90AE-76A7CE5955EF@dsl-only.net> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:FhI4WkLQgbyKsVSjmLXjWmPxybBGV0ycC1OSGDlxCh3 RL1PYLzey5pHGPfXMJWIRk8LxuDSdm3YiOawICPIKEm4CDni0g eWV5PvkeDZbTlKNkOCUmw5uNotz7K66Eq8shIUSqGDKBFvUAlI YtUZkjk7255YDf9tSo+uY3LOharz9VBe967BtgQ80yVgrPXzRJ FrSZb6Jkr+rxJ8lKO8Rs1qaVgyqOvhnFZuHbGKPNxKxuqHa6+c T1ZADwTdHPBRc1qH6d1JmYsHUBFV+duJtWZubq1GbQnAuWZ3fw i+Oyao= X-UI-Out-Filterresults: notjunk:1;V01:K0:IVCXwZ5g+3k=:l5qhMiRzlrAgoypSpChqam CxMJ1IwFPmVEMQX+R5jt9p2SYYUPnUR4gjI8Gw6VdMgF4zDLfyoPQgN+PT8XmGo/emNnsdYY3 yvcfCmXchjL5RFqmWqA8I2x1+L77UGglQC0jrAb5HzFQonf2sX3Wo861vsFFap3OMrVknT4Ww XI+dpmNUOuiPdk6UGZ9DuONP/PLOnX7Tfawvw1XXwjNehdALRNwHeBUlNSgY9U38u3/mmCPRG 5NbcJcY5A6rSP0DXz0YbMZwr+8iV6stwPgaIud/fe5hgu/lppL4RpOMuPaOygHIu6xU61+uaU aAgec2P70NRVq7I/G9TkWhTXJuCRQ4D84OiQI3rLrJRjrvFf9c6Bqf5NUuBvqh5hIeHSNjV53 RKTvwwfd86ALsg+0Qhu7n1BM3qfr8RH8WSuzGrJBiYLCKa+VzRBYQX/A8w00PKPD/3yX4mcJO Ej9kkKskIUJS21J9RJ/r6/HHLvAcq0s6mNvdsWwkq2ogVg505Cq7Hou8XA0+kW/xPf39wpP+a 9VCEQhVkvHQZSPpeYZuoVT8OTb30k+DtbCGNiFet8LV 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 09:46:33 -0000 Of course llvm50++ or llvm40++ as c++. The problem was naming. I've thought about using links before, but was worried to make too many changes like that. This time using llvm50, I've added two softlinks one in the directory of /usr/local/bin from c++ to clang++50, and in the directory of /usr/local/llvm50/bin/ from c++ to clang. This builds. It's not done yet, but I think this is it. I've added this to the bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223009 . It is about aarch64, but this problem applies to many architectures. Thank you. > Sent: Sunday, October 29, 2017 at 2:48 AM > From: "Mark Millard" > To: Sid > Cc: freebsd-toolchain@freebsd.org > Subject: Re: External LLVM toolchain not consistently locating c++ when compiling ports > > > On 2017-Oct-29, at 12:10 AM, Sid wrote: > > > This is not on Qemu, and I'm not cross-building. This is on an amd64 on 11.1-RELEASE-p2. Base was built without clang or gcc, and clang40 was installed from ports. > > > > The base and kernel compile using lang/llvm40 with XCC, XCXX, and XCPP set. I'm a little confused, as how earlier, it seemed that ports that didn't need c++ were building without CC, CXX, and CPP options set. If I made a mistake here, I apologize for this. It seems CC, CXX, and CPP are made for ports. Then the problem is with Rust locating c++ that is in /usr/local/bin/ and not contained within FreeBSD 11.1's base, in /usr/bin/. > > > > Nearly all programs requiring c++, needed for my desktop (xorg, rxvt-unicode, leafpad, sox) compiled when all 6 variables were set (CC,CPP, etc). Only Rust, and programs depending on it failed. Now I think the problem is, that Rust and programs depending on it look in absolute locations for c++. > > I'm afraid there is a clang++40 to find but no c++ > to be found anywhere in your context based on what > you have described. > > I have llvm50 installed instead of llvm40, so, that is what > I'll use as an example for amd64 (head -r324743 ). . . > > # pkg info llvm50 > llvm50-5.0.0_1 > Name : llvm50 > Version : 5.0.0_1 > Installed on : Sun Sep 24 00:26:47 2017 PDT > Origin : devel/llvm50 > Architecture : FreeBSD:12:amd64 > Prefix : /usr/local > Categories : devel lang > Licenses : LLVM > Maintainer : brooks@FreeBSD.org > WWW : http://llvm.org/ > Comment : LLVM and Clang > Options : > CLANG : on > COMPILER_RT : on > DOCS : on > EXTRAS : on > GOLD : on > LIT : on > LLD : on > LLDB : on > OPENMP : on > . . . > > But no command c++ is under /usr/local/ , > there is just a directory of that name > (from lang/gcc7 in my context): > > # find /usr/local -name c++ -print | more > /usr/local/lib/gcc7/include/c++ > > Clang++50 is under its own name: > > # which clang++50 > /usr/local/bin/clang++50 > > So without system clang (or system gcc 4.2.1) and only > with llvm40 I expect that there is no c++ command at all. > The issue would not be an overly-specific path: no path > would work. > > Rust needs to not be looking for a c++ command at all. > It needs to be using ${CXX} and the like that would > need to involve clang++50 . > > But you can make a local workaround by creating your > own c++ command someplace in the paths being checked, > either linking to or copying clang++40 to produce the > c++ . c++ might not be the only file needing such > a technique. > > Prior material follows, nothing new so likely skip. . . > > > Sent: Sunday, October 29, 2017 at 12:11 AM > > From: "Mark Millard" > > To: Sid > > Cc: freebsd-toolchain@freebsd.org > > Subject: Re: External LLVM toolchain not consistently locating c++ when compiling ports > > > > > > On 2017-Oct-28, at 9:40 PM, Sid wrote: > > > >> In /etc/make.conf, when I use, > >> XCC= /usr/local/bin/clang40 > >> XCXX= /usr/local/bin/clang++40 > >> XCPP= /usr/local/bin/clang-cpp40 > >> for ports that require c++ without clang in the base system, I get the error code > >> make: "/usr/ports/Mk/Uses/compiler.mk" line 112:warning: "c++ -### /dev/null 2>&1" returned non-zero status ..... > > > >> 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= /usr/local/bin/clang40 > >> CXX= /usr/local/bin/clang++40 > >> CPP= /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). ..... > >> 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. > > > === > Mark Millard > markmi at dsl-only.net > >