From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id eFM9Lmg3PGe8+AAAe85BDQ:P1 (envelope-from ) for ; Tue, 19 Nov 2024 06:59:52 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id eFM9Lmg3PGe8+AAAe85BDQ (envelope-from ) for ; Tue, 19 Nov 2024 07:59:52 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=HPdw6OGc; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=OL4Y+SUC; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731999592; a=rsa-sha256; cv=none; b=u143xe5tI+WUlVek9V2jhavAAu2NFGU4DDMZb4SPqhZWMdFc0pBFBSzZE8HuU4yRQdnw2m 8h+Ool/s0MXYRQDr+OWStqprD8ZimbhT+OZlSnE0DH+pR8OM9wQwx+IN2qsckivdkkiUaa nGMTbt0IEX4DbNsRfK5OjVWUeoVsqs+Qv51jmT4AgjPgDwIfn+GN5NEtXltolwbMP73958 bLlPNyoUFdGPVjjhQz547X+HYjm4mtHwfsA3uRZBMAPUbFdIfPkyyNwEXhrXx+/gWxPEde y/HxwMMvEksjW+Tv1lpQJ5olA6f56cp65Wh4nGjOv7pK89UvLD0clsnkTg4P8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=HPdw6OGc; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=OL4Y+SUC; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1731999592; h=from:from:sender:sender: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=Pa6Y9FF7/lLK4NUbc/ksHzZkdmPZ4YxoB3qlTOOJwww=; b=r2vRfiTt8Yk5pke+5xH9BrqyJnOAEl46Jx+K+P8wbW527FVm1XDGpDVmWrJZmixtK76bvm 6nlyaexDAvdDu72ZcrnhzgzJ+m+Z8E/5TK3SR5GKsDLAgponldOzq0u3TzX2dGxqKPwSOx vkdAvZbPZbPUFFwEQqDaSOY3HdMSJq1Vq6OLDlouSPh5nmESCNh4rMp8PPr6i+cDPUa+XE Rhk3MOjG+9LOMxGc+rITGJKcUyNA5nrVG4hrtXVtrxA6TqjuseqyDIrpxp59sOO3UXLdpE 9C7CZp6675u8Wwsm64Y/LjwDwOpNikdIkQLqXzWha9oNnKU1RrfP+tlLy4ZLKA== 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 714FC895B8 for ; Tue, 19 Nov 2024 07:59:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDICd-0008Ka-Sr; Tue, 19 Nov 2024 01:59:11 -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 1tDICa-0008IW-LW for guix-patches@gnu.org; Tue, 19 Nov 2024 01:59:09 -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 1tDICa-0004IP-BL; Tue, 19 Nov 2024 01:59:08 -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=Pa6Y9FF7/lLK4NUbc/ksHzZkdmPZ4YxoB3qlTOOJwww=; b=HPdw6OGczcjcUnkD273AUZxmtJYHlvHbDUlItUdbTmgpcf7y1JP1z3G4nYJC3tboHRN6oTq3da56054aSeZW8p3Ssv/LoMSJDxNDCAYxATcvxryxhpddIIKW7tJLOJnrgGdIj9P33TX1e4I39yVjbqba5w9kWSnDauozUx3bMF/XXjZblY/+zk76vJEWaMyfwmoZy8kkxaX4wdSZF4xdtJIf4HVdE/hFj7kW+hPY2Mk+czXLv5BZ2XTcg8lG8zzJWsuLUfbqSh/WGN3mRXJwWDSALHBotf+8qIbK6XL5CKyVWv2aPYRVfq7Esvgq/6DjnCrzUbzUMW/eWqNJA/VqsQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tDICY-0005Ev-Gl; Tue, 19 Nov 2024 01:59:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74290] [PATCH v3 04/51] gnu: Add basic support for x86_64-pc-gnu target, aka 64bit Hurd. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 19 Nov 2024 06:59: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 , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Andreas Enge , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 74290-submit@debbugs.gnu.org id=B74290.173199949119607 (code B ref 74290); Tue, 19 Nov 2024 06:59:06 +0000 Received: (at 74290) by debbugs.gnu.org; 19 Nov 2024 06:58:11 +0000 Received: from localhost ([127.0.0.1]:40425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDIBe-000563-SX for submit@debbugs.gnu.org; Tue, 19 Nov 2024 01:58:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDIBZ-00054T-22 for 74290@debbugs.gnu.org; Tue, 19 Nov 2024 01:58:06 -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 1tDI9O-0003vt-Jn; Tue, 19 Nov 2024 01:55:50 -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=Pa6Y9FF7/lLK4NUbc/ksHzZkdmPZ4YxoB3qlTOOJwww=; b=OL4Y+SUCiaKb80/lJQMj DApK5S+DeSPtXjMcGD/S/0duIGwnTCsTX1sSjxPCgiEG1UVznWUU2TC51syGuPQbDz6NUsy27dVHq ITU6Zp/xKsUUpFKFy15dT+UKj/GcwZDDpXoxgh761I6pI39MUztMH4hjik86Kw49hn0Ak8WnAk6hs W2fM6CqMW91CY+RsengpfQSxYNUij99NGUVyvsUNDs6b6uZ6Qw2gSrMysS+ERXFJdbYvzPPsTDGIh SAFNRpBdOCN499gozCL76LLPMV5j5yqfh5meOpx0Xu6IdpZAO9bUxNS6ffc3hcNTYoT8GITUwqJze PyPiro/wj5zvbQ==; From: Janneke Nieuwenhuizen Date: Tue, 19 Nov 2024 07:54:34 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 0.98 X-Spam-Score: 0.98 X-Migadu-Queue-Id: 714FC895B8 X-Migadu-Scanner: mx12.migadu.com X-TUID: 4BaPqfVyw3r0 * gnu/packages/bootstrap.scm (glibc-dynamic-linker): Update comment on where to find shared linker name. (make-raw-bag): Also use raw-build-guile3 when building for the 64bit Hurd. * gnu/packages/cross-base.scm (cross-kernel-headers*): Use target-hurd? instead of custom "i586..." matching to also use xhurd-core-headers for target-hurd64. * gnu/packages/make-bootstrap.scm (package-with-relocatable-glibc) [native-inputs]: Move final-inputs before cross-packages. (%binutils-static)[arguments]: When building for the 64bit Hurd, add "lt_cv_prog_compiler_static_works=yes", "lt_cv_prog_compiler_static_works_CXX=yes" to #:make-flags to convince to actually link the binaries statically. (make-guile-static)[arguments]: When building for the 64bit Hurd, add "lt_cv_prog_compiler_static_works=yes" to #:configure-flags to convince libtool to actually link guile statically. * guix/platforms/x86.scm (x86_64-gnu): New exported variable. * guix/utils.scm (target-hurd64? system-hurd64?): New procedures. --- gnu/packages/bootstrap.scm | 3 ++- gnu/packages/cross-base.scm | 6 +++--- gnu/packages/make-bootstrap.scm | 24 +++++++++++++++++------- guix/platforms/x86.scm | 11 ++++++++++- guix/utils.scm | 15 ++++++++++++++- 5 files changed, 46 insertions(+), 13 deletions(-) diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index 3743abf9fe..33cbaa30ae 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -558,7 +558,8 @@ (define* (make-raw-bag name (name name) (system system) (build-inputs inputs) - (build (cond ((target-riscv64?) + (build (cond ((or (target-riscv64?) + (target-hurd64?)) raw-build-guile3) (else raw-build))))) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 5781341a87..83672ab383 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -641,9 +641,9 @@ (define* (cross-kernel-headers* target ("hurd-headers" ,xhurd-headers) ("hurd-minimal" ,xhurd-minimal))))) - (match target - ((or "i586-pc-gnu" "i586-gnu") xhurd-core-headers) - (_ xlinux-headers))) + (if (target-hurd? target) + xhurd-core-headers + xlinux-headers)) (define* (cross-libc . args) (if (or (= (length args) 1) (contains-keyword? args)) diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index edc536bff4..689d48d342 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -145,7 +145,10 @@ (define (package-with-relocatable-glibc p) target #:xbinutils (cross-binutils target) #:libc (cross-bootstrap-libc target)))) - `(("cross-gcc" ,(package + `(,@(%final-inputs) + ;; As versions for gcc and cross-gcc can differ, make sure to have + ;; cross-gcc behind gcc in CPLUS_INCLUDE_PATH. + ("cross-gcc" ,(package (inherit xgcc) (search-paths ;; Ensure the cross libc headers appears on the @@ -154,8 +157,7 @@ (define (package-with-relocatable-glibc p) (variable "CROSS_CPLUS_INCLUDE_PATH") (files '("include"))) (package-search-paths gcc))))) - ("cross-binutils" ,(cross-binutils target)) - ,@(%final-inputs))) + ("cross-binutils" ,(cross-binutils target)))) `(("libc" ,(glibc-for-bootstrap glibc)) ("libc:static" ,(glibc-for-bootstrap glibc) "static") ("gcc" ,(gcc-for-bootstrap glibc)) @@ -395,10 +397,15 @@ (define %binutils-static ((#:configure-flags flags _ ...) flags))) #:make-flags - (match (memq #:make-flags (package-arguments binutils)) - ((#:make-flags flags _ ...) - flags) - (_ #~'())) + #~(append + #$(if (target-hurd64?) + #~'("lt_cv_prog_compiler_static_works=yes" + "lt_cv_prog_compiler_static_works_CXX=yes") + #~'()) + #$(match (memq #:make-flags (package-arguments binutils)) + ((#:make-flags flags _ ...) + flags) + (_ #~'()))) #:strip-flags #~'("--strip-all") #:phases #~(modify-phases %standard-phases @@ -642,6 +649,9 @@ (define* (make-guile-static guile patches) #$@(if (target-hurd?) #~("--disable-jit") + #~()) + #$@(if (target-hurd64?) + #~("lt_cv_prog_compiler_static_works=yes") #~()))) ((#:phases phases '%standard-phases) #~(modify-phases #$phases diff --git a/guix/platforms/x86.scm b/guix/platforms/x86.scm index 0c8fc7296c..5617e6dd68 100644 --- a/guix/platforms/x86.scm +++ b/guix/platforms/x86.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2022 Mathieu Othacehe ;;; Copyright © 2023, 2024 Efraim Flashner +;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,7 +26,8 @@ (define-module (guix platforms x86) x86_64-linux-x32 i686-mingw x86_64-mingw - i586-gnu)) + i586-gnu + x86_64-gnu)) (define i686-linux (platform @@ -71,3 +73,10 @@ (define i586-gnu (system "i586-gnu") (rust-target "i686-unknown-hurd-gnu") (glibc-dynamic-linker "/lib/ld.so.1"))) + +(define x86_64-gnu + (platform + (target "x86_64-pc-gnu") + (system "x86_64-gnu") + (rust-target "x86_64-unknown-hurd-gnu") + (glibc-dynamic-linker "/lib/ld-x86-64.so.1"))) diff --git a/guix/utils.scm b/guix/utils.scm index f161cb4ef3..e100c03365 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -17,7 +17,7 @@ ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2022 Antero Mejr ;;; Copyright © 2023 Philip McGrath -;;; Copyright © 2023 Janneke Nieuwenhuizen +;;; Copyright © 2023, 2024 Janneke Nieuwenhuizen ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2023 Foundation Devices, Inc. ;;; Copyright © 2024 Herman Rimm @@ -94,6 +94,8 @@ (define-module (guix utils) target-linux? target-hurd? system-hurd? + target-hurd64? + system-hurd64? target-mingw? target-x86-32? target-x86-64? @@ -716,6 +718,17 @@ (define* (system-hurd?) "Is the current system the GNU(/Hurd) system?" (and=> (%current-system) target-hurd?)) +(define* (target-hurd64? #:optional (target (or (%current-target-system) + (%current-system)))) + "Does TARGET represent the 64bit GNU(/Hurd) system?" + (and (target-hurd?) + (target-64bit? target))) + +(define* (system-hurd64?) + "Is the current system the 64bit GNU(/Hurd) system?" + (and (system-hurd?) + (target-64bit? (%current-system)))) + (define* (target-mingw? #:optional (target (%current-target-system))) "Is the operating system of TARGET Windows?" (and target -- 2.46.0