From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 2C5pCHSWFmXqvAAAauVa8A:P1 (envelope-from ) for ; Fri, 29 Sep 2023 11:18:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2C5pCHSWFmXqvAAAauVa8A (envelope-from ) for ; Fri, 29 Sep 2023 11:18:44 +0200 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 BD6203E004 for ; Fri, 29 Sep 2023 11:18:43 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=foundationdevices.com header.s=google header.b=L4tUPnE7; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695979124; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=bQmWpu0802G04X+l9FaBtV1hmIpmTrS0EWgFbHWNEuU=; b=Yx04EEUoqdXl3t5AIP2mhgI3EViLKVyx8dWH10aU081diY1hT9wzVT7TOyGhLDA5k+dHnY z+EiatuYMxFv0U6TgfJBMEhi/miyiuUPeaNORFYdwwEO7tR9SL1QagwMVBcAIG4VRgO67X B6BlM3kgi8fR/eaMpdjHEuTBFYFqUFezkK0qUqVEMS7NpYzZ7ZK/hjWurOOga8X+KANrCv wjxTKUJX2veERRVOmt2Dn9ZJdYJX9ayaQQPHtXFxYcbJEcb9RNL24H6JwZbUty6XJu7L+9 ZwMIEC38Gh5f1D1NWYrfp59VvFJSxhYTgF63mFgljXBjZocCV8xSfOSHuea1dw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=foundationdevices.com header.s=google header.b=L4tUPnE7; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695979124; a=rsa-sha256; cv=none; b=MwljjfUhqaCS7ni5HCm+iZ7p7JRL9N50gXgjZuKmJT8qtkfFxwEYoygFObnAv7WInpA4T5 /IM3W42XUEMOZOtgvD7vn1g09Py4Mcn5lk3CDfeo8X6zwoXu6uhJHgiDG4aPd2R1cSi2ox dG14agJiQGWmFk0QJLInHT01tTWrs1mrGhvGxWkdhANr+pe2cawIrU/hZDnSfi2Y4oO2HQ MKS5/WhoItrknigk2mk4ztnBOs+TovpJ4cudieb3JhmAu5oqRQYj/5PYhcRTrAms2I7BjR 729a82iFxym8HjDWKvfl8zoWf6acqMaFJD4OwZ3Ft/V002X6LuaVnalfZorJvw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qm9dO-0005bJ-2I; Fri, 29 Sep 2023 05:18:06 -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 1qm9dC-0005Ti-20 for guix-patches@gnu.org; Fri, 29 Sep 2023 05:17:56 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qm9d7-0003uF-Q8 for guix-patches@gnu.org; Fri, 29 Sep 2023 05:17:50 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qm9dM-0004lm-Ex; Fri, 29 Sep 2023 05:18:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66263] [PATCH 01/23] gnu: cross-libc: Return #f if no libc available. References: <20230929091333.7623-1-jean@foundationdevices.com> In-Reply-To: <20230929091333.7623-1-jean@foundationdevices.com> Resent-From: Jean-Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, vagrant@debian.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Fri, 29 Sep 2023 09:18:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66263 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66263@debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ , efraim@flashner.co.il, vagrant@debian.org, maxim.cournoyer@gmail.com X-Debbugs-Original-Xcc: efraim@flashner.co.il, vagrant@debian.org, maxim.cournoyer@gmail.com Received: via spool by 66263-submit@debbugs.gnu.org id=B66263.169597904818108 (code B ref 66263); Fri, 29 Sep 2023 09:18:04 +0000 Received: (at 66263) by debbugs.gnu.org; 29 Sep 2023 09:17:28 +0000 Received: from localhost ([127.0.0.1]:55195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm9cl-0004hu-LY for submit@debbugs.gnu.org; Fri, 29 Sep 2023 05:17:28 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:44199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qm9cI-0004di-EB for 66263@debbugs.gnu.org; Fri, 29 Sep 2023 05:17:10 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-406618d0992so275975e9.0 for <66263@debbugs.gnu.org>; Fri, 29 Sep 2023 02:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundationdevices.com; s=google; t=1695978994; x=1696583794; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cOG/pzxU5SmzmUxtbGMIzsmMxINxsxe9+XUTkU4nf4U=; b=L4tUPnE77I3fsClL05bn+jUOE/dAXMF1usMHGOpOSBtHK34mUxrKNH5Mnpime7HoWr e2wrJHXqadRNZMrhXdK35zIkDWJArD9KVAuYgyBR4kiM/wDmMyQyGvOjsx8Aw4wdmMlp Rb2uNOJ84RGnw7UomZlo93bvYt5HFCybBhbgwOvk5XTS7zoTT8tdq+HE0/d+ABgxQFpu +goUP9Ed0nmtXUoGQlc2NxMoMQxsbrNdaPx9xj+Ysgtj2o1kTbjiRYWWa472UdTsxVmu XHVNhjtBTU2efSZsg21XqbYXpeNrit6asMapp6tv0x/X56hvtKC0q4yKK5xllLcBooNY 4sYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695978994; x=1696583794; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cOG/pzxU5SmzmUxtbGMIzsmMxINxsxe9+XUTkU4nf4U=; b=KlRbSry71cD+FBiPjp9EXUe+DX24uoepbGc5ToPL7oXfSw9yxbx//vHwfwJHfHUNj8 zczVWko2i95XtLxp+KMj1Cv2yqV6nTZKV/ZA2+aBKuMlUau9+EKUWRMmoG4yM6HFFJ4q RHCCOzXOis6GpHMguaCAHLZt/XlfDpBhed3SO8wzvUIxhRCLVLbFxaDQyKwC9zxXCKoj ZHkL0HWz6pBvoPfO6NkSOP5z7IY6PjdeskA7pAkcVK2VXMOn4+Z4pXFgVy4W+0zqxZZC LhWQGPk39N1Q/vuItoltYtxvmM7fDxCtt+vdDiuZDUlaxYvaqWq0ifgF6U1SOIK0H8i4 Vf/g== X-Gm-Message-State: AOJu0YzQi9qYW1B8IigRBgEMXIk+l003l0Zs2I9iWOwMrPudNpunmdSw rt+MH5nTLtq2k0af5E2mUfg/SUueJ8q0vmHm7NR6GQ== X-Google-Smtp-Source: AGHT+IGwcsjncPfF1pwtI6aEzGF2yeLBGdeD+n0IJviI66cGeColvzoeXoP2EKKI75amneQXAktjmA== X-Received: by 2002:a05:600c:2058:b0:405:95c3:e79d with SMTP id p24-20020a05600c205800b0040595c3e79dmr3499708wmg.40.1695978993583; Fri, 29 Sep 2023 02:16:33 -0700 (PDT) Received: from omen15.home ([89.131.29.87]) by smtp.gmail.com with ESMTPSA id k15-20020a7bc40f000000b004013797efb6sm1020933wmi.9.2023.09.29.02.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 02:16:33 -0700 (PDT) Date: Fri, 29 Sep 2023 11:16:05 +0200 Message-Id: <20230929091627.7820-1-jean@foundationdevices.com> X-Mailer: git-send-email 2.34.1 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: , Reply-to: Jean-Pierre De Jesus DIAZ X-ACL-Warn: , Jean-Pierre De Jesus DIAZ via Guix-patches From: Jean-Pierre De Jesus DIAZ 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.20 X-Migadu-Scanner: mx2.migadu.com X-Migadu-Queue-Id: BD6203E004 X-Spam-Score: -5.20 X-TUID: FUqhmGzANP7N * gnu/packages/cross-base.scm (cross-libc): Return #f if platform does not have a libc available. --- gnu/packages/cross-base.scm | 138 +++++++++++++++++++----------------- 1 file changed, 71 insertions(+), 67 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 14cb365099..f55765f1b0 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2022 Maxim Cournoyer ;;; Copyright © 2023 Josselin Poiret +;;; Copyright © 2023 Foundation Devices, Inc. ;;; ;;; This file is part of GNU Guix. ;;; @@ -611,73 +612,76 @@ (define* (cross-libc* target (xheaders (cross-kernel-headers target))) "Return LIBC cross-built for TARGET, a GNU triplet. Use XGCC and XBINUTILS and the cross tool chain." - (if (target-mingw? target) - (let ((machine (substring target 0 (string-index target #\-)))) - (make-mingw-w64 machine - #:xgcc xgcc - #:xbinutils xbinutils)) - (package - (inherit libc) - (name (string-append "glibc-cross-" target)) - (arguments - (substitute-keyword-arguments - `( ;; Disable stripping (see above.) - #:strip-binaries? #f - - ;; This package is used as a target input, but it should not have - ;; the usual cross-compilation inputs since that would include - ;; itself. - #:implicit-cross-inputs? #f - - ;; We need SRFI 26. - #:modules ((guix build gnu-build-system) - (guix build utils) - (srfi srfi-26)) - - ,@(package-arguments libc)) - ((#:configure-flags flags) - `(cons ,(string-append "--host=" target) - ,(if (target-hurd? target) - `(append (list "--disable-werror" - ,@%glibc/hurd-configure-flags) - ,flags) - flags))) - ((#:phases phases) - `(modify-phases ,phases - (add-before 'configure 'set-cross-kernel-headers-path - (lambda* (#:key inputs #:allow-other-keys) - (let* ((kernel (assoc-ref inputs "kernel-headers")) - (cpath (string-append kernel "/include"))) - (for-each (cut setenv <> cpath) - ',%gcc-cross-include-paths) - (setenv "CROSS_LIBRARY_PATH" - (string-append kernel "/lib")) ; for Hurd's libihash - #t))) - ,@(if (target-hurd? target) - '((add-after 'install 'augment-libc.so - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out"))) - (substitute* (string-append out "/lib/libc.so") - (("/[^ ]+/lib/libc.so.0.3") - (string-append out "/lib/libc.so.0.3" - " libmachuser.so libhurduser.so")))) - #t))) - '()))))) - - ;; Shadow the native "kernel-headers" because glibc's recipe expects the - ;; "kernel-headers" input to point to the right thing. - (propagated-inputs `(("kernel-headers" ,xheaders))) - - (native-inputs `(("cross-gcc" ,xgcc) - ("cross-binutils" ,xbinutils) - ,@(if (target-hurd? target) - `(("cross-mig" - ,(cross-mig target - #:xgcc xgcc - #:xbinutils xbinutils))) - '()) - ,@(package-inputs libc) ;FIXME: static-bash - ,@(package-native-inputs libc)))))) + (match target + ((? target-mingw?) + (let ((machine (substring target 0 (string-index target #\-)))) + (make-mingw-w64 machine + #:xgcc xgcc + #:xbinutils xbinutils))) + ((or (? target-linux?) (? target-hurd?)) + (package + (inherit libc) + (name (string-append "glibc-cross-" target)) + (arguments + (substitute-keyword-arguments + `( ;; Disable stripping (see above.) + #:strip-binaries? #f + + ;; This package is used as a target input, but it should not have + ;; the usual cross-compilation inputs since that would include + ;; itself. + #:implicit-cross-inputs? #f + + ;; We need SRFI 26. + #:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + + ,@(package-arguments libc)) + ((#:configure-flags flags) + `(cons ,(string-append "--host=" target) + ,(if (target-hurd? target) + `(append (list "--disable-werror" + ,@%glibc/hurd-configure-flags) + ,flags) + flags))) + ((#:phases phases) + `(modify-phases ,phases + (add-before 'configure 'set-cross-kernel-headers-path + (lambda* (#:key inputs #:allow-other-keys) + (let* ((kernel (assoc-ref inputs "kernel-headers")) + (cpath (string-append kernel "/include"))) + (for-each (cut setenv <> cpath) + ',%gcc-cross-include-paths) + (setenv "CROSS_LIBRARY_PATH" + (string-append kernel "/lib")) ; for Hurd's libihash + #t))) + ,@(if (target-hurd? target) + '((add-after 'install 'augment-libc.so + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (substitute* (string-append out "/lib/libc.so") + (("/[^ ]+/lib/libc.so.0.3") + (string-append out "/lib/libc.so.0.3" + " libmachuser.so libhurduser.so")))) + #t))) + '()))))) + + ;; Shadow the native "kernel-headers" because glibc's recipe expects the + ;; "kernel-headers" input to point to the right thing. + (propagated-inputs `(("kernel-headers" ,xheaders))) + + (native-inputs `(("cross-gcc" ,xgcc) + ("cross-binutils" ,xbinutils) + ,@(if (target-hurd? target) + `(("cross-mig" + ,(cross-mig target + #:xgcc xgcc + #:xbinutils xbinutils))) + '()) + ,@(package-inputs libc) ;FIXME: static-bash + ,@(package-native-inputs libc))))) + (else #f))) ;;; Concrete cross tool chains are instantiated like this: -- 2.34.1