guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Clang c++ include path


From: Ricardo Wurmus
Subject: Re: Clang c++ include path
Date: Mon, 28 Oct 2019 18:58:38 +0100
User-agent: mu4e 1.2.0; emacs 26.3

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 <atomic>, 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]