GNU bug report logs - #37999
clang fails to pickup/supply startfiles to ld

Previous Next

Package: guix;

Reported by: Carl Dong <contact <at> carldong.me>

Date: Wed, 30 Oct 2019 20:50:02 UTC

Severity: normal

Done: Mathieu Othacehe <m.othacehe <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 37999 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: Carl Dong <contact <at> carldong.me>
Cc: 37999 <at> debbugs.gnu.org
Subject: Re: bug#37999: clang fails to pickup/supply startfiles to ld
Date: Thu, 31 Oct 2019 15:11:48 +0100
[Message part 1 (text/plain, inline)]
This patch is a bit more viable that the previous one I think.

Mathieu

[0001-gnu-clang-from-llvm-Fix-set-glibc-file-names-phase.patch (text/x-diff, inline)]
From f126146880e3904f39728313dfc10288b51fc23a Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe <at> gmail.com>
Date: Thu, 31 Oct 2019 15:05:54 +0100
Subject: [PATCH] gnu: clang-from-llvm: Fix set-glibc-file-names phase.

* gnu/packages/llvm.scm (clang-from-llvm)[arguments]: Turn case on major
version into a cond, so that newer versions of clang have the same behaviour as
version 6 and 7.
---
 gnu/packages/llvm.scm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 9a42d4fe07..850f05b9bf 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -201,10 +201,12 @@ compiler.  In LLVM this library is called \"compiler-rt\".")
                    'unpack 'set-glibc-file-names
                    (lambda* (#:key inputs #:allow-other-keys)
                      (let ((libc (assoc-ref inputs "libc"))
-                           (compiler-rt (assoc-ref inputs "clang-runtime")))
-                       (case (string->number ,(version-major
-                                               (package-version clang-runtime)))
-                         ((or 6 7)
+                           (compiler-rt (assoc-ref inputs "clang-runtime"))
+                           (version
+                            (string->number
+                             ,(version-major (package-version clang-runtime)))))
+                       (cond
+                         ((> version 3)
                           ;; Link to libclang_rt files from clang-runtime.
                           (substitute* "lib/Driver/ToolChain.cpp"
                             (("getDriver\\(\\)\\.ResourceDir")
@@ -220,7 +222,7 @@ compiler.  In LLVM this library is called \"compiler-rt\".")
                             ;; allow crt1.o & co. to be found.
                             (("@GLIBC_LIBDIR@")
                              (string-append libc "/lib"))))
-                         ((3)
+                         (else
                           (substitute* "lib/Driver/Tools.cpp"
                             ;; Patch the 'getLinuxDynamicLinker' function so that
                             ;; it uses the right dynamic linker file name.
-- 
2.23.0


This bug report was last modified 5 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.