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'.
This commit is contained in:
Efraim Flashner 2022-05-29 08:46:17 +03:00
parent a5f4c03df1
commit 926fcb488b
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -216,7 +216,15 @@ (define* (clang-from-llvm llvm clang-runtime
;; 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"