From patchwork Tue Nov 12 16:25:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 70307 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 DF7A027BBEA; Tue, 12 Nov 2024 16:31:44 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 CE95827BBE2 for ; Tue, 12 Nov 2024 16:31:43 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAtmL-0003ac-3R; Tue, 12 Nov 2024 11:30:09 -0500 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 1tAtmJ-0003Vp-75 for guix-patches@gnu.org; Tue, 12 Nov 2024 11:30:07 -0500 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 1tAtmI-0005s3-U6; Tue, 12 Nov 2024 11:30:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=U3393vj9SLGcR9xYmbaMJUzCKszCGGKYXMuqOdjZjJg=; b=REyqcAbG5jUvDj1vwJiFirpE2sQZcObJmHFxiY/s7aSTD+R2Oow9FdoEVv9Wfqn/8c1YcT7/ocm2QBf20XbUqczL31WEMAY8gZuv0kzmj1gOHht0uY2CCMv0+XtKO2qSWcacaMlITE8PzrlZYLFxvoWOXq5wR8qUklWZjZyJ/yxrJKlIXmc/YwQMb/c1BcAma6VBc/UzBgqtgMSRivB4LdaD/oLt8SgSEXucIGDyN35XkutnokY7k+syTL3dA4A80V0kC62VnZz3uVrgiFQiJn4gVStA/gUqSxE0Uztzylp7F1GfmNVrlrtVWyL/2VPDVmLvVgxS5gmq/FedYdgnog==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tAtmI-0000Qs-Lz; Tue, 12 Nov 2024 11:30:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74290] [PATCH v2 06/40] gnu: cross-libc: Support cross-building for the 64bit Hurd. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Tue, 12 Nov 2024 16:30:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74290 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74290@debbugs.gnu.org Cc: Andreas Enge , Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Andreas Enge , Ludovic =?utf-8?q?Co?= =?utf-8?q?urt=C3=A8s?= Received: via spool by 74290-submit@debbugs.gnu.org id=B74290.17314289621117 (code B ref 74290); Tue, 12 Nov 2024 16:30:06 +0000 Received: (at 74290) by debbugs.gnu.org; 12 Nov 2024 16:29:22 +0000 Received: from localhost ([127.0.0.1]:39073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tAtlY-0000Ho-RO for submit@debbugs.gnu.org; Tue, 12 Nov 2024 11:29:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tAtlP-0000Fw-5b for 74290@debbugs.gnu.org; Tue, 12 Nov 2024 11:29:13 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tAtjE-0005Kn-8c; Tue, 12 Nov 2024 11:26:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=U3393vj9SLGcR9xYmbaMJUzCKszCGGKYXMuqOdjZjJg=; b=APk+0XaD1yfgs8ikGtGZ krqVw/TP+AJd0Ih1+rC3ADpA2+lxPM7GFsmiGkdtUboviWpTacFf4Orz1cFf0BSYUl+BWYsM3YKki 5zB7fsOWTwN+St14BgCDCwKm46FilLBk7BRPyffXX/iHM4XqToIQuDChVmVD01vSu35mEX7OZZxaI ajNUdyadDcWDNdILTS6H6ufzyrQkpcyeFwDQs/bj12DxTkhUhh/tAxLIlfUw57yI8mvHGsf2GsrDD rX1NOytxJC/Ot6CrMJom66PZuq19o/oOD5uis3JOoEo9OPqDmdnyb7kmnkdD1QwHvgHybIJqmGsvq CJxayzcIjKtVTQ==; From: Janneke Nieuwenhuizen Date: Tue, 12 Nov 2024 17:25:15 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/base.scm (glibc)[arguments]: When building for the Hurd, in phase "create-machine-symlink", do not assume CPU is i386, also cater for x86_64. * gnu/packages/cross-base.scm (cross-libc*)[arguments]: Likewise. Change-Id: Ib009b7bd301b543b8629382330cca9d963b7a812 --- gnu/packages/base.scm | 18 ++++++++++++------ gnu/packages/cross-base.scm | 17 +++++++++++------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 4e8121ae2c..02ef71f20d 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -1079,7 +1079,7 @@ (define-public glibc (string-append locale "/C.UTF-8"))))) ,@(if (target-hurd?) - '((add-after 'install 'augment-libc.so + `((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") @@ -1088,11 +1088,17 @@ (define-public glibc " libmachuser.so libhurduser.so")))))) (add-after 'install 'create-machine-symlink (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (cpu "i386")) - (symlink cpu - (string-append out - "/include/mach/machine")))))) + (let* ((out (assoc-ref outputs "out")) + (cpu ,(match (or (%current-target-system) + (%current-system)) + ((? target-x86-32?) + "i386") + ((? target-x86-64?) + "x86_64"))) + (machine (string-append + out "/include/mach/machine"))) + (unless (file-exists? machine) + (symlink cpu machine)))))) '())))) (inputs `(("static-bash" ,static-bash))) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 7b32a6b64e..3827e87aec 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -738,7 +738,7 @@ (define* (cross-libc* target (delete 'install-utf8-c-locale) ,@(if (target-hurd? target) - '((add-after 'install 'augment-libc.so + `((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") @@ -747,11 +747,16 @@ (define* (cross-libc* target " libmachuser.so libhurduser.so")))))) (add-after 'install 'create-machine-symlink (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out")) - (cpu "i386")) - (symlink cpu - (string-append out - "/include/mach/machine")))))) + (let* ((out (assoc-ref outputs "out")) + (cpu ,(match target + ((? target-x86-32?) + "i386") + ((? target-x86-64?) + "x86_64"))) + (machine (string-append + out "/include/mach/machine"))) + (unless (file-exists? machine) + (symlink cpu machine)))))) '()))))) ;; Shadow the native "kernel-headers" because glibc's recipe expects the