From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AEedEQnqIGLw5AAAgWs5BA (envelope-from ) for ; Thu, 03 Mar 2022 17:17:13 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id sCdqDgnqIGKupwAAauVa8A (envelope-from ) for ; Thu, 03 Mar 2022 17:17:13 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F38B1460B7 for ; Thu, 3 Mar 2022 17:17:12 +0100 (CET) Received: from localhost ([::1]:51292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPo8e-0004FK-5b for larch@yhetil.org; Thu, 03 Mar 2022 11:17:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPo0l-0006xu-VN for guix-patches@gnu.org; Thu, 03 Mar 2022 11:09:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPo0k-00086q-Ca for guix-patches@gnu.org; Thu, 03 Mar 2022 11:09:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nPo0k-0000W2-7n for guix-patches@gnu.org; Thu, 03 Mar 2022 11:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54239] [PATCH 1/5] gnu: Add cross-llvm. References: <20220303170252.3caec0a6@tachikoma.lepiller.eu> In-Reply-To: <20220303170252.3caec0a6@tachikoma.lepiller.eu> Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Mar 2022 16:09: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.16463236861865 (code B ref 54239); Thu, 03 Mar 2022 16:09:02 +0000 Received: (at 54239) by debbugs.gnu.org; 3 Mar 2022 16:08:06 +0000 Received: from localhost ([127.0.0.1]:43496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPnzp-0000Ty-Iv for submit@debbugs.gnu.org; Thu, 03 Mar 2022 11:08:05 -0500 Received: from lepiller.eu ([89.234.186.109]:57046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPnzn-0000Tf-II for 54239@debbugs.gnu.org; Thu, 03 Mar 2022 11:08:04 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id bf5dab87 for <54239@debbugs.gnu.org>; Thu, 3 Mar 2022 16:08:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=dkim; bh=PVbHQsUpe7ZCSCXqtXYm4YfVJ 4XJ1fuE4mRuGe9Iu+g=; b=l+VhyVOqGNtt309u0baHTG45m6fpmG4CAwsv7inMB XfmQAV3XnCeMKpKUDj71gq73YRVWOeUoSIB76Am9i/7IsOlJJcJp9J8sfnD2qZIg 5FqmJNsBGJP7p7WCSXmQ2CRxVVushpPLV8Nhq11FzwxG4EMHUIkG0t87Mkd8F+Bh 2ymz4oeD79floMBrlsM3h6b/+SYNC5S0Sgy56jIM484TSRUZbQO/DoeGZOgj4RUl k4QIpnsyWVkqzMaz4q5RSLd54wNZYg1I0y+ZarPyJFG1B35o7gsxt7G1Q1io7Mcv 3RqRoZPhBTMBWmcl8Ebi88/688+OdVevehYmSGBSYf+0A== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 1a29609d (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <54239@debbugs.gnu.org>; Thu, 3 Mar 2022 16:08:01 +0000 (UTC) From: Julien Lepiller Date: Thu, 3 Mar 2022 17:07:43 +0100 Message-Id: <499e5dba47ef40df93a8b33fbb8e41cc2354e7a1.1646322873.git.julien@lepiller.eu> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646324233; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=AWFeoZmueN6MEALsOM4XXUx91DVJu0bDXeKPKChSlVM=; b=U0bUp6kROg99MSAnsGjqTMqo39lVl7nyO+I1gjml3qDLHKAG6pWNrwgksRl8iTQCfZDkvV v52rq/9mKemH90da1XhXvA+0YY5ajHOtWcDW//KWOaPWdg85nZTDotY/a2p/dxrubGbaHA n5Gz0iN7goYqjf/j61cAOkNAooUJgkZraEtHGyYJZ6+GhMGLFElPLt3lFEjIIyFcBTf6TN YbkML+VzL/EpvM4zakS7UeiY0dq5K60OVMlWyiohsekiUxRY2NAJWJ5UHkaF59S7bC3Ssr NnViqv8UB0KVIwJouIRH/7kUCnV7tmTLelP6ONtZ8PUHyzMhBv+AEmBGPM+L3g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646324233; a=rsa-sha256; cv=none; b=VI3hEwdcuVLCSNvTYrwEMpvmMC6oYrTmKttHQ/pShAY4pvcii6RViJEd9n7qYuOaJyGDau JMW2F6bs/4IerZqx7uc24A3E2jYSbyU8LadxR8L597iQIdyppv4x9VQzC2H2NRvkFbXJKV 8zLRzDQw7k+G/DNx4KNlWCwFNjuyOEn2onDZBFEUD4hCJHnhuSxC7HXkdWRy2zBZPNqux5 eJ05nfyp1Ja1TK3pUq3YcFrRbJvtpBHzG+JxHd2xigtuThyQlQ7UddfAJBT3zV1eo79mgz HhaqYYACSZs7u8spzogFMZ9xdS0Z7xBefWqBZBi9xW44S190y+CYjYuiWzk5YA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=l+VhyVOq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.83 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=l+VhyVOq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: F38B1460B7 X-Spam-Score: 6.83 X-Migadu-Scanner: scn1.migadu.com X-TUID: aj8MICykxHZA * 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 eb949bed1b..d6e9846699 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -18,7 +18,7 @@ ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2020, 2021 Maxim Cournoyer -;;; Copyright © 2021 Julien Lepiller +;;; Copyright © 2021, 2022 Julien Lepiller ;;; Copyright © 2021 Lars-Dominik Braun ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2021 Maxim Cournoyer @@ -74,7 +74,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) @@ -99,6 +100,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. -- 2.34.0