From unknown Wed Jun 18 23:08:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#72409 <72409@debbugs.gnu.org> To: bug#72409 <72409@debbugs.gnu.org> Subject: Status: [PATCH] gnu: llvm: Fix misc errors for unsupported targets. Reply-To: bug#72409 <72409@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:08:40 +0000 retitle 72409 [PATCH] gnu: llvm: Fix misc errors for unsupported targets. reassign 72409 guix-patches submitter 72409 Christopher Baines severity 72409 normal tag 72409 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 01 09:45:15 2024 Received: (at submit) by debbugs.gnu.org; 1 Aug 2024 13:45:15 +0000 Received: from localhost ([127.0.0.1]:51064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZW7H-0004mI-9H for submit@debbugs.gnu.org; Thu, 01 Aug 2024 09:45:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:57542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sZW7E-0004m8-Pv for submit@debbugs.gnu.org; Thu, 01 Aug 2024 09:45:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZW6x-0005LG-JW for guix-patches@gnu.org; Thu, 01 Aug 2024 09:44:55 -0400 Received: from mira.cbaines.net ([212.71.252.8]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZW6u-0006h3-Rq for guix-patches@gnu.org; Thu, 01 Aug 2024 09:44:54 -0400 Received: from localhost (unknown [212.132.255.81]) by mira.cbaines.net (Postfix) with ESMTPSA id 0958527BBE2 for ; Thu, 1 Aug 2024 14:44:48 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 6c00bca1 for ; Thu, 1 Aug 2024 13:44:46 +0000 (UTC) From: Christopher Baines To: guix-patches@gnu.org Subject: [PATCH] gnu: llvm: Fix misc errors for unsupported targets. Date: Thu, 1 Aug 2024 14:44:45 +0100 Message-ID: <0e25963b235b36407c0e7f7b0ef77b02ba6029fe.1722519885.git.mail@cbaines.net> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) * gnu/packages/llvm.scm (system->llvm-target-arch): Return #f for unknown targets. (llvm-15, llvm-14): Handle system->llvm-target-arch and raise a package-unsupported-target-error condition. Change-Id: I647f721a64a39bb34196998b7e4adda3a25f1ab3 --- gnu/packages/llvm.scm | 49 +++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 2614a403c1..0c0ec1bca1 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -78,6 +78,8 @@ (define-module (gnu packages llvm) #:use-module (gnu packages vulkan) #:use-module (gnu packages xml) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module (ice-9 match) #:export (make-lld-wrapper system->llvm-target)) @@ -107,8 +109,7 @@ (define* (system->llvm-target-arch #:optional (if (string-prefix? system-prefix system) target (matches rest ...))) - ((_) - (error "LLVM target arch for system is unknown" system))))) + ((_) #f)))) (matches ("aarch64" => "AArch64") ("armhf" => "ARM") ("mips64el" => "Mips") @@ -591,15 +592,21 @@ (define-public llvm-15 ;; These options are required for cross-compiling LLVM according ;; to . #$@(if (%current-target-system) - #~((string-append "-DLLVM_TABLEGEN=" + (or (and=> + (system->llvm-target-arch) + (lambda (llvm-target-arch) + #~((string-append "-DLLVM_TABLEGEN=" #+(file-append this-package "/bin/llvm-tblgen")) - #$(string-append "-DLLVM_DEFAULT_TARGET_TRIPLE=" - (%current-target-system)) - #$(string-append "-DLLVM_TARGET_ARCH=" - (system->llvm-target-arch)) - #$(string-append "-DLLVM_TARGETS_TO_BUILD=" - (system->llvm-target))) + #$(string-append "-DLLVM_DEFAULT_TARGET_TRIPLE=" + (%current-target-system)) + #$(string-append "-DLLVM_TARGET_ARCH=" llvm-target-arch) + #$(string-append "-DLLVM_TARGETS_TO_BUILD=" + (system->llvm-target))))) + (raise (condition + (&package-unsupported-target-error + (package this-package) + (target (%current-target-system)))))) '()) ;; Note: sadly, the build system refuses the use of ;; -DBUILD_SHARED_LIBS=ON and the large static archives are needed to @@ -651,15 +658,21 @@ (define-public llvm-14 ;; These options are required for cross-compiling LLVM according ;; to . #$@(if (%current-target-system) - #~((string-append "-DLLVM_TABLEGEN=" - #+(file-append this-package - "/bin/llvm-tblgen")) - #$(string-append "-DLLVM_DEFAULT_TARGET_TRIPLE=" - (%current-target-system)) - #$(string-append "-DLLVM_TARGET_ARCH=" - (system->llvm-target-arch)) - #$(string-append "-DLLVM_TARGETS_TO_BUILD=" - (system->llvm-target))) + (or (and=> + (system->llvm-target-arch) + (lambda (llvm-target-arch) + #~((string-append "-DLLVM_TABLEGEN=" + #+(file-append this-package + "/bin/llvm-tblgen")) + #$(string-append "-DLLVM_DEFAULT_TARGET_TRIPLE=" + (%current-target-system)) + #$(string-append "-DLLVM_TARGET_ARCH=" llvm-target-arch) + #$(string-append "-DLLVM_TARGETS_TO_BUILD=" + (system->llvm-target))))) + (raise (condition + (&package-unsupported-target-error + (package this-package) + (target (%current-target-system)))))) '()) ;; undefined reference to `__atomic_fetch_add_8' in lib/libLLVMOrcJIT.so.14 #$@(if (target-ppc32?) base-commit: 56d3d04a442b52097e523dcfebf60ff5bf82bcfd -- 2.45.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 11 06:34:39 2024 Received: (at 72409-done) by debbugs.gnu.org; 11 Aug 2024 10:34:39 +0000 Received: from localhost ([127.0.0.1]:40717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sd5uJ-000835-Gi for submit@debbugs.gnu.org; Sun, 11 Aug 2024 06:34:39 -0400 Received: from mira.cbaines.net ([212.71.252.8]:44004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sd5uH-00082y-QZ for 72409-done@debbugs.gnu.org; Sun, 11 Aug 2024 06:34:38 -0400 Received: from localhost (unknown [212.132.255.81]) by mira.cbaines.net (Postfix) with ESMTPSA id C904027BBE9 for <72409-done@debbugs.gnu.org>; Sun, 11 Aug 2024 11:34:06 +0100 (BST) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id c85ff46c for <72409-done@debbugs.gnu.org>; Sun, 11 Aug 2024 10:34:06 +0000 (UTC) From: Christopher Baines To: 72409-done@debbugs.gnu.org Subject: Re: [bug#72409] [PATCH] gnu: llvm: Fix misc errors for unsupported targets. In-Reply-To: <0e25963b235b36407c0e7f7b0ef77b02ba6029fe.1722519885.git.mail@cbaines.net> (Christopher Baines's message of "Thu, 1 Aug 2024 14:44:45 +0100") References: <0e25963b235b36407c0e7f7b0ef77b02ba6029fe.1722519885.git.mail@cbaines.net> User-Agent: mu4e 1.12.4; emacs 29.3 Date: Sun, 11 Aug 2024 11:34:06 +0100 Message-ID: <87bk1zz6u9.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 72409-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Christopher Baines writes: > * gnu/packages/llvm.scm (system->llvm-target-arch): Return #f for unknown > targets. > (llvm-15, llvm-14): Handle system->llvm-target-arch and raise a > package-unsupported-target-error condition. > > Change-Id: I647f721a64a39bb34196998b7e4adda3a25f1ab3 > --- > gnu/packages/llvm.scm | 49 +++++++++++++++++++++++++++---------------- > 1 file changed, 31 insertions(+), 18 deletions(-) Pushed to master as 5f0dcf22a384af08f1e7d5aafff340f3f808b55b. Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAma4k55fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfUkw//UQeg2EXGmYCVgQVVo7tv4rMENnTpKe4o UGh2Q5xP3ZY03dSV701/irgqIgYpbC9uPM7VCO6g0TEKfD5ZTXsyRXZth2vjVWUG rAS8CZBJ4/byc36nU6kb9my1FicvfFK2zm6LtPQ9QhSsYUJcacdPI7nWnXmSK9z6 qn7ROXebofhvHZQRRyX0M9tiTFen8CyYUYhyrH5q/2vch7YMtXvW+9H6TAzh/2Zk Wvt0oautxgT/z0bZKfrjlmV8xcX0XY5pzoJ41p0qjkrXg6yFa2779SEnPVQWoGhE qrf4qCyHnPP4rq4/PIe2fqofF6AP2zag/1sJlLD3jdcQ6xagAqKmbA2b500snkiZ hWqahmiQh7zGh2M6evkm6XGGZ6DEkgz2LexSpr36GaqLhiSC3SPLOf2ZVyRSDp1i eXAc8Ss/P+3XTwlKTw/+l4GI+Nmbb0Slp0hCmfgqA7hgtEEDR8wvplpIbkhuDBCa DfV5KXikAtnI8ZTY1w8i47O3hI0BQkiUwTw0RmaPeC55RJ5K/j1YU1+cG+eUNUeK maqpe3OLbC7Bxy6Y7mcyrjU3JV37Lm1P7s+W2s0VEkF+YRrHbJLUYKz0I8vYuqwo T60CYY73dHAfVmu3M2fkq6gT75xi6UnZehgprjUoViDp3ozRp5+HPDdd5J012Nlp pesjNjLHyig= =UauB -----END PGP SIGNATURE----- --=-=-=-- From unknown Wed Jun 18 23:08:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 08 Sep 2024 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator