From patchwork Sat Jul 16 19:47:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40698 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 A498B27BBEA; Sat, 16 Jul 2022 20:49:31 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5C35327BBE9 for ; Sat, 16 Jul 2022 20:49:31 +0100 (BST) Received: from localhost ([::1]:46460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnn8-0004S1-Gr for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:49:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmg-0004RF-AT for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmg-0004gj-1H for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmf-0005I6-RH for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 01/10] guix: Add build-system transformation for target. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800089720174 (code B ref 54239); Sat, 16 Jul 2022 19:49:01 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:17 +0000 Received: from localhost ([127.0.0.1]:46140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnlx-0005FJ-7h for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:17 -0400 Received: from lepiller.eu ([89.234.186.109]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnlw-0005FA-68 for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:16 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 0e21e7aa for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=UllCppNbs+GWds9THD4bwnyEh v/3C3ryE7IIEaPFbzQ=; b=JfBPOexddLCP1ckt9ER2ARXmxxeFy86yJ1nDIrP5R q3auVITJolokijV0g/0mEVHi5w+YEp7uNNWW/3vleBCiq4bnZitz0voVIP8+ZwUR ahBcM8E+ipYbaWe+FWeJH3YlX0iW2SKP0nN4LHKnXlbdwByg0UNQzSm8qJZuKDzf celo5oOGbNocS6qlm5fgUGoOT1TWKq9DZhaYPByNwsCghpN42A0nb0Ang4YuzkXN WdncSMYOmlAlL6mSvr/qV5OWBmbc8j55p8whmlEzaS3JeOWxHNZQspGOpX6gvmEK m3KckqjLQUmvPja+JnmhqbnaptYguRMFrW0l/6pdl5nWw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 4b881f23 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:14 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:47:58 +0200 Message-Id: <20220716194807.20378-1-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716214424.1d521d65@sybil.lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> MIME-Version: 1.0 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 * guix/build-system.scm (build-system-with-target): New procedure. --- guix/build-system.scm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/guix/build-system.scm b/guix/build-system.scm index 76d670995c..7d864423e3 100644 --- a/guix/build-system.scm +++ b/guix/build-system.scm @@ -18,6 +18,7 @@ (define-module (guix build-system) #:use-module (guix records) + #:use-module (guix utils) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (build-system @@ -40,7 +41,8 @@ (define-module (guix build-system) make-bag - build-system-with-c-toolchain)) + build-system-with-c-toolchain + build-system-with-target)) (define-record-type* build-system make-build-system build-system? @@ -129,3 +131,20 @@ (define (lower* . args) (build-system (inherit bs) (lower lower*))) + +(define (build-system-with-target bs target) + "Return a variant of @var{bs}, a build system, that user @var{target} instead +of the default target." + (define lower + (build-system-lower bs)) + + (define (lower* . args) + (parameterize ((%current-target-system target)) + (apply lower + (append + (strip-keyword-arguments (list #:target) args) + (list #:target target))))) + + (build-system + (inherit bs) + (lower lower*))) From patchwork Sat Jul 16 19:47:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40700 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 6B29427BBEA; Sat, 16 Jul 2022 20:49:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2737227BBE9 for ; Sat, 16 Jul 2022 20:49:34 +0100 (BST) Received: from localhost ([::1]:46560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnnB-0004Wz-9G for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:49:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmg-0004RO-Kb for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmg-0004gp-Br for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmg-0005ID-8H for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 02/10] gnu: clang-runtime: Fix cross-compilation. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800090220220 (code B ref 54239); Sat, 16 Jul 2022 19:49:02 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:22 +0000 Received: from localhost ([127.0.0.1]:46146 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm1-0005Fr-Jg for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:22 -0400 Received: from lepiller.eu ([89.234.186.109]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnlw-0005FA-Vn for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:17 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 2b8120e4 for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=YM/fqMAPDkp3gwPNQmLw4I+Q5 yWzxOXoQ+w35o3Vc6c=; b=XLOMX2bDyIVF1//J+f9CKD2QljtOCLBPNg4UU+3Cw 0KZoqEme8koDUVZBmEA5WNJOXWnlUNLuV/qNIZRb3EKdNbhKugsacojplJ1Ur1X7 SeQyM+f4DmJeQ+frw/Ve8wDDHwLgIwxPlLPBz8Vw3s4gLCl3as2cVxfatzLZUq75 7/1mJIwGvRlbBCUU8lMAuIpr/OhozW+0JXCLcoDZHpRSR0m78Bzk+CafQFByRGu/ PYDIewEyWSy0sdLiAo7k3lAsqBT6vsjFE6CGNVRiW5J87OrHheCJw0SNk7g4+TwH N8JqHydtbPKR4QAJSbu/94qjYK8hWT3A9wKPVr+NN9LcA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 937e9a23 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:14 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:47:59 +0200 Message-Id: <20220716194807.20378-2-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716194807.20378-1-julien@lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> <20220716194807.20378-1-julien@lepiller.eu> MIME-Version: 1.0 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 (clang-runtime-from-llvm): Sanitie CROSS_CPLUS_INCLUDE_PATH in the same way as CPLUS_INCLUDE_PATH. --- gnu/packages/llvm.scm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 5a2f411eb2..6428391650 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -141,7 +141,7 @@ (define* (clang-runtime-from-llvm llvm ;; Work around https://issues.guix.info/issue/36882. We need to ;; remove glibc from CPLUS_INCLUDE_PATH so that the one hardcoded ;; in GCC, at the bottom of GCC include search-path is used. - (lambda* (#:key inputs #:allow-other-keys) + (lambda* (#:key inputs target #:allow-other-keys) (let* ((filters '("libc")) (input-directories (filter-map (lambda (input) @@ -153,7 +153,20 @@ (define* (clang-runtime-from-llvm llvm (set-path-environment-variable "CPLUS_INCLUDE_PATH" '("include") input-directories) - #t)))))) + (when target + (let ((libc (assoc-ref inputs "cross-libc"))) + (setenv "CROSS_CPLUS_INCLUDE_PATH" + (string-join + (filter + (lambda (path) + (and + (not (equal? path + (string-append libc "/include"))) + (string-suffix? "include" path))) + + (string-split (getenv "CROSS_CPLUS_INCLUDE_PATH") + #\:)) + ":")))))))))) (home-page "https://compiler-rt.llvm.org") (synopsis "Runtime library for Clang/LLVM") (description From patchwork Sat Jul 16 19:48:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40699 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 E982527BBEA; Sat, 16 Jul 2022 20:49:32 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 63ACF27BBE9 for ; Sat, 16 Jul 2022 20:49:32 +0100 (BST) Received: from localhost ([::1]:46470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnn9-0004Sl-Gx for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:49:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmh-0004Ra-4u for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48409) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmg-0004gy-Sj for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmg-0005IL-N9 for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 03/10] gnu: llvm-9: Fix cross-compilation. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800090320228 (code B ref 54239); Sat, 16 Jul 2022 19:49:02 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:23 +0000 Received: from localhost ([127.0.0.1]:46150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm2-0005G5-Ig for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:23 -0400 Received: from lepiller.eu ([89.234.186.109]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnly-0005FA-31 for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:18 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id ad77a655 for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=KoD1RNKaxzM1fEhHOc6zFz8xz 3gonMoy+Vv8TB8cbaI=; b=fDL/7SzlgYeNN8fIpGoIIi7Bd8rRXe21kDoxkJkpy I9ISn9aEAjHFf++aV338aWa8B/AGqJ6k4vlRN2Q0FwmsaTN+Au/fcn33UOZpognj SqcsZWfiZY7FIN477MqkeZMVJhtLEswuHXTQHczRSL7JiPG/JkDg6kRYHLV7kAFE 9XVpRmkY5bdZ8kIXNiunftZLAAYYXDjVAP4vQFqJWHxXoqyiZ4aiZ2lkRCiJbWYI 7B1J8+cmlXiueEEjyQ6vKPm/gIa8Ahf9x1dwe2GeEOnW4GhAQYO6GoUbNXR3ed15 aND3e6eI/ocUE4rDuOrRKEEF+47dX0PmcpQRbAq1eOuGg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id a77d80a1 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:15 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:48:00 +0200 Message-Id: <20220716194807.20378-3-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716194807.20378-1-julien@lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> <20220716194807.20378-1-julien@lepiller.eu> MIME-Version: 1.0 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 `(package-arguments llvm-10)' evaluates `this-package' in the context of llvm-10. `llvm-tblgen' in llvm-10 is not compatible with llvm-9, so copy the configure-flags from llvm-12 to make sure `this-package' is evaluated here. * gnu/packages/llvm.scm (llvm-9)[arguments]: Fix cross-compilation. --- gnu/packages/llvm.scm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 6428391650..2aec2925cf 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -973,7 +973,30 @@ (define-public llvm-9 "if (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES \"riscv64\")\n" " target_link_libraries(dsymutil PRIVATE atomic)\n" "endif()")))))))) - (package-arguments llvm-10))))) + (substitute-keyword-arguments (package-arguments llvm-10) + ((#:configure-flags _) + #~(#$(if (%current-target-system) + #~quasiquote + #~quote) + ;; These options are required for cross-compiling LLVM according to + ;; https://llvm.org/docs/HowToCrossCompileLLVM.html. + (#$@(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)) + #$(string-append "-DLLVM_TARGETS_TO_BUILD=" + (system->llvm-target))) + #~()) + "-DCMAKE_SKIP_BUILD_RPATH=FALSE" + "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE" + "-DBUILD_SHARED_LIBS:BOOL=TRUE" + "-DLLVM_ENABLE_FFI:BOOL=TRUE" + "-DLLVM_REQUIRES_RTTI=1" ; For some third-party utilities + "-DLLVM_INSTALL_UTILS=ON")))))))) ; Needed for rustc. (define-public clang-runtime-9 (clang-runtime-from-llvm From patchwork Sat Jul 16 19:48:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40703 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 6B12727BBEA; Sat, 16 Jul 2022 20:49:50 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2BFE827BBE9 for ; Sat, 16 Jul 2022 20:49:50 +0100 (BST) Received: from localhost ([::1]:47234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnnR-00051g-7m for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:49:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmh-0004Ru-Il for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmh-0004h7-A7 for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmh-0005IS-79 for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 04/10] gnu: Add cross-llvm. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800090420245 (code B ref 54239); Sat, 16 Jul 2022 19:49:03 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:24 +0000 Received: from localhost ([127.0.0.1]:46153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm3-0005GD-6I for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:24 -0400 Received: from lepiller.eu ([89.234.186.109]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnly-0005FA-TA for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:19 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 0d8709dd for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=dWtzY9feH/AB jwloSjZnLjPH7SuK044oYRfbk3Vt0Qo=; b=NAv3zIURnJ3G6/tywqVLqUOZ+FUl PI3G1eq7zo8i5S8iEPUP64myhzL++7F4NYHup26FtJB6z3Hg6q3BuSuZPIJwx4sf h9AsYPLStUJpbwVNGdFegSJH46qVYrGsAI8N8aEo4ySfiAxOVDHEyNccXgL9jtRv 2C0WANvvEeQ53c0hHBGCwIyReKNwmGwx/QgrQJz2oKXjrExapZWpAk3IVK3g6nc5 b+T0ol+t836HsoLsGiSDCaJkhbj+uo7ddp3d7i2sA2nd6HKvm3qr6/sRFZjYmsWW 0fojWlMoUFRI6jG/WtLLtV9kbnEX7WucxIEofZ7KQaXDe8u5zp7do6TAOA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id a1a052f6 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:15 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:48:01 +0200 Message-Id: <20220716194807.20378-4-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716194807.20378-1-julien@lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> <20220716194807.20378-1-julien@lepiller.eu> MIME-Version: 1.0 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 (cross-llvm): New variable. --- gnu/packages/llvm.scm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 2aec2925cf..caf8264bef 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -18,7 +18,7 @@ ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2021, 2022 Maxime Devos ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer -;;; Copyright © 2021 Julien Lepiller +;;; Copyright © 2021, 2022 Julien Lepiller ;;; Copyright © 2021 Lars-Dominik Braun ;;; Copyright © 2021, 2022 Guillaume Le Vaillant ;;; Copyright © 2021 Maxim Cournoyer @@ -76,7 +76,8 @@ (define-module (gnu packages llvm) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (make-lld-wrapper - system->llvm-target)) + system->llvm-target + cross-llvm)) (define* (system->llvm-target #:optional (system (or (and=> (%current-target-system) @@ -101,6 +102,22 @@ (define* (system->llvm-target #:optional ("i686" => "X86") ("i586" => "X86")))) +(define (cross-llvm llvm target) + "Return a native LLVM package that targets a different system. The resulting +libraries are running on the host but target a different system by default. +This packge can be used to control clang's default target." + (package + (inherit llvm) + (arguments + (substitute-keyword-arguments (package-arguments llvm) + ((#:configure-flags flags) + #~(append + (list + (string-append "-DLLVM_DEFAULT_TARGET_TRIPLE=" #$target) + (string-append "-DLLVM_TARGET_ARCH=" + #$(system->llvm-target (gnu-triplet->nix-system target)))) + #$flags)))))) + (define (llvm-uri component version) ;; LLVM release candidate file names are formatted 'tool-A.B.C-rcN/tool-A.B.CrcN.src.tar.xz' ;; so we specify the version as A.B.C-rcN and delete the hyphen when referencing the file name. From patchwork Sat Jul 16 19:48:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40701 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 0811227BBEA; Sat, 16 Jul 2022 20:49:40 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 58E7827BBE9 for ; Sat, 16 Jul 2022 20:49:39 +0100 (BST) Received: from localhost ([::1]:46808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnnG-0004hs-4p for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:49:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmh-0004S4-Uh for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmh-0004hH-ME for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmh-0005Ia-JI for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 05/10] gnu: Add cross-clang. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800090820262 (code B ref 54239); Sat, 16 Jul 2022 19:49:03 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:28 +0000 Received: from localhost ([127.0.0.1]:46156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm8-0005Gj-4B for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:28 -0400 Received: from lepiller.eu ([89.234.186.109]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm0-0005FA-4X for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:20 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 589f4353 for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=gu/GSsog9cnoOWIdK3cc/4FLU mRGzDzVvFok2bQBKJ4=; b=aZ4pGPM7F61dW4FmOZgPBX5d7oKhMR1aqY6Cca7Qa U0O6MuVn1+9JjbIfI8TuzPiGLibvcJToKEoFDKfOHjUY6XRsIoifdBWp6y0JNnDl GiGxZcmimHxmgYsybz+Wa4eod8ZtTDdPy3IkEroKV2tvVw+aL9CuluXbZPR/niOs uz0l1qedw8iiP2EOCiCac/Vssu9VYoMw646jMjatd8/l6SyCk/r90NiAAPrZWzwS DoW5PYyeagFv63KhWEfN/5jZz5b/1CPrYKFjWVOog4rDz8gvYpKsrJiOajhWhr2e HRosky5xu/mz5oHRQMPxxatpUAzkGzbouOPtOmvy6YXbg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 63d3854f (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:15 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:48:02 +0200 Message-Id: <20220716194807.20378-5-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716194807.20378-1-julien@lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> <20220716194807.20378-1-julien@lepiller.eu> MIME-Version: 1.0 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 (cross-clang): New variable. --- gnu/packages/llvm.scm | 169 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 168 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index caf8264bef..560a64840a 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -48,6 +48,7 @@ (define-module (gnu packages llvm) #:use-module (guix git-download) #:use-module (guix memoization) #:use-module (guix utils) + #:use-module (guix build-system) #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) #:use-module (guix build-system emacs) @@ -75,9 +76,12 @@ (define-module (gnu packages llvm) #:use-module (gnu packages xml) #:use-module (srfi srfi-1) #:use-module (ice-9 match) + #:autoload (gnu packages cross-base) (cross-libc cross-gcc cross-binutils) #:export (make-lld-wrapper system->llvm-target - cross-llvm)) + cross-llvm + cross-clang + clang-for-target)) (define* (system->llvm-target #:optional (system (or (and=> (%current-target-system) @@ -1263,6 +1267,169 @@ (define-public clang-runtime clang-runtime-13) (define-public clang clang-13) (define-public clang-toolchain clang-toolchain-13) +(define* (cross-clang target + #:key + (libc (cross-libc target)) + (xgcc (cross-gcc target + #:xbinutils (cross-binutils target) + #:libc (cross-libc target))) + (clang clang)) + "Return a cross-clang compiler for target." + (define cross-clang-aux + (mlambda (target libc xgcc clang) + (package + (inherit clang) + (name (string-append "clang-cross-" target)) + (version (package-version clang)) + ;; Support the same variables as clang, even in cross-compilation context. + ;; Clang does not make a difference between native and cross-compilation. + (search-paths + (list + (search-path-specification + (variable "CROSS_LIBRARY_PATH") + (files '("lib"))) + (search-path-specification + (variable "CROSS_C_INCLUDE_PATH") + (files '("include"))) + (search-path-specification + (variable "CROSS_CPLUS_INCLUDE_PATH") + (files '("include/c++" "include"))))) + (native-search-paths '()) + (arguments + (substitute-keyword-arguments (package-arguments clang) + ((#:configure-flags _) + #~(list "-DCLANG_INCLUDE_TESTS=True" + (string-append "-DGCC_INSTALL_PREFIX=" + (assoc-ref %build-inputs "cross-gcc-lib")) + (string-append "-DC_INCLUDE_DIRS=" + (assoc-ref %build-inputs "target-libc") + "/include"))) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'add-missing-libdir + (lambda _ + ;; cross-gcc installs its libraries in /lib instead of + ;; lib. + (substitute* "lib/Driver/ToolChain.cpp" + (("\"-L\"\\) \\+ LibPath\\)\\);") + ,(string-append "\"-L\") + LibPath)); + CmdArgs.push_back(Args.MakeArgString(StringRef(\"-L\") + " + "StringRef(GCC_INSTALL_PREFIX) + StringRef(\"/" + target "/lib\"))); + CmdArgs.push_back(Args.MakeArgString(StringRef(\"-rpath=\") + " + "StringRef(GCC_INSTALL_PREFIX) + StringRef(\"/" + target "/lib\")));"))))) + (add-after 'unpack 'support-cross-include-path + (lambda _ + (substitute* ,(if (version>=? version "6.0") + "lib/Driver/ToolChains/Clang.cpp" + "lib/Driver/Tools.cpp") + (("C_INCLUDE_PATH") "CROSS_C_INCLUDE_PATH") + (("CPLUS_INCLUDE_PATH") "CROSS_CPLUS_INCLUDE_PATH")))) + (add-after 'unpack 'support-cross-library-path + (lambda _ + ;; LIBRARY_PATH is only supported for native builds, but we still + ;; need it (or CROSS_LIBRARY_PATH to be precise) when + ;; cross-compiling + ,(cond + ((version>=? version "10") + `(substitute* "lib/Driver/ToolChains/CommonArgs.cpp" + (("LIBRARY_PATH\"") + "LIBRARY_PATH\"); + else + addDirectoryList(Args, CmdArgs, \"-L\", \"CROSS_LIBRARY_PATH\""))) + ((version>=? version "6.0") + `(substitute* "lib/Driver/ToolChains/CommonArgs.cpp" + (("LIBRARY_PATH\"") + "LIBRARY_PATH\"); + } else { + addDirectoryList(Args, CmdArgs, \"-L\", \"CROSS_LIBRARY_PATH\""))) + (else + `(substitute* "lib/Driver/Tools.cpp" + (("LIBRARY_PATH\"") + "LIBRARY_PATH\"); + else + addDirectoryList(Args, CmdArgs, \"-L\", \"CROSS_LIBRARY_PATH\"")))))) + (replace 'set-glibc-file-names + (lambda* (#:key inputs #:allow-other-keys) + (let ((libc (assoc-ref inputs "target-libc")) + (compiler-rt (assoc-ref inputs "clang-runtime")) + (gcc (assoc-ref inputs "cross-gcc"))) + (setenv "LIBRARY_PATH" + (string-append + (assoc-ref inputs "libc") "/lib:" (getenv "LIBRARY_PATH"))) + ,@(cond + ((version>=? version "6.0") + `(;; Link to libclang_rt files from clang-runtime. + (substitute* "lib/Driver/ToolChain.cpp" + (("getDriver\\(\\)\\.ResourceDir") + (string-append "\"" compiler-rt "\""))) + + ;; Make "LibDir" refer to /lib so that it + ;; uses the right dynamic linker file name. + (substitute* "lib/Driver/ToolChains/Linux.cpp" + (("(^[[:blank:]]+LibDir = ).*" _ declaration) + (string-append declaration "\"" libc "/lib\";\n")) + + ;; Make clang look for libstdc++ in the right + ;; location. + (("LibStdCXXIncludePathCandidates\\[\\] = \\{") + (string-append + "LibStdCXXIncludePathCandidates[] = { \"" gcc + "/include/c++\",")) + + ;; Make sure libc's libdir is on the search path, to + ;; allow crt1.o & co. to be found. + (("@GLIBC_LIBDIR@") + (string-append libc "/lib"))))) + (else + `((substitute* "lib/Driver/Tools.cpp" + ;; Patch the 'getLinuxDynamicLinker' function so that + ;; it uses the right dynamic linker file name. + (("/lib64/ld-linux-x86-64.so.2") + (string-append libc ,(glibc-dynamic-linker)))) + + ;; Link to libclang_rt files from clang-runtime. + ;; This substitution needed slight adjustment in 3.8. + ,@(if (version>=? version "3.8") + '((substitute* "lib/Driver/Tools.cpp" + (("TC\\.getDriver\\(\\)\\.ResourceDir") + (string-append "\"" compiler-rt "\"")))) + '((substitute* "lib/Driver/ToolChain.cpp" + (("getDriver\\(\\)\\.ResourceDir") + (string-append "\"" compiler-rt "\""))))) + + ;; Make sure libc's libdir is on the search path, to + ;; allow crt1.o & co. to be found. + (substitute* "lib/Driver/ToolChains.cpp" + (("@GLIBC_LIBDIR@") + (string-append libc "/lib"))))))))))))) + (inputs + `(("target-libc" ,libc) + ("cross-gcc-lib" ,xgcc "lib") + ("cross-gcc" ,xgcc) + ,@(package-inputs clang))) + (propagated-inputs + (modify-inputs (package-propagated-inputs clang) + (replace "clang-runtime" + (let ((base (car (assoc-ref (package-propagated-inputs clang) + "clang-runtime")))) + (package + (inherit base) + (build-system (build-system-with-target + (package-build-system base) + target))))) + (replace "llvm" + (cross-llvm + (car (assoc-ref (package-propagated-inputs clang) "llvm")) + target))))))) + (cross-clang-aux target libc xgcc clang)) + +(define* (clang-for-target #:optional (clang clang)) + (if (%current-target-system) + (cross-clang (%current-target-system) #:clang clang) + clang)) + (define-public llvm-for-rocm (package ;; Based on LLVM 14 as of v5.0.0 From patchwork Sat Jul 16 19:48:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40705 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 1E78E27BBE9; Sat, 16 Jul 2022 20:49:59 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6FCE927BBEA for ; Sat, 16 Jul 2022 20:49:58 +0100 (BST) Received: from localhost ([::1]:48054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnnZ-0005Zr-JB for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:49:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmi-0004Sg-9y for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmi-0004hN-1M for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmh-0005Ij-Uo for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 06/10] gnu: libcxx: Allow cross-compilation. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800090920271 (code B ref 54239); Sat, 16 Jul 2022 19:49:03 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:29 +0000 Received: from localhost ([127.0.0.1]:46158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm8-0005Gl-Pe for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:29 -0400 Received: from lepiller.eu ([89.234.186.109]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm1-0005FA-63 for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:21 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 812f015b for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=G3jcVycy0vGeJBNWsb6LGcvjj ERs83OKtMIoLrz9epM=; b=GoFbo085Af14KxrNWXVRvmORNtKADD80YdXabYlXy cbdt7MI/lN39QHLvBOM/nkjkbTv6qyTCCBIZioz2fxzSb6L0+uxH/zGt0AHfMVmK MW2mKsiAi0bpURmYoTLT4S5VhAy6zJHwxpDIyBFnlgzYXVAeLh+a6zAD4ssIbyrm 04VSjTIPECN+4mfhJ+bNDamYUlXcDam88sKkWkKJg9cv2kj2bapri/SSKD4MYuju VQDwrjXqqatb8uc2IDsaVu3W7UrZSkiSuiyRMGlgerfgLp3VxlYf237C1WDNvejA wl13kmjMuY7wN3k1xjQIKsH6aVFMCWimSxg5Y1YYbgRug== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 7ea7132d (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:15 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:48:03 +0200 Message-Id: <20220716194807.20378-6-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716194807.20378-1-julien@lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> <20220716194807.20378-1-julien@lepiller.eu> MIME-Version: 1.0 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 (libcxx)[native-inputs]: Move llvm to... [inputs]: ...here. [arguments]: adjust CROSS_INCLUDE_PATH when cross-compiling. (libcxx-6)[native-inputs]: Move llvm to... [inputs]: ...here. --- gnu/packages/llvm.scm | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 560a64840a..96620f1c3c 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1640,8 +1640,9 @@ (define-public libcxx `(#:phases (modify-phases (@ (guix build cmake-build-system) %standard-phases) (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH - (lambda* (#:key inputs #:allow-other-keys) - (let ((gcc (assoc-ref inputs "gcc"))) + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (let ((gcc (or (assoc-ref (or native-inputs inputs) "gcc"))) + (cross-gcc (assoc-ref native-inputs "cross-gcc"))) ;; Hide GCC's C++ headers so that they do not interfere with ;; the ones we are attempting to build. (setenv "CPLUS_INCLUDE_PATH" @@ -1649,12 +1650,19 @@ (define-public libcxx (string-split (getenv "CPLUS_INCLUDE_PATH") #\:)) ":")) + (when cross-gcc + (setenv "CROSS_CPLUS_INCLUDE_PATH" + (string-join (delete (string-append cross-gcc "/include/c++") + (string-split (getenv "CROSS_CPLUS_INCLUDE_PATH") + #\:)) + ":")) + (format #t + "environment variable `CROSS_CPLUS_INCLUDE_PATH' changed to ~a~%" + (getenv "CROSS_CPLUS_INCLUDE_PATH"))) (format #t "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" - (getenv "CPLUS_INCLUDE_PATH")) - #t)))))) - (native-inputs - (list clang llvm)) + (getenv "CPLUS_INCLUDE_PATH")))))))) + (inputs (list llvm-9)) (home-page "https://libcxx.llvm.org") (synopsis "C++ standard library") (description @@ -1675,8 +1683,7 @@ (define-public libcxx-6 (sha256 (base32 "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n")))) - (native-inputs - (list clang-6 llvm-6)))) + (inputs (list llvm-6)))) (define-public libcxxabi-6 (package From patchwork Sat Jul 16 19:48:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40704 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 5791227BBEA; Sat, 16 Jul 2022 20:49:52 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C83E227BBE9 for ; Sat, 16 Jul 2022 20:49:51 +0100 (BST) Received: from localhost ([::1]:47414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnnS-00058t-Sz for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:49:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmi-0004TV-Kn for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmi-0004hV-Cn for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmi-0005Iq-9P for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 07/10] gnu: libcxxabi-6: Allow cross-compilation. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800090920278 (code B ref 54239); Sat, 16 Jul 2022 19:49:04 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:29 +0000 Received: from localhost ([127.0.0.1]:46160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm9-0005Gv-7A for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:29 -0400 Received: from lepiller.eu ([89.234.186.109]:44376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm1-0005Fm-DA for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:22 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id bdcab96b for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=tmTdqCzPUDQJb0VLnDMCi1uez EB9cyEs8fV2/sGhCLE=; b=BqizJ4aDuwbDLJZJPOIA2mozMeeq7cyHzAEQeTZKm zp+RGd+/UBQKd3cZausaV7pDcwGYKHyd/z/8uma7N91y35FnAL4g0wBhjM6n5YwP BgWy9bx1dikdr6/kVyg00n3vC7aW8+XLPOsl0IzBQXLnSf4Xt5vfITHAQaDCASiY XrhHNp/0wxijV39V/4HSoLeq3uq3VeeagVHPxWp4+hp3/Y6u8TVdGmStwL7vH7DY +LrGLd/gh4ivI+aOksOEH1ZPaupnvoaN9n3rc3n75B/zT1Mx+AFZLGX/EJQsckiZ DRm38G9hPDdb20CTcER4sFJ/rLiOie9GnpT5K+Glj2O0g== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 1093e686 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:16 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:48:04 +0200 Message-Id: <20220716194807.20378-7-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716194807.20378-1-julien@lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> <20220716194807.20378-1-julien@lepiller.eu> MIME-Version: 1.0 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 (libcxxabi-6)[native-inputs]: Use clang-for-target for cross-compilation. Move llvm and libcxx to... [inputs]: ...here. [arguments]: Also adjust CROSS_CPLUS_INCLUDE_PATH when necessary. --- gnu/packages/llvm.scm | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 96620f1c3c..ba48897c8b 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1711,19 +1711,43 @@ (define-public libcxxabi-6 (modify-phases (@ (guix build cmake-build-system) %standard-phases) (add-after 'unpack 'chdir (lambda _ (chdir "libcxxabi"))) - (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH - (lambda* (#:key inputs #:allow-other-keys) - (let ((gcc (assoc-ref inputs "gcc"))) + (add-after 'unpack 'adjust-CPLUS_INCLUDE_PATH + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (define (delete* what lst) + (if (null? what) + lst + (delete* (cdr what) (delete (car what) lst)))) + + (let ((gcc (or (assoc-ref inputs "gcc") (assoc-ref native-inputs "gcc"))) + (cross-gcc (assoc-ref native-inputs "cross-gcc"))) ;; Hide GCC's C++ headers so that they do not interfere with ;; the ones we are attempting to build. (setenv "CPLUS_INCLUDE_PATH" (string-join (cons (string-append (assoc-ref inputs "libcxx") "/include/c++/v1") - (delete (string-append gcc "/include/c++") - (string-split (getenv "CPLUS_INCLUDE_PATH") - #\:))) + (delete* + `(,(string-append gcc "/include/c++") + ,@(if cross-gcc + `(,(string-append cross-gcc "/include/c++")) + '())) + (string-split (getenv "CPLUS_INCLUDE_PATH") + #\:))) ":")) + (when cross-gcc + (setenv "CROSS_CPLUS_INCLUDE_PATH" + (string-join + (cons (string-append + (assoc-ref inputs "libcxx") "/include/c++/v1") + (delete* + (list (string-append cross-gcc "/include/c++") + (string-append gcc "/include/c++")) + (string-split (getenv "CROSS_CPLUS_INCLUDE_PATH") + #\:))) + ":")) + (format #true + "environment variable `CROSS_CPLUS_INCLUDE_PATH' changed to ~a~%" + (getenv "CROSS_CPLUS_INCLUDE_PATH"))) (format #true "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" (getenv "CPLUS_INCLUDE_PATH"))))) @@ -1733,8 +1757,8 @@ (define-public libcxxabi-6 (assoc-ref outputs "out") "/include"))) (install-file "../libcxxabi/include/__cxxabi_config.h" include-dir) (install-file "../libcxxabi/include/cxxabi.h" include-dir))))))) - (native-inputs - (list clang-6 llvm-6 libcxx-6)) + (inputs (list llvm-6 libcxx-6)) + (native-inputs (list (clang-for-target clang-6))) (home-page "https://libcxxabi.llvm.org") (synopsis "C++ standard library support") (description From patchwork Sat Jul 16 19:48:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40707 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 3553127BBEA; Sat, 16 Jul 2022 20:50:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4A07327BBE9 for ; Sat, 16 Jul 2022 20:50:12 +0100 (BST) Received: from localhost ([::1]:48522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnnl-0005tE-Vc for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:50:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmj-0004Ud-0i for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48414) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmi-0004hf-O4 for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmi-0005Ix-KT for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 08/10] gnu: Add libcxxabi-9. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800091020286 (code B ref 54239); Sat, 16 Jul 2022 19:49:04 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:30 +0000 Received: from localhost ([127.0.0.1]:46162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm9-0005H1-LP for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:30 -0400 Received: from lepiller.eu ([89.234.186.109]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm2-0005FA-31 for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:23 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 4feec0cf for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=mfBifTFxJgElbejpd2Lyi6Rxs 0GYMbhtAP5htYpiVBM=; b=Bba6IFL35zc2nLeMHMA4IjtXjavhL1LXv8ONvrGbd IjFuNtlbODMSooQD5STK/XyFU3DTN1xCtjPpb3A0IizZUaQbb8Q4QciBZO7hPkBP c8CLUqsVGOd7IlqqD03f8dCYdBmuL5UTAZR68eIpqp8YgKiCvK8jjn/qdjow+DKk jDpr61X6zDfwc1IewrU7CaHeYSyLvbe+MQVR1Dbza/EzwGitnVqaEKwkt3BqzEcr Q56s/sqxHTQNKZR0EyzLKXfQM6iS67XNTF6vEgKE8AI3Lrc+QTqMQjYn3yIpNmBg dqdpvsXoW7Pl62KZD4tmxjgQTmo5T3vaP7Wu31i7RszVA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 39397325 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:16 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:48:05 +0200 Message-Id: <20220716194807.20378-8-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716194807.20378-1-julien@lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> <20220716194807.20378-1-julien@lepiller.eu> MIME-Version: 1.0 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 (libcxxabi-9): New variable. (libcxxabi-6): Inherit from it. --- gnu/packages/llvm.scm | 66 +++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index ba48897c8b..77c3ab73e0 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1685,20 +1685,17 @@ (define-public libcxx-6 "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n")))) (inputs (list llvm-6)))) -(define-public libcxxabi-6 +(define-public libcxxabi-9 (package (name "libcxxabi") - (version "6.0.1") + (version (package-version clang-9)) (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/llvm/llvm-project") - (commit (string-append "llvmorg-" version)))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (llvm-uri "libcxxabi" version)) (sha256 (base32 - "0ki6796b5z08kh3a3rbysr5wwb2dkl6wal5dzd03i4li5xfkvx1g")))) + "1b4aiaa8cirx52vk2p5kfk57qmbqf1ipb4nqnjhdgqps9jm7iyg8")))) (build-system cmake-build-system) (arguments `(#:configure-flags @@ -1709,8 +1706,6 @@ (define-public libcxxabi-6 "-DCMAKE_CXX_COMPILER=clang++") #:phases (modify-phases (@ (guix build cmake-build-system) %standard-phases) - (add-after 'unpack 'chdir - (lambda _ (chdir "libcxxabi"))) (add-after 'unpack 'adjust-CPLUS_INCLUDE_PATH (lambda* (#:key inputs native-inputs #:allow-other-keys) (define (delete* what lst) @@ -1744,10 +1739,10 @@ (define (delete* what lst) (string-append gcc "/include/c++")) (string-split (getenv "CROSS_CPLUS_INCLUDE_PATH") #\:))) - ":")) - (format #true - "environment variable `CROSS_CPLUS_INCLUDE_PATH' changed to ~a~%" - (getenv "CROSS_CPLUS_INCLUDE_PATH"))) + ":"))) + (format #true + "environment variable `CROSS_CPLUS_INCLUDE_PATH' changed to ~a~%" + (getenv "CROSS_CPLUS_INCLUDE_PATH")) (format #true "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" (getenv "CPLUS_INCLUDE_PATH"))))) @@ -1755,10 +1750,15 @@ (define (delete* what lst) (lambda* (#:key outputs #:allow-other-keys) (let ((include-dir (string-append (assoc-ref outputs "out") "/include"))) - (install-file "../libcxxabi/include/__cxxabi_config.h" include-dir) - (install-file "../libcxxabi/include/cxxabi.h" include-dir))))))) - (inputs (list llvm-6 libcxx-6)) - (native-inputs (list (clang-for-target clang-6))) + (mkdir-p include-dir) + (install-file ,(string-append "../libcxxabi-" version + ".src/include/__cxxabi_config.h") + include-dir) + (install-file ,(string-append "../libcxxabi-" version + ".src/include/cxxabi.h") + include-dir))))))) + (inputs (list llvm-9 libcxx)) + (native-inputs (list (clang-for-target clang-9))) (home-page "https://libcxxabi.llvm.org") (synopsis "C++ standard library support") (description @@ -1766,6 +1766,36 @@ (define (delete* what lst) standard C++ library.") (license license:expat))) +(define-public libcxxabi-6 + (package + (inherit libcxxabi-9) + (name "libcxxabi") + (version "6.0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/llvm/llvm-project") + (commit (string-append "llvmorg-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0ki6796b5z08kh3a3rbysr5wwb2dkl6wal5dzd03i4li5xfkvx1g")))) + (arguments + (substitute-keyword-arguments (package-arguments libcxxabi-9) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'chdir + (lambda _ (chdir "libcxxabi"))) + (replace 'install-headers + (lambda* (#:key outputs #:allow-other-keys) + (let ((include-dir (string-append + (assoc-ref outputs "out") "/include"))) + (install-file "../libcxxabi/include/__cxxabi_config.h" include-dir) + (install-file "../libcxxabi/include/cxxabi.h" include-dir)))))))) + (inputs (list llvm-6 libcxx-6)) + (native-inputs (list (clang-for-target clang-6))))) + (define-public libcxx+libcxxabi-6 (package (inherit libcxx-6) From patchwork Sat Jul 16 19:48:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40706 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 055BC27BBEA; Sat, 16 Jul 2022 20:50:00 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8754327BBE9 for ; Sat, 16 Jul 2022 20:49:59 +0100 (BST) Received: from localhost ([::1]:48130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnna-0005d3-NP for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:49:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmj-0004Vi-Be for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmj-0004hm-3G for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmi-0005J5-Vi for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 09/10] gnu: Add libcxx-12. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800091020293 (code B ref 54239); Sat, 16 Jul 2022 19:49:04 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:30 +0000 Received: from localhost ([127.0.0.1]:46164 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnmA-0005H8-4k for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:30 -0400 Received: from lepiller.eu ([89.234.186.109]:44376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm2-0005Fm-FP for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:23 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 6eae8e7b for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=FVdHfJ9MBhs3/qy1ujtx57Y5r EJiwutzazhCYAq/PHM=; b=FBpCgbLwNZ5Eo77ePvNcDwlXjrGQLzE699qvHUm8l 4buqZNsSs8sdxD52f53HUV4yNYcPjoONRnj7SnTKnQosfyo6+gK0xxm/RWf+fxN/ Hb4Sw2wtTLzPtI+Hm9XjROCPsYtFa9OWrP+RY84TKgWFQQ+ZU7f6WmzA7j7/uj69 /9hQWd+APgM94P3peIj3/qF5x6hODanTo7wQFTqf1g0ONFygqCxnirE0zD+bJsna lUBUtWiHwIJZ9huZ4mT/7rTxn0MHAgLV5t9hdFJPe4/Xgvjvud5nU/j3rrx5xb5i h79vi2+5JywDslD4Hd7H5GFhk445jGTx5eE9lqibuqqcg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 3885e5ed (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:16 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:48:06 +0200 Message-Id: <20220716194807.20378-9-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716194807.20378-1-julien@lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> <20220716194807.20378-1-julien@lepiller.eu> MIME-Version: 1.0 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 (libcxx): Rename to... (libcxx-9): ...this. (libcxx-12): New variable. --- gnu/packages/llvm.scm | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 77c3ab73e0..4f0b57a990 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1624,21 +1624,24 @@ (define-public lldb (properties `((release-monitoring-url . ,%llvm-release-monitoring-url))) (license license:asl2.0))) ;with LLVM exceptions -(define-public libcxx +(define-public libcxx-12 (package (name "libcxx") - (version "9.0.1") + (version (package-version llvm-12)) (source (origin (method url-fetch) - (uri (llvm-uri "libcxx" version)) + (uri (llvm-uri "llvm-project" version)) (sha256 (base32 - "0d2bj5i6mk4caq7skd5nsdmz8c2m5w5anximl5wz3x32p08zz089")))) + "03ps7akvbkxxa4xzal49v7lw3bz41zmjsp6fa7cslxrns5fb570j")))) (build-system cmake-build-system) (arguments `(#:phases (modify-phases (@ (guix build cmake-build-system) %standard-phases) + (add-after 'unpack 'chdir + (lambda _ + (chdir "libcxx"))) (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH (lambda* (#:key inputs native-inputs #:allow-other-keys) (let ((gcc (or (assoc-ref (or native-inputs inputs) "gcc"))) @@ -1662,7 +1665,8 @@ (define-public libcxx (format #t "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%" (getenv "CPLUS_INCLUDE_PATH")))))))) - (inputs (list llvm-9)) + (inputs (list llvm-12)) + (native-inputs (list python)) (home-page "https://libcxx.llvm.org") (synopsis "C++ standard library") (description @@ -1671,14 +1675,32 @@ (define-public libcxx (properties `((release-monitoring-url . ,%llvm-release-monitoring-url))) (license license:expat))) +(define-public libcxx-9 + (package + (inherit libcxx-12) + (version (package-version llvm-9)) + (source + (origin + (method url-fetch) + (uri (llvm-uri "libcxx" version)) + (sha256 + (base32 + "0d2bj5i6mk4caq7skd5nsdmz8c2m5w5anximl5wz3x32p08zz089")))) + (arguments + (substitute-keyword-arguments (package-arguments libcxx-12) + ((#:phases phases) + `(modify-phases ,phases + (delete 'chdir))))) + (inputs (list llvm-9)))) + ;; Libcxx files specifically used by PySide2. (define-public libcxx-6 (package - (inherit libcxx) + (inherit libcxx-9) (version (package-version llvm-6)) (source (origin - (inherit (package-source libcxx)) + (inherit (package-source libcxx-9)) (uri (llvm-uri "libcxx" version)) (sha256 (base32 @@ -1757,7 +1779,7 @@ (define (delete* what lst) (install-file ,(string-append "../libcxxabi-" version ".src/include/cxxabi.h") include-dir))))))) - (inputs (list llvm-9 libcxx)) + (inputs (list llvm-9 libcxx-9)) (native-inputs (list (clang-for-target clang-9))) (home-page "https://libcxxabi.llvm.org") (synopsis "C++ standard library support") From patchwork Sat Jul 16 19:48:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 40702 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 CDBDD27BBEA; Sat, 16 Jul 2022 20:49:49 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4DEDC27BBE9 for ; Sat, 16 Jul 2022 20:49:49 +0100 (BST) Received: from localhost ([::1]:47186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCnnQ-000500-EJ for patchwork@mira.cbaines.net; Sat, 16 Jul 2022 15:49:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCnmj-0004X0-O6 for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCnmj-0004hw-Dx for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCnmj-0005JC-AB for guix-patches@gnu.org; Sat, 16 Jul 2022 15:49:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH v3 10/10] gnu: Add libcxxabi-12. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jul 2022 19:49:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54239 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54239@debbugs.gnu.org Received: via spool by 54239-submit@debbugs.gnu.org id=B54239.165800091120299 (code B ref 54239); Sat, 16 Jul 2022 19:49:05 +0000 Received: (at 54239) by debbugs.gnu.org; 16 Jul 2022 19:48:31 +0000 Received: from localhost ([127.0.0.1]:46166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnmA-0005HG-KV for submit@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:31 -0400 Received: from lepiller.eu ([89.234.186.109]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCnm3-0005FA-I2 for 54239@debbugs.gnu.org; Sat, 16 Jul 2022 15:48:24 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id a5259a7c for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=jb/y/m0ttQEhHD30+NAaXqVkB ff9mHSQFebkZj3l27w=; b=fcLliNHZfyAFykv+P8XyBrAMFhZsadqn8ER6LK28m AiakNQh2dCZIoKE4P5A0yF5UMGsqePsn2SZ7UWUV1qHdbWEp9gS8FvgF7nOB5RJn wv4XDGIEMWHgybCv8Gs8tk9fRo5JjM4SrqEuEoetvLbIOiptNr9ByATbhwIUheAL vCBJi+EnWGXqVIS+nupQvdydqE4aPYCHJSndO37lUE4UBPzvpjX54rJvhtB522zJ sKazehWNG+SykcokIERn7vLNGVF/D3sFGzEIgRL+kr2oipjbee3fE+dnXBrGyDhS hCd32gfDUSaBj2Tv9qmH69yJ0pbEw5ARp+ccXlXFh+GQQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id e57c4f88 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Sat, 16 Jul 2022 19:48:16 +0000 (UTC) From: Julien Lepiller Date: Sat, 16 Jul 2022 21:48:07 +0200 Message-Id: <20220716194807.20378-10-julien@lepiller.eu> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220716194807.20378-1-julien@lepiller.eu> References: <20220716214424.1d521d65@sybil.lepiller.eu> <20220716194807.20378-1-julien@lepiller.eu> MIME-Version: 1.0 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 (libcxxabi-12): New variable. (libcxxabi-9): Inherit from it. --- gnu/packages/llvm.scm | 53 +++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 4f0b57a990..72fef43a5f 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -1707,17 +1707,17 @@ (define-public libcxx-6 "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n")))) (inputs (list llvm-6)))) -(define-public libcxxabi-9 +(define-public libcxxabi-12 (package (name "libcxxabi") - (version (package-version clang-9)) + (version (package-version clang-12)) (source (origin (method url-fetch) - (uri (llvm-uri "libcxxabi" version)) + (uri (llvm-uri "llvm-project" version)) (sha256 (base32 - "1b4aiaa8cirx52vk2p5kfk57qmbqf1ipb4nqnjhdgqps9jm7iyg8")))) + "03ps7akvbkxxa4xzal49v7lw3bz41zmjsp6fa7cslxrns5fb570j")))) (build-system cmake-build-system) (arguments `(#:configure-flags @@ -1728,6 +1728,9 @@ (define-public libcxxabi-9 "-DCMAKE_CXX_COMPILER=clang++") #:phases (modify-phases (@ (guix build cmake-build-system) %standard-phases) + (add-after 'unpack 'chdir + (lambda _ + (chdir "libcxxabi"))) (add-after 'unpack 'adjust-CPLUS_INCLUDE_PATH (lambda* (#:key inputs native-inputs #:allow-other-keys) (define (delete* what lst) @@ -1773,14 +1776,10 @@ (define (delete* what lst) (let ((include-dir (string-append (assoc-ref outputs "out") "/include"))) (mkdir-p include-dir) - (install-file ,(string-append "../libcxxabi-" version - ".src/include/__cxxabi_config.h") - include-dir) - (install-file ,(string-append "../libcxxabi-" version - ".src/include/cxxabi.h") - include-dir))))))) - (inputs (list llvm-9 libcxx-9)) - (native-inputs (list (clang-for-target clang-9))) + (install-file "../libcxxabi/include/__cxxabi_config.h" include-dir) + (install-file "../libcxxabi/include/cxxabi.h" include-dir))))))) + (inputs (list llvm-12 libcxx-12)) + (native-inputs (list (clang-for-target clang-12) python)) (home-page "https://libcxxabi.llvm.org") (synopsis "C++ standard library support") (description @@ -1788,6 +1787,36 @@ (define (delete* what lst) standard C++ library.") (license license:expat))) +(define-public libcxxabi-9 + (package + (inherit libcxxabi-12) + (version (package-version clang-9)) + (source + (origin + (method url-fetch) + (uri (llvm-uri "libcxxabi" version)) + (sha256 + (base32 + "1b4aiaa8cirx52vk2p5kfk57qmbqf1ipb4nqnjhdgqps9jm7iyg8")))) + (arguments + (substitute-keyword-arguments (package-arguments libcxxabi-12) + ((#:phases phases) + `(modify-phases ,phases + (delete 'chdir) + (replace 'install-headers + (lambda* (#:key outputs #:allow-other-keys) + (let ((include-dir (string-append + (assoc-ref outputs "out") "/include"))) + (mkdir-p include-dir) + (install-file ,(string-append "../libcxxabi-" version + ".src/include/__cxxabi_config.h") + include-dir) + (install-file ,(string-append "../libcxxabi-" version + ".src/include/cxxabi.h") + include-dir)))))))) + (inputs (list llvm-9 libcxx-9)) + (native-inputs (list (clang-for-target clang-9))))) + (define-public libcxxabi-6 (package (inherit libcxxabi-9)