From patchwork Fri Jul 9 22:06:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Prikler X-Patchwork-Id: 31271 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D6DA827BC81; Fri, 9 Jul 2021 23:07:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 912A927BC78 for ; Fri, 9 Jul 2021 23:07:11 +0100 (BST) Received: from localhost ([::1]:54872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1yeM-0004hO-Is for patchwork@mira.cbaines.net; Fri, 09 Jul 2021 18:07:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1yeE-0004hE-4A for guix-patches@gnu.org; Fri, 09 Jul 2021 18:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48333) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m1yeD-0002PB-TU for guix-patches@gnu.org; Fri, 09 Jul 2021 18:07:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m1yeD-0004Tr-JP for guix-patches@gnu.org; Fri, 09 Jul 2021 18:07:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49471] [PATCH] gnu: lld: Update to 12.0.0. References: In-Reply-To: Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 09 Jul 2021 22:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49471 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49471@debbugs.gnu.org Received: via spool by 49471-submit@debbugs.gnu.org id=B49471.162586838917186 (code B ref 49471); Fri, 09 Jul 2021 22:07:01 +0000 Received: (at 49471) by debbugs.gnu.org; 9 Jul 2021 22:06:29 +0000 Received: from localhost ([127.0.0.1]:59879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1ydh-0004T8-KZ for submit@debbugs.gnu.org; Fri, 09 Jul 2021 18:06:29 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:44571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1ydd-0004St-DR for 49471@debbugs.gnu.org; Fri, 09 Jul 2021 18:06:29 -0400 Received: from localhost.localdomain (80-121-26-175.adsl.highway.telekom.at [80.121.26.175]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4GM6gf2vV2z3wY2 for <49471@debbugs.gnu.org>; Sat, 10 Jul 2021 00:06:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1625868382; bh=Jnplg6gCgN/56lp4lHzijt9drpq2eCJb4mJUGbxQY10=; h=From:To:Subject:Date; b=HrSXvc2CFzpqmc0A372z5m5e8AlTBgupedMeOYicTIqlGhL0IwGCYiYau+4qedmDA Ld9f0uo3szr3MhqW6/LOW7DMOHoUoiwmdNt0nxEyDqY+B8VyhxIjzzemR/+eo/6WC6 FjRFM1bgr7IzuK84xjFz6Hj345GFmnsr0byf47Zw= From: Leo Prikler Date: Sat, 10 Jul 2021 00:06:06 +0200 Message-Id: <20210709220605.24524-1-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/llvm.scm (llvm-subprojects-origin, %llvm-project-12.0.0-hash): New variables. (lld-11, lld-12): New variables. (lld): Point to lld-11. --- This patch is an alternative to the one sent by terramorpha. Supposed advantages of it are: * lld still points to lld-11, not breaking any packages that rely on it * llvm-subprojects-origin can be reused by other LLVM subprojects (think of libcxx and libcxxabi, which both require each other, or libunwind, which requires libcxx) Disadvantages are: * llvm-project is a beefy tarball and somewhat of a pain to unpack * Both this version and the original use an unclean approach to building subprojects, that is propagated by LLVM. Perhaps we ought to instead clean up their mess? Regards, Leo gnu/packages/llvm.scm | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 575c63c713..1ddbd39e59 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -92,6 +92,22 @@ as \"x86_64-linux\"." (string-append "https://github.com/llvm/llvm-project/releases/download" "/llvmorg-" version "/" component "-" version ".src.tar.xz")) +(define* (llvm-subprojects-origin components version hash + #:optional (patches '())) + (origin + (method url-fetch) + (uri (llvm-uri "llvm-project" version)) + (sha256 (base32 hash)) + (patches (map search-patch patches)) + (modules '((guix build utils) + (ice-9 ftw))) + (snippet + `(for-each + (lambda (file) + (unless (member file '("." ".." ,@components)) + (delete-file-recursively file))) + (scandir "."))))) + (define* (clang-runtime-from-llvm llvm hash #:optional (patches '())) (package @@ -882,7 +898,7 @@ of programming tools as well as libraries with equivalent functionality.") (define-public clang clang-9) (define-public clang-toolchain clang-toolchain-9) -(define-public lld +(define-public lld-11 (package (name "lld") (version "11.0.0") @@ -906,6 +922,31 @@ of programming tools as well as libraries with equivalent functionality.") components which highly leverage existing libraries in the larger LLVM Project.") (license license:asl2.0))) ; With LLVM exception +(define %llvm-project-12.0.0-hash "0a1n88dmbwp1ww7h3ykf0s001cndk1bm3i2cj1y2sh548f4nilcy") + +(define-public lld-12 + (package + (inherit lld-11) + (version "12.0.0") + (source (llvm-subprojects-origin '("lld" "libunwind") version + %llvm-project-12.0.0-hash)) + (arguments + `(,@(package-arguments lld-11) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'dissect + (lambda _ + ;; Find libunwind in unpacked sources + (substitute* "lld/MachO/CMakeLists.txt" + (("\\$\\{LLVM_MAIN_SRC_DIR\\}/\\.\\./libunwind") + (string-append (getcwd) "/libunwind"))) + ;; chdir to actual source folder + (chdir "lld")))))) + (inputs + `(("llvm" ,llvm-12))))) + +(define-public lld lld-11) + (define-public lldb (package (name "lldb")