From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id k2WcLFLaGGRhawAASxT56A (envelope-from ) for ; Mon, 20 Mar 2023 23:12:34 +0100 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YMWQK1LaGGQQUgEAauVa8A (envelope-from ) for ; Mon, 20 Mar 2023 23:12:34 +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 aspmx2.migadu.com (Postfix) with ESMTPS id 67C803950C for ; Mon, 20 Mar 2023 23:12:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peNjZ-0003m9-IR; Mon, 20 Mar 2023 18:12:05 -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 1peNjX-0003lJ-QC for guix-patches@gnu.org; Mon, 20 Mar 2023 18:12:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1peNjX-0003GQ-Hs for guix-patches@gnu.org; Mon, 20 Mar 2023 18:12:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1peNjX-0007N3-DZ for guix-patches@gnu.org; Mon, 20 Mar 2023 18:12:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62307] [PATCH core-updates 04/15] cross-base: Factor out cross-mig. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 20 Mar 2023 22:12:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62307 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62307@debbugs.gnu.org, Josselin Poiret Received: via spool by 62307-submit@debbugs.gnu.org id=B62307.167935027228136 (code B ref 62307); Mon, 20 Mar 2023 22:12:03 +0000 Received: (at 62307) by debbugs.gnu.org; 20 Mar 2023 22:11:12 +0000 Received: from localhost ([127.0.0.1]:57003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peNih-0007JV-5R for submit@debbugs.gnu.org; Mon, 20 Mar 2023 18:11:11 -0400 Received: from jpoiret.xyz ([206.189.101.64]:46754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1peNia-0007IU-31 for 62307@debbugs.gnu.org; Mon, 20 Mar 2023 18:11:04 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 78801185328; Mon, 20 Mar 2023 22:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1679350263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zPwj4kbEIadwci75v8R1Dhtn0xHNrKw1U5lie4QrvEQ=; b=KJLK42sALTJ8Q5YleDg1OHDARJi9NbdiwO90ivbotnzWxXpGI8O3A79pJY+esrxAiTE8WU EV1C4JW84AZ7QH8RU1j0NcxHc4BXmLYPbkbKVLvtr8yQpvc94HBLDOzEMG7fFqOIa3xZ8I p4uoVctFke0s5y13P3v32RsAW0iGAtkL+8BTtakHTgAmjEwO4IN1UFfC2ldW/cY6nOQHun wvzd6i8sjyLk4q3w0PceshMc1a9CiAgsleI5mrVeOAJA4Bk/iTUXB76fbWanqDTDBGzb3l TMK3QOVDFAgX608FO0RXY5oEaUdGVkvmA+1avjYQvjRDwH1kZZbZveQuCVjGHQ== Date: Mon, 20 Mar 2023 23:10:39 +0100 Message-Id: <71f4570e88dab2b16a501c08b0df523d5c1e41ca.1679349992.git.dev@jpoiret.xyz> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / 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: , Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679350354; a=rsa-sha256; cv=none; b=Qks0nAWVgiCGskh4QwaPqiw2pjmaB3onDdqRDwuqFXgIcgUyl4LiY3t/fSxXg75Ttm1YDi KGJhVTeL8J2O0kbQrLZA8RGD0AgUbEh84DAyKS5wnFTys9o80t29SqS84HWojeniOoC1w2 gtMCzB8hi5znjc+CMXjCylo/Fic9kMtB3/6otiMjRkdY2UQTaRtYrHUr6bRNRRGdZuD8mN 3thqDcjUgkRD7JQWQo+M9+EOUNAYEb2LA84wYybIIDz5O9bmm/NWXRdrwCzhSJGpyWbssU 0/K1EfiiYy/ds7+ka4RRqMTUNmm4VuyNwuw8fTKYCKCVMFxTcmt5l1LYuIEXDw== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=KJLK42sA; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx2.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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679350354; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: 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=zPwj4kbEIadwci75v8R1Dhtn0xHNrKw1U5lie4QrvEQ=; b=O9sP0eXe8p86jwC4VXxVBLfXum4JxSvF3bMHFnxECAxK0nQQeHm4N67trmY64cHx9eNNDq JMezxj5g3VNf2ZVNQo/nSubghNdkdQ//W7bbSKNht23DBmjhbHiwmtRsoIWazXNnPpQr3/ VEUYyk2q78CGA/a2snpkc600QtCaw2m+iNYtEwRv2kbzMji8X5hpia4gN36e5ClKQqhDLf SMjymcj1x8LKcst2ab0EZDSRO5P+WGB58+Ngq1zYrYKftZRey7IjgnL8Sp1v7YnHdv9bGc xrNEFkYjuG3MrGhwsN+91DOoIjNC0I6PxYNhgRc/+dQE2IBYz4tIzcRv3uQ48Q== X-Migadu-Spam-Score: -3.25 X-Spam-Score: -3.25 X-Migadu-Queue-Id: 67C803950C Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=KJLK42sA; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx2.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-Scanner: scn1.migadu.com X-TUID: HdYlKKyf9tVA * gnu/packages/cross-base.scm (cross-mig): New exported procedure. (cross-gnumach-headers): New procedure. (cross-kernel-headers*): Factor them out. (cross-libc*): Use them there. --- gnu/packages/cross-base.scm | 87 ++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 34 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 30bf1c6bd0..5c9ae86d52 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -46,6 +46,7 @@ (define-module (gnu packages cross-base) #:export (cross-binutils cross-libc cross-gcc + cross-mig cross-kernel-headers)) (define-syntax %xgcc @@ -372,6 +373,52 @@ (define* (cross-kernel-headers/deprecated target #:xgcc xgcc #:xbinutils xbinutils)) +(define* (cross-gnumach-headers target + #:key + (xgcc (cross-gcc target)) + (xbinutils (cross-binutils target))) + (package + (inherit gnumach-headers) + (name (string-append (package-name gnumach-headers) + "-cross-" target)) + (native-inputs + (modify-inputs (package-native-inputs gnumach-headers) + (prepend xgcc xbinutils))))) + +(define* (cross-mig target + #:key + (xgcc (cross-gcc target)) + (xbinutils (cross-binutils target))) + "Return a cross-mig for TARGET, where TARGET is a GNU triplet. Use XGCC as +the base compiler. Use XBINUTILS as the associated cross-Binutils." + (define xgnumach-headers + (cross-gnumach-headers target + #:xgcc xgcc + #:xbinutils xbinutils)) + (package + (inherit mig) + (name (string-append "mig-cross")) + (arguments + (substitute-keyword-arguments (package-arguments mig) + ((#:configure-flags flags #~'()) + #~(list #$(string-append "--target=" target))) + ((#:tests? _ #f) + #f) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-before 'configure 'set-cross-headers-path + (lambda* (#:key inputs #:allow-other-keys) + (let* ((mach #+xgnumach-headers) + (cpath (string-append mach "/include"))) + (for-each (lambda (variable) + (setenv variable cpath)) + '#$%gcc-cross-include-paths)))))))) + (propagated-inputs + (list xgnumach-headers)) + (native-inputs + (modify-inputs (package-native-inputs mig) + (prepend xgcc xbinutils))))) + (define* (cross-kernel-headers* target #:key (linux-headers linux-libre-headers) @@ -406,40 +453,11 @@ (define xlinux-headers ("cross-binutils" ,xbinutils) ,@(package-native-inputs linux-headers))))) - (define xgnumach-headers-name - (string-append (package-name gnumach-headers) "-cross-" target)) + (define xmig + (cross-mig target #:xgcc xgcc #:xbinutils xbinutils)) (define xgnumach-headers - (package - (inherit gnumach-headers) - (name xgnumach-headers-name) - (native-inputs - (modify-inputs (package-native-inputs gnumach-headers) - (prepend xgcc xbinutils))))) - - (define xmig - (package - (inherit mig) - (name (string-append "mig-cross")) - (arguments - (substitute-keyword-arguments (package-arguments mig) - ((#:configure-flags flags #~'()) - #~(list #$(string-append "--target=" target))) - ((#:tests? _ #f) - #f) - ((#:phases phases #~%standard-phases) - #~(modify-phases #$phases - (add-before 'configure 'set-cross-headers-path - (lambda* (#:key inputs #:allow-other-keys) - (let* ((mach #+(this-package-input xgnumach-headers-name)) - (cpath (string-append mach "/include"))) - (for-each (lambda (variable) - (setenv variable cpath)) - '#$%gcc-cross-include-paths)))))))) - (propagated-inputs (list xgnumach-headers)) - (native-inputs - (modify-inputs (package-native-inputs mig) - (prepend xgcc xbinutils))))) + (cross-gnumach-headers target #:xgcc xgcc #:xbinutils xbinutils)) (define xhurd-headers (package @@ -616,8 +634,9 @@ (define* (cross-libc* target ("cross-binutils" ,xbinutils) ,@(if (target-hurd? target) `(("cross-mig" - ,@(assoc-ref (package-native-inputs xheaders) - "cross-mig"))) + ,(cross-mig target + #:xgcc xgcc + #:xbinutils xbinutils))) '()) ,@(package-inputs libc) ;FIXME: static-bash ,@(package-native-inputs libc)))))) -- 2.39.2