aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2022-05-29 08:46:17 +0300
committerEfraim Flashner <efraim@flashner.co.il>2022-05-29 08:46:17 +0300
commit926fcb488b756fb5d6c4c129c4348650919e5835 (patch)
tree83e0ff966dba7b1fef2b0936d544b915b1c89b5c
parenta5f4c03df18f8f76d570b996399a4adf0fc297c6 (diff)
downloadguix-926fcb488b756fb5d6c4c129c4348650919e5835.tar
guix-926fcb488b756fb5d6c4c129c4348650919e5835.tar.gz
gnu: clang-from-llvm: Fix building on riscv64-linux.
* gnu/packages/llvm.scm (clang-from-llvm)[arguments]: When building for riscv64-linux add configure-flags and make-flags to ensure linking with '-latomic'.
-rw-r--r--gnu/packages/llvm.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index aedf039ff4..d3b16f2759 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -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"