From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Clang c++ include path Date: Mon, 28 Oct 2019 18:58:38 +0100 Message-ID: <871ruwlpkh.fsf@elephly.net> References: <87wocpz2zl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53904) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iP9I0-0007oP-Am for guix-devel@gnu.org; Mon, 28 Oct 2019 13:58:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iP9Hz-0008S5-4E for guix-devel@gnu.org; Mon, 28 Oct 2019 13:58:48 -0400 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21125) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iP9Hy-0008Qg-Hw for guix-devel@gnu.org; Mon, 28 Oct 2019 13:58:47 -0400 In-reply-to: <87wocpz2zl.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mathieu Othacehe Cc: guix-devel@gnu.org Hi Mathieu, > When running clang on a c++ program, it cannot find c++ std libraries. > That's because, those libraries path are hardcoded inside g++ compiler > and clang cannot find them. Does this patch help? --8<---------------cut here---------------start------------->8--- diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 9efb4a4841..3c59e8d26d 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -204,7 +204,7 @@ compiler. In LLVM this library is called \"compiler-rt\".") (compiler-rt (assoc-ref inputs "clang-runtime"))) (case (string->number ,(version-major (package-version clang-runtime))) - ((or 6 7) + ((or 6 7 8) ;; Link to libclang_rt files from clang-runtime. (substitute* "lib/Driver/ToolChain.cpp" (("getDriver\\(\\)\\.ResourceDir") @@ -363,16 +363,15 @@ requirements according to version 1.1 of the OpenCL specification.") "1mf9cpgvix34xlpv0inkgl3qmdvgvp96f7sksqizri0n5xfp1cgp")) (file-name (string-append "libomp-" version ".tar.xz")))) (build-system cmake-build-system) - ;; XXX: Note this gets built with GCC because building with Clang itself - ;; fails (missing , even when libcxx is added as an input.) (arguments '(#:configure-flags '("-DLIBOMP_USE_HWLOC=ON" - "-DOPENMP_TEST_C_COMPILER=clang" - "-DOPENMP_TEST_CXX_COMPILER=clang++") + "-DCMAKE_C_COMPILER=clang" + "-DCMAKE_CXX_COMPILER=clang++") #:test-target "check-libomptarget")) (native-inputs `(("clang" ,clang) ("llvm" ,llvm) + ("libcxx" ,libcxx) ("perl" ,perl) ("pkg-config" ,pkg-config))) (inputs --8<---------------cut here---------------end--------------->8--- -- Ricardo