summary refs log tree commit diff
path: root/gnu/packages/llvm.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-06-01 12:31:09 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-06-01 12:42:04 +0300
commit64c043e63a4be97f59fd1906c47973a74eedda67 (patch)
tree37b15dfb4830e4f874edca87b521b6e9cdc3c81b /gnu/packages/llvm.scm
parentb1f763de54dc2b8e240d0f01f7948ce76f67243e (diff)
parent75af73e1b7ac58770122d8831faa3a8158638bb0 (diff)
downloadguix-64c043e63a4be97f59fd1906c47973a74eedda67.tar.gz
Merge remote-tracking branch 'origin/master' into staging
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r--gnu/packages/llvm.scm19
1 files changed, 15 insertions, 4 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index c93c1db7fe..d3b16f2759 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2018–2022 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2018, 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
@@ -216,7 +216,15 @@ given PATCHES.  When TOOLS-EXTRA is given, it must point to the
              ;; Use a sane default include directory.
              (string-append "-DC_INCLUDE_DIRS="
                             (assoc-ref %build-inputs "libc")
-                            "/include"))
+                            "/include")
+       ,@(if (target-riscv64?)
+           (list "-DLIBOMP_LIBFLAGS=-latomic"
+                 "-DCMAKE_SHARED_LINKER_FLAGS=-latomic")
+           `()))
+
+       ,@(if (target-riscv64?)
+           `(#:make-flags '("LDFLAGS=-latomic"))
+           '())
 
        ;; Don't use '-g' during the build to save space.
        #:build-type "Release"
@@ -353,8 +361,11 @@ given PATCHES.  When TOOLS-EXTRA is given, it must point to the
                                 (mkdir-p lib-share)
                                 ;; Symlink the ignorelist to where Clang expects
                                 ;; to find it.
-                                (symlink cfi-ignorelist
-                                         (string-append lib-share "/" file-name))))))
+                                ;; Not all architectures support CFI.
+                                ;; see: compiler-rt/cmake/config-ix.cmake
+                                (when (file-exists? cfi-ignorelist)
+                                  (symlink cfi-ignorelist
+                                           (string-append lib-share "/" file-name)))))))
                         '())
                   (add-after 'install 'install-clean-up-/share/clang
                     (lambda* (#:key outputs #:allow-other-keys)