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:
Marius Bakke 2020-07-29 23:41:15 +02:00
parent ebf3960673
commit 0d3063f4bc
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
1 changed files with 22 additions and 19 deletions

View File

@ -388,25 +388,28 @@ given PATCHES. When TOOLS-EXTRA is given, it must point to the
(("@GLIBC_LIBDIR@") (("@GLIBC_LIBDIR@")
(string-append libc "/lib")))))) (string-append libc "/lib"))))))
#t))) #t)))
(add-after 'install 'symlink-cfi_blacklist ,@(if (version>? version "3.8")
(lambda* (#:key inputs outputs #:allow-other-keys) `((add-after 'install 'symlink-cfi_blacklist
(let* ((out (assoc-ref outputs "out")) (lambda* (#:key inputs outputs #:allow-other-keys)
(lib-share (string-append out "/lib/clang/" (let* ((out (assoc-ref outputs "out"))
,version "/share")) (lib-share (string-append out "/lib/clang/"
(compiler-rt (assoc-ref inputs "clang-runtime")) ,version "/share"))
;; The location varies between Clang versions. (compiler-rt (assoc-ref inputs "clang-runtime"))
(cfi-blacklist ;; The location varies between Clang versions.
(cond ((file-exists? (cfi-blacklist
(string-append compiler-rt "/cfi_blacklist.txt")) (cond
(string-append compiler-rt "/cfi_blacklist.txt")) ((file-exists?
(else (string-append compiler-rt (string-append compiler-rt "/cfi_blacklist.txt"))
"/share/cfi_blacklist.txt"))))) (string-append compiler-rt "/cfi_blacklist.txt"))
(mkdir-p lib-share) (else (string-append compiler-rt
;; Symlink cfi_blacklist.txt to where Clang expects "/share/cfi_blacklist.txt")))))
;; to find it. (mkdir-p lib-share)
(symlink cfi-blacklist ;; Symlink cfi_blacklist.txt to where Clang expects
(string-append lib-share "/cfi_blacklist.txt")) ;; to find it.
#t))) (symlink cfi-blacklist
(string-append lib-share "/cfi_blacklist.txt"))
#t))))
'())
(add-after 'install 'install-clean-up-/share/clang (add-after 'install 'install-clean-up-/share/clang
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))