From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: bug#37999: clang fails to pickup/supply startfiles to ld Date: Thu, 31 Oct 2019 15:11:48 +0100 Message-ID: <87eeyt57iz.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44862) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQBBD-0003fl-NZ for bug-guix@gnu.org; Thu, 31 Oct 2019 10:12:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQBBC-0007MI-4F for bug-guix@gnu.org; Thu, 31 Oct 2019 10:12:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iQBBB-0007Kq-SG for bug-guix@gnu.org; Thu, 31 Oct 2019 10:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iQBBB-0005AD-MH for bug-guix@gnu.org; Thu, 31 Oct 2019 10:12:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Carl Dong Cc: 37999@debbugs.gnu.org --=-=-= Content-Type: text/plain This patch is a bit more viable that the previous one I think. Mathieu --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-clang-from-llvm-Fix-set-glibc-file-names-phase.patch >From f126146880e3904f39728313dfc10288b51fc23a Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe 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 --=-=-=--