summary refs log tree commit diff
path: root/gnu/packages/llvm.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-07-21 16:41:30 +0200
committerMarius Bakke <marius@gnu.org>2020-07-23 01:14:59 +0200
commit300b795520baf106b662f045fe7d644643e8e7d1 (patch)
treea0fe7b5fc1b8a7d3a689eb1144a09bd1c8cbd8d1 /gnu/packages/llvm.scm
parent66c3a35b1bad6060a9b9af78b764449dbfdededf (diff)
downloadguix-300b795520baf106b662f045fe7d644643e8e7d1.tar.gz
gnu: Clang: Install the CFI blacklist.
* gnu/packages/llvm.scm (clang-from-llvm)[arguments]: Add phase to symlink
cfi_blacklist.txt from CLANG-RUNTIME.
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r--gnu/packages/llvm.scm19
1 files changed, 19 insertions, 0 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index b7bc21ea6e..4a17ecd664 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -388,6 +388,25 @@ 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)))
                   (add-after 'install 'install-clean-up-/share/clang
                     (lambda* (#:key outputs #:allow-other-keys)
                       (let* ((out (assoc-ref outputs "out"))