me
/
guix
Archived
1
0
Fork 0

gnu: clang@13: Install CFI ignorelist.

* gnu/packages/llvm.scm (clang-from-llvm)[arguments]: Adjust
symlink-cfi_blacklist phase to work with the renamed "ignorelist" in
clang-runtime@13.  Rename phase to match.
* gnu/packages/llvm.scm (clang-13)[arguments]: Remove.
master
Marius Bakke 2022-01-07 18:53:42 +01:00
parent f8601b4289
commit e85e595628
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
1 changed files with 22 additions and 30 deletions

View File

@ -364,26 +364,28 @@ given PATCHES. When TOOLS-EXTRA is given, it must point to the
#t)))) #t))))
'()) '())
,@(if (version>? version "3.8") ,@(if (version>? version "3.8")
`((add-after 'install 'symlink-cfi_blacklist `((add-after 'install 'symlink-cfi_ignorelist
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(lib-share (string-append out "/lib/clang/" (lib-share (string-append out "/lib/clang/"
,version "/share")) ,version "/share"))
(compiler-rt (assoc-ref inputs "clang-runtime")) (compiler-rt (assoc-ref inputs "clang-runtime"))
(file-name ,(if (version>=? version "13")
"cfi_ignorelist.txt"
"cfi_blacklist.txt"))
;; The location varies between Clang versions. ;; The location varies between Clang versions.
(cfi-blacklist (cfi-ignorelist
(cond (cond
((file-exists? ((file-exists?
(string-append compiler-rt "/cfi_blacklist.txt")) (string-append compiler-rt "/" file-name))
(string-append compiler-rt "/cfi_blacklist.txt")) (string-append compiler-rt "/" file-name))
(else (string-append compiler-rt (else (string-append compiler-rt
"/share/cfi_blacklist.txt"))))) "/share/" file-name)))))
(mkdir-p lib-share) (mkdir-p lib-share)
;; Symlink cfi_blacklist.txt to where Clang expects ;; Symlink the ignorelist to where Clang expects
;; to find it. ;; to find it.
(symlink cfi-blacklist (symlink cfi-ignorelist
(string-append lib-share "/cfi_blacklist.txt")) (string-append lib-share "/" file-name))))))
#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)
@ -630,27 +632,17 @@ of programming tools as well as libraries with equivalent functionality.")
"0gyvfhnypfmlf7hdgkiz2wh2lgk4nz26aqf361msjs3qdkbh4djc")) "0gyvfhnypfmlf7hdgkiz2wh2lgk4nz26aqf361msjs3qdkbh4djc"))
(define-public clang-13 (define-public clang-13
(let ((template (clang-from-llvm llvm-13 clang-runtime-13
(clang-from-llvm llvm-13 clang-runtime-13 "0zp1p6syii5iajm8v2c207s80arv00yz5ckfwimn5dng0sxiqqax"
"0zp1p6syii5iajm8v2c207s80arv00yz5ckfwimn5dng0sxiqqax" #:patches '("clang-13.0-libc-search-path.patch")
#:patches '("clang-13.0-libc-search-path.patch") #:tools-extra
#:tools-extra (origin
(origin (method url-fetch)
(method url-fetch) (uri (llvm-uri "clang-tools-extra"
(uri (llvm-uri "clang-tools-extra" (package-version llvm-13)))
(package-version llvm-13))) (sha256
(sha256 (base32
(base32 "1mgalgdgxlxi08yxw7k6yh4iia1bpjmjgn7mrpqas8lbl9h612s2")))))
"1mgalgdgxlxi08yxw7k6yh4iia1bpjmjgn7mrpqas8lbl9h612s2"))))))
(package
(inherit template)
(arguments
(substitute-keyword-arguments (package-arguments template)
((#:phases phases '%standard-phases)
`(modify-phases ,phases
;; This fails because the target to
;; lib/clang/13.0.0/share/cfi_blacklist.txt is not found.
(delete 'validate-runpath))))))))
(define-public clang-toolchain-13 (define-public clang-toolchain-13
(make-clang-toolchain clang-13)) (make-clang-toolchain clang-13))