summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-07-29 23:41:15 +0200
committerMarius Bakke <marius@gnu.org>2020-07-30 00:57:26 +0200
commit0d3063f4bc62b2d18179642e48074a81fd04bcbf (patch)
tree69b05f5417d85bf453a743903e69b6ab71a059a3 /gnu
parentebf3960673fa5e655f10ba94aec7ae95c850b9fc (diff)
downloadguix-0d3063f4bc62b2d18179642e48074a81fd04bcbf.tar.gz
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 300b795520baf106b662f045fe7d644643e8e7d1.

* 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.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/llvm.scm41
1 files changed, 22 insertions, 19 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 4a17ecd664..af1fb6cf7f 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -388,25 +388,28 @@ given PATCHES.  When TOOLS-EXTRA is given, it must point to the
                                 (("@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"))