From patchwork Sun Nov 10 10:38:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janneke Nieuwenhuizen X-Patchwork-Id: 70196 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 66F0F27BBEA; Sun, 10 Nov 2024 10:41:29 +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 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 C567727BBE9 for ; Sun, 10 Nov 2024 10:41:19 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tA5Mb-00015N-AZ; Sun, 10 Nov 2024 05:40:13 -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 1tA5MY-000117-54 for guix-patches@gnu.org; Sun, 10 Nov 2024 05:40:10 -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 1tA5MX-0008HJ-Qy for guix-patches@gnu.org; Sun, 10 Nov 2024 05:40:09 -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=Ag4EZGIwGxt3LeRaxY2LpxM+Fiigr8DC4RzGYYe7q+U=; b=XJJH7HOrg+MeyWdAokaLzSMqemUb1rJunSI13cX9Gk9Iv9F0/b4uIjNG2j8jl6nNAiQVjrLn0iG4MERffwQljTAclFDIaJMOL7s3YfyLKQPva/g4oxoxLp1S/CJTeMnrrcKhtmnxzAj5jsYxnzTzW/r78ZL8MGDaM1tdfCoXscGyblFX6DKPYbQQPu3+ZvlUBu1UjE5q8BCqu+ZXmtlPFFaEq4MDXw2j79pAqfFczPrnWlA2CP9/GyfuqrpxVAJZnGPWDADUs8BgPZKm8qJI1mB1CVbiuOV/rj1QG/7H47fEnTj7wxx7mmPgAHbaxxQq0hsrFbcaqFvOSyZRQxTEWg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tA5MX-0002mo-N4 for guix-patches@gnu.org; Sun, 10 Nov 2024 05:40:09 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74290] [PATCH 26/31] gnu: hurd: Build fixes for the 64bit Hurd. Resent-From: Janneke Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 10 Nov 2024 10:40:09 +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 Received: via spool by 74290-submit@debbugs.gnu.org id=B74290.173123516710286 (code B ref 74290); Sun, 10 Nov 2024 10:40:09 +0000 Received: (at 74290) by debbugs.gnu.org; 10 Nov 2024 10:39:27 +0000 Received: from localhost ([127.0.0.1]:55804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tA5Lq-0002fj-R1 for submit@debbugs.gnu.org; Sun, 10 Nov 2024 05:39:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tA5Lg-0002cX-Of for 74290@debbugs.gnu.org; Sun, 10 Nov 2024 05:39:17 -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 1tA5Lb-0007uI-Hx; Sun, 10 Nov 2024 05:39:11 -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=Ag4EZGIwGxt3LeRaxY2LpxM+Fiigr8DC4RzGYYe7q+U=; b=RBrQ4EW7gX9WTB/Ww+Zk lJbY9CRaL9cEW2PCMVTjd5RpHqyuY8D7nPt1fQA3GzTalZ3TIAQ0h8ZMd2c4hBw17gD1zG1ka0Vxu dlw6TUvUFO77f/Gtg7Lp4QRYl9dSRcuZzKJK+Y4LfjufiAbGFgHBRWR72oHmMkgx1ie1/vlfwvTQd pdKcFncIJOUQ7h1cRQl9/uA1RLsQQS0kCo62nP3zng4K+wdRCr3DcsPXQNQXxOA6cGXHWLYPkFkOm eRVfGvHU/SjLGiOnTbaH2TlL+mvdEq/KtlfEChdW3i49U72sLG/0XFLnTlZnWy9QtLX67b+qs3t0J kMKXTFEcKRv72w==; From: Janneke Nieuwenhuizen Date: Sun, 10 Nov 2024 11:38:22 +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/patches/hurd-64bit.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/hurd.scm (hurd)[source]: Use it. [arguments]: When building for the 64bit Hurd, add "create-machine-symlink" phase. In phases "build-libdde-linux" and "install-goodies", do not assume x86, rather use actual ARCH, disable -Wstrict-prototypes and -Wint-conversion, and follow upstream's "amd64" symlinking voodoo. Change-Id: If264a91b2433add13f9121c482f0abe67ae5f1e9 --- gnu/local.mk | 1 + gnu/packages/hurd.scm | 115 +++++++++++++++++--------- gnu/packages/patches/hurd-64bit.patch | 56 +++++++++++++ 3 files changed, 131 insertions(+), 41 deletions(-) create mode 100644 gnu/packages/patches/hurd-64bit.patch diff --git a/gnu/local.mk b/gnu/local.mk index 9a4715df86..cf0de3d92e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1545,6 +1545,7 @@ dist_patch_DATA = \ %D%/packages/patches/htslib-for-stringtie.patch \ %D%/packages/patches/hubbub-sort-entities.patch \ %D%/packages/patches/hueplusplus-mbedtls.patch \ + %D%/packages/patches/hurd-64bit.patch \ %D%/packages/patches/hurd-rumpdisk-no-hd.patch \ %D%/packages/patches/hurd-startup.patch \ %D%/packages/patches/hwloc-1-test-btrfs.patch \ diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index d29ec22cd7..7aed0ebe1d 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -317,7 +317,8 @@ (define-public hurd (source (origin (inherit (package-source hurd-headers)) (patches (search-patches "hurd-rumpdisk-no-hd.patch" - "hurd-startup.patch")))) + "hurd-startup.patch" + "hurd-64bit.patch")))) (version (package-version hurd-headers)) (arguments `(#:tests? #f ;no "check" target @@ -467,48 +468,80 @@ (define-public hurd (find-files (string-append out "/libexec"))) #t))) (add-after 'build 'build-libdde-linux - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (invoke (string-append (assoc-ref (or native-inputs inputs) "make") - "/bin/make") - ;; XXX There can be a race condition because subdirs - ;; aren't interdependent targets in the Makefile. - "-j1" "-C" "libdde_linux26" - (string-append "SHELL=" - (assoc-ref (or native-inputs inputs) "bash") - "/bin/bash") - (string-append "CC=" - ,(cc-for-target)) - "ARCH=x86"))) + (lambda* (#:key inputs native-inputs #:allow-other-keys) + (let ((arch ,(match (or (%current-target-system) + (%current-system)) + ((? target-x86-32?) + "x86") + ((? target-x86-64?) + "amd64")))) + (when ,(target-hurd64?) + (let ((dir "libdde_linux26/build/include")) + (mkdir-p (string-append dir "/x86")) + (format #t "symlink ~a -> ~a\n" + (string-append dir "/x86/amd64") "x86") + (symlink "x86" (string-append dir "/amd64")) + (format #t "symlink ~a -> ~a\n" + (string-append dir "/amd64/asm-x86_64") "asm-x86") + (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64")))) + (invoke (string-append (assoc-ref (or native-inputs inputs) "make") + "/bin/make") + ;; XXX There can be a race condition because subdirs + ;; aren't interdependent targets in the Makefile. + "-j1" "-C" "libdde_linux26" + (string-append "SHELL=" + (assoc-ref (or native-inputs inputs) "bash") + "/bin/bash") + (string-append "CC=" + ,(cc-for-target)) + (string-append "WARNINGS=-Wno-int-conversion" + " -Wno-strict-prototypes") + (string-append "ARCH=" arch))))) (add-after 'install 'install-goodies - (lambda* (#:key inputs native-inputs outputs #:allow-other-keys) - ;; Install additional goodies. - ;; TODO: Build & install *.msgids for rpctrace. - (let* ((out (assoc-ref outputs "out")) - (datadir (string-append out "/share/hurd"))) - ;; Install libdde_linux26. - (invoke (string-append (assoc-ref (or native-inputs inputs) "make") - "/bin/make") - "-C" "libdde_linux26" "install" - (string-append "SHELL=" - (assoc-ref (or native-inputs inputs) "bash") - "/bin/bash") - (string-append "INSTALLDIR=" - out - "/share/libdde_linux26/build/include") - "ARCH=x86") - ;; Install the fancy UTF-8 motd. - (mkdir-p (string-append out "/etc")) - (copy-file "console/motd.UTF8" - (string-append out "/etc/motd")) + (lambda* (#:key inputs native-inputs outputs #:allow-other-keys) + ;; Install additional goodies. + ;; TODO: Build & install *.msgids for rpctrace. + (let* ((out (assoc-ref outputs "out")) + (datadir (string-append out "/share/hurd")) + (arch ,(match (or (%current-target-system) + (%current-system)) + ((? target-x86-32?) + "x86") + ((? target-x86-64?) + "amd64"))) + (dir (string-append out "/share/libdde_linux26/build/include"))) + (mkdir-p dir) + (when ,(target-hurd64?) + (mkdir-p (string-append dir "/amd64")) + (format #t "symlink ~a -> ~a\n" + (string-append dir "/amd64/asm-x86_64") + "x86") + (symlink "x86" (string-append dir "/amd46"))) + (invoke (string-append (assoc-ref (or native-inputs inputs) "make") + "/bin/make") + "-C" "libdde_linux26" "install" + (string-append "SHELL=" + (assoc-ref (or native-inputs inputs) "bash") + "/bin/bash") + (string-append "INSTALLDIR=" dir) + (string-append "ARCH=" arch)) + (when ,(target-hurd64?) + (format #t "symlink ~a -> ~a\n" + (string-append dir "/amd64/asm-x86_64") + "asm-x86") + (symlink "asm-x86" (string-append dir "/amd64/asm-x86_64"))) + ;; Install the fancy UTF-8 motd. + (mkdir-p (string-append out "/etc")) + (copy-file "console/motd.UTF8" + (string-append out "/etc/motd")) - ;; Install the BDF font for use by the console client. - (copy-file (assoc-ref inputs "unifont") - "unifont.gz") - (invoke "gunzip" "unifont.gz") - (mkdir-p datadir) - (copy-file "unifont" - (string-append datadir "/vga-system.bdf")) - #t)))) + ;; Install the BDF font for use by the console client. + (copy-file (assoc-ref inputs "unifont") + "unifont.gz") + (invoke "gunzip" "unifont.gz") + (mkdir-p datadir) + (copy-file "unifont" + (string-append datadir "/vga-system.bdf")))))) #:configure-flags ,#~(list (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib") diff --git a/gnu/packages/patches/hurd-64bit.patch b/gnu/packages/patches/hurd-64bit.patch new file mode 100644 index 0000000000..643550ad68 --- /dev/null +++ b/gnu/packages/patches/hurd-64bit.patch @@ -0,0 +1,56 @@ +Upstream-status: Taken from upstream: + . + +From d494333e7607ea03819adcfb69d89f8248ec2044 Mon Sep 17 00:00:00 2001 +From: Flavio Cruz +Date: Sun, 21 Jul 2024 17:20:55 -0400 +Subject: [PATCH] nfsd: fix -Werror=incompatible-pointer-types issues for + x86_64 +Content-Transfer-Encoding: 8bit +Content-Type: text/plain; charset=UTF-8 + +Message-ID: <3pmgbk2myx4phdb6wcso54solmybulrvbytols5md3nri2p2qp@xjmfmpvwjp6t> +--- + nfsd/cache.c | 2 +- + nfsd/ops.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/nfsd/cache.c b/nfsd/cache.c +index cd5524af..864739c0 100644 +--- a/nfsd/cache.c ++++ b/nfsd/cache.c +@@ -387,7 +387,7 @@ create_cached_handle (int fs, struct cache_handle *credc, file_t userport) + struct cache_handle *c; + int hash; + char *bp = fhandle.array + sizeof (int); +- size_t handlelen = NFS2_FHSIZE - sizeof (int); ++ mach_msg_type_number_t handlelen = NFS2_FHSIZE - sizeof (int); + mach_port_t newport, ref; + + /* Authenticate USERPORT so that we can call file_getfh on it. */ +diff --git a/nfsd/ops.c b/nfsd/ops.c +index 463a9c87..64e94b93 100644 +--- a/nfsd/ops.c ++++ b/nfsd/ops.c +@@ -292,7 +292,7 @@ op_write (struct cache_handle *c, + off_t offset; + size_t count; + error_t err; +- mach_msg_type_number_t amt; ++ vm_size_t amt; + char *bp; + struct stat st; + +@@ -583,7 +583,7 @@ op_readdir (struct cache_handle *c, + error_t err; + char *buf; + struct dirent *dp; +- size_t bufsize; ++ mach_msg_type_number_t bufsize; + int nentries; + int i; + int *replystart; +-- +Janneke Nieuwenhuizen | GNU LilyPond https://LilyPond.org +Freelance IT https://www.JoyOfSource.com | AvatarĀ® https://AvatarAcademy.com +