mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 23:46:13 -05:00
gnu: clang: Only install cfi_blacklist.txt for versions >= 3.8.
Fixes <https://bugs.gnu.org/42599>.
Reported by Malte Frank Gerdes <malte.f.gerdes@gmail.com>.
This is a follow-up to commit 300b795520
.
* gnu/packages/llvm.scm (clang-from-llvm): Guard the 'symlink-cfi_blacklist'
phase with a version check, as it first appears in Clang 3.8.
This commit is contained in:
parent
ebf3960673
commit
0d3063f4bc
1 changed files with 22 additions and 19 deletions
|
@ -388,25 +388,28 @@ (define (move program)
|
|||
(("@GLIBC_LIBDIR@")
|
||||
(string-append libc "/lib"))))))
|
||||
#t)))
|
||||
(add-after 'install 'symlink-cfi_blacklist
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib-share (string-append out "/lib/clang/"
|
||||
,version "/share"))
|
||||
(compiler-rt (assoc-ref inputs "clang-runtime"))
|
||||
;; The location varies between Clang versions.
|
||||
(cfi-blacklist
|
||||
(cond ((file-exists?
|
||||
(string-append compiler-rt "/cfi_blacklist.txt"))
|
||||
(string-append compiler-rt "/cfi_blacklist.txt"))
|
||||
(else (string-append compiler-rt
|
||||
"/share/cfi_blacklist.txt")))))
|
||||
(mkdir-p lib-share)
|
||||
;; Symlink cfi_blacklist.txt to where Clang expects
|
||||
;; to find it.
|
||||
(symlink cfi-blacklist
|
||||
(string-append lib-share "/cfi_blacklist.txt"))
|
||||
#t)))
|
||||
,@(if (version>? version "3.8")
|
||||
`((add-after 'install 'symlink-cfi_blacklist
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(lib-share (string-append out "/lib/clang/"
|
||||
,version "/share"))
|
||||
(compiler-rt (assoc-ref inputs "clang-runtime"))
|
||||
;; The location varies between Clang versions.
|
||||
(cfi-blacklist
|
||||
(cond
|
||||
((file-exists?
|
||||
(string-append compiler-rt "/cfi_blacklist.txt"))
|
||||
(string-append compiler-rt "/cfi_blacklist.txt"))
|
||||
(else (string-append compiler-rt
|
||||
"/share/cfi_blacklist.txt")))))
|
||||
(mkdir-p lib-share)
|
||||
;; Symlink cfi_blacklist.txt to where Clang expects
|
||||
;; to find it.
|
||||
(symlink cfi-blacklist
|
||||
(string-append lib-share "/cfi_blacklist.txt"))
|
||||
#t))))
|
||||
'())
|
||||
(add-after 'install 'install-clean-up-/share/clang
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
|
|
Loading…
Reference in a new issue