From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: bug#32773: [PATCH] Fix clang libstdc++ header location search Date: Thu, 14 Nov 2019 11:30:07 +0100 Message-ID: <874kz6698w.fsf@gmail.com> References: <19ece273-ea75-fc9d-4e4b-aa3a68deab6d@yahoo.de> <20191113165516.56228-1-david.truby@arm.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:48643) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVCP1-0005nF-W0 for bug-guix@gnu.org; Thu, 14 Nov 2019 05:31:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iVCP0-0002hv-RX for bug-guix@gnu.org; Thu, 14 Nov 2019 05:31:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:52176) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iVCP0-0002hn-OQ for bug-guix@gnu.org; Thu, 14 Nov 2019 05:31:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iVCP0-0000dK-I7 for bug-guix@gnu.org; Thu, 14 Nov 2019 05:31:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <20191113165516.56228-1-david.truby@arm.com> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 32773@debbugs.gnu.org Cc: nd , "guix-patches@gnu.org" Hello David, This patch is a real progress, thank you! However, I still have a linking error when compiling a trivial test program with clang: mathieu@elbruz ~/guix [env]$ ./pre-inst-env guix environment --ad-hoc clang --pure mathieu@elbruz ~/guix [env]$ clang ~/tmp/t.cpp clang-8: error: unable to execute command: Executable "ld" doesn't exist! clang-8: error: linker command failed with exit code 1 (use -v to see invocation) This is because the linker provided by "binutils" is not accessible. I guess we need to make something analog to make-gcc-toolchain. WDYT? Mathieu David Truby writes: > --- > gnu/packages/llvm.scm | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm > index 33fb53d65e..0a7efe980f 100644 > --- a/gnu/packages/llvm.scm > +++ b/gnu/packages/llvm.scm > @@ -202,6 +202,7 @@ compiler. In LLVM this library is called \"compiler-rt\".") > (lambda* (#:key inputs #:allow-other-keys) > (let ((libc (assoc-ref inputs "libc")) > (compiler-rt (assoc-ref inputs "clang-runtime")) > + (gcc (assoc-ref inputs "gcc")) > (version > (string->number > ,(version-major (package-version clang-runtime))))) > @@ -218,6 +219,10 @@ compiler. In LLVM this library is called \"compiler-rt\".") > (("(^[[:blank:]]+LibDir = ).*" _ declaration) > (string-append declaration "\"" libc "/lib\";\n")) > > + ;; Make clang look for libstdc++ in the right location > + (("LibStdCXXIncludePathCandidates\\[\\] = \\{") > + (string-append "LibStdCXXIncludePathCandidates[] = { \"" gcc "/include/c++\",")) > + > ;; Make sure libc's libdir is on the search path, to > ;; allow crt1.o & co. to be found. > (("@GLIBC_LIBDIR@")