From unknown Mon Jun 23 13:14:16 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63940] [PATCH] gnu: sbcl: fix build on riscv64-linux. Resent-From: Z572 <873216071@qq.com> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 07 Jun 2023 05:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63940 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63940@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168611660317105 (code B ref -1); Wed, 07 Jun 2023 05:44:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jun 2023 05:43:23 +0000 Received: from localhost ([127.0.0.1]:53384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6lx3-0004Rl-9N for submit@debbugs.gnu.org; Wed, 07 Jun 2023 01:43:23 -0400 Received: from lists.gnu.org ([209.51.188.17]:47848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <873216071@qq.com>) id 1q6lww-0004RU-Mh for submit@debbugs.gnu.org; Wed, 07 Jun 2023 01:43:20 -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 <873216071@qq.com>) id 1q6lww-0002jL-As for guix-patches@gnu.org; Wed, 07 Jun 2023 01:43:14 -0400 Received: from out203-205-221-192.mail.qq.com ([203.205.221.192]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <873216071@qq.com>) id 1q6lwr-0005i0-Gy for guix-patches@gnu.org; Wed, 07 Jun 2023 01:43:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1686116575; bh=vZxS3MJxDP2eZx+88lWq5rSO4Qb7Mww13ol3jmDll2w=; h=From:To:Subject:Date; b=TXaZs9hozSkzI6vwQ2MXlt+YOC+LeVswrSAIiOHwHqFf5SNk5JNtGzaZasQOYqdnP 2OYGpkNZCPswJhipTo0s1iSmULlzSGNhvJh+leFi+Xmhv3P0OeVMdXuVm0x8M56VDG D587i6naLAjyGLSqsCw6rjxrY5Ooc+4zqcTvQUek= Received: from localhost.localdomain ([111.0.51.197]) by newxmesmtplogicsvrszc2-0.qq.com (NewEsmtp) with SMTP id AB50D40A; Wed, 07 Jun 2023 13:42:53 +0800 X-QQ-mid: xmsmtpt1686116573to63brey3 Message-ID: X-QQ-XMAILINFO: My/elTziho8Nd3tGrwKrmmLctm7swgrwpPqQW9uVMVfSuXAn+7UPsc8lvmtlWM Yp6hz6Mj/Cu0/LPuUHfOQ4mBeLutvgtivo5KPDWOBa/8aLMf3aIJleA/5PdO1Ed4FSMr4XC78Wad /UjINmDlb5/GmpYBtI+IO3aqvTrf+Y5uTLVlPDrSSCiSgck+CGQS0o4bf0WdNWzSEBoHbJoHxA7w bkZ9XjvJlM/viD4BhdmiCzNQQ2Bwmp3NSaIRxe8DnjaUrhZkC1glmadQxSi5u6ersuTVGvHWzbWI 45zFDLCylahL9H6b6cmq8nuM1vTlSatZ2mvSKUgyQgyhxQqS8k7SxXQOAs3hZCdiAfL2kYy4yWIE d5v1nL7IwczxFWanDNqETN+/luzA5MeRRtrzekh2rTxYzYjQUtJjm3etP53+K/h6+GyFM7c6W3pb UX/H4fvUt1hdIOAohpURcP7tdQgLZE97WpOQUJD5r4I20Sgukp4nVI4A1NUeR7YAT6v7r486fyVz UWwlcmurBwOQY5c8n5icytRysmoNzORCozW3G00o5YNzz/Wwr06utWHMW9z4a4WnY3R4fKnZzqUu afB4CEkXlfAYqVyfzjjPADsIdccmJNFDd9/Ca6hbSyb5Y2u9x9EM49L1seE/ozYnt1Ruz9xgu+Mw s1Obv96qyTg8FI8mlXIttIaI4uQKUuWHdfyTK3AfLa36FoNozIcpPC4S0MXqUvS2xRdvGEk9qP0w a6iqR+sUzoXdHdyI1zkjhHqurXISc8Tseu8lVoRtwP/jKq4LUT1hFL2EKNtFeadRZWyyFgtcJ0g6 OgvL91TphAAHm3JPr1g1p59tzRIHdC4kllH2Fn6O98T8mpW+b+IIqukv9I0mJAgUHdSTKfECqJ9g KbjoaIS2Z+O7EVvxqL3XAOZhFQflsC6YXDMFimCxTs/zYG5a5tdx8CirzOQwm0RGYDQsAApJbM From: Z572 <873216071@qq.com> Date: Wed, 7 Jun 2023 13:42:52 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=203.205.221.192; envelope-from=873216071@qq.com; helo=out203-205-221-192.mail.qq.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) * gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch: new file. * gnu/local.mk(dist_patch_DATA): register it. * gnu/packages/lisp.scm (sbcl): [source]: Use it here. --- gnu/local.mk | 1 + gnu/packages/lisp.scm | 3 + ...sbcl-riscv-Make-contribs-build-again.patch | 71 +++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch diff --git a/gnu/local.mk b/gnu/local.mk index f9afb433e6..254037a3af 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1895,6 +1895,7 @@ dist_patch_DATA = \ %D%/packages/patches/sbcl-clml-fix-types.patch \ %D%/packages/patches/sbcl-eazy-gnuplot-skip-path-check.patch \ %D%/packages/patches/sbcl-png-fix-sbcl-compatibility.patch \ + %D%/packages/patches/sbcl-riscv-Make-contribs-build-again.patch \ %D%/packages/patches/scalapack-gcc-10-compilation.patch \ %D%/packages/patches/scheme48-tests.patch \ %D%/packages/patches/scons-test-environment.patch \ diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 9e896cc8a5..296ed6b5f2 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -23,6 +23,7 @@ ;;; Copyright © 2022 Joeke de Graaf ;;; Copyright © 2021, 2022 jgart ;;; Copyright © 2022 ( +;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -440,6 +441,8 @@ (define-public sbcl (sha256 (base32 "11ji5n65l31249r0v7hm0wc0yk2ila0y746nj36xn1cxrwh0gjc9")) (modules '((guix build utils))) + ;; backport from upstream. + (patches (search-patches "sbcl-riscv-Make-contribs-build-again.patch")) (snippet '(begin ;; Don't force ARMv5. diff --git a/gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch b/gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch new file mode 100644 index 0000000000..85b96e1b20 --- /dev/null +++ b/gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch @@ -0,0 +1,71 @@ +From 8704f528f227f587d0e06dfd2f807aeca7a69a71 Mon Sep 17 00:00:00 2001 +From: Charles Zhang +Date: Thu, 1 Jun 2023 16:39:26 +0200 +Subject: [PATCH] riscv: Make contribs build again. + +The issue was that the LINKAGE_TEMP_REG being NL3 was a C argument +register, so of course that caused clashing on C call-out, causing +problems with run-program. Going back to NL7 didn't work either +because it wasn't getting saved before entry into the trampoline. The +code here used to have NL7 before the trampoline code was gutted and +then restored, so I'm wondering how this ever worked before, because +it definitely did. Pick LIP as the TEMP_REG now because not only does +it get saved, it's also the least likely thing to get disturbed by +clobbering. + +Fixes #lp2002930. + +Also remove assembly routine printing because it doesn't need to be +part of the build script (unlike the other files in output/ which +can't trivially be recovered from a built image), and because not all +disassembler printers have been written on riscv yet. +--- + NEWS | 3 +++ + make-target-2-load.lisp | 4 ---- + src/runtime/riscv-arch.c | 2 +- + 3 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/NEWS b/NEWS +index 17537ff92..5c0f7777b 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,5 +1,8 @@ + ;;;; -*- coding: utf-8; fill-column: 78 -*- + ++changes relative to sbcl-2.3.5: ++ * bug fix: riscv can build contribs again. ++ + changes in sbcl-2.3.5 relative to sbcl-2.3.4: + * enhancement: Unicode support has been updated to support version 15.0.0 of + the Unicode standard, including addition of characters and their collation +diff --git a/make-target-2-load.lisp b/make-target-2-load.lisp +index 885ebda74..b9a1a1e36 100644 +--- a/make-target-2-load.lisp ++++ b/make-target-2-load.lisp +@@ -6,10 +6,6 @@ + (defvar *compile-files-p* nil) + (load (merge-pathnames "src/cold/warm.lisp" *load-pathname*)) + +-(with-open-file (stream "output/asm-routines.txt" :direction :output +- :if-does-not-exist :create :if-exists :supersede) +- (sb-c:dis sb-fasl:*assembler-routines* stream)) +- + ;; sb-xref-for-internals is actively harmful to tree-shaking. + ;; Remove some symbols to make the hide-packages test pass. + #+sb-xref-for-internals +diff --git a/src/runtime/riscv-arch.c b/src/runtime/riscv-arch.c +index 6c1994829..062623899 100644 +--- a/src/runtime/riscv-arch.c ++++ b/src/runtime/riscv-arch.c +@@ -159,7 +159,7 @@ arch_install_interrupt_handlers(void) + * Linkage entry size is 8 or 20, because we need 2 instructions for the 32-bit case and we need 3 instructions and an 8 byte address in the 64-bit case. + */ + +-#define LINKAGE_TEMP_REG reg_NL3 ++#define LINKAGE_TEMP_REG reg_LIP // Lisp needs to save before entry. + + void arch_write_linkage_table_entry(int index, void *target_addr, int datap) + { +-- +2.40.1 + -- 2.40.1 From unknown Mon Jun 23 13:14:16 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Z572 <873216071@qq.com> Subject: bug#63940: closed (Re: [bug#63940] [PATCH] gnu: sbcl: fix build on riscv64-linux.) Message-ID: References: X-Gnu-PR-Message: they-closed 63940 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 63940@debbugs.gnu.org Date: Wed, 07 Jun 2023 09:57:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1686131823-29465-1" This is a multi-part message in MIME format... ------------=_1686131823-29465-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #63940: [PATCH] gnu: sbcl: fix build on riscv64-linux. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 63940@debbugs.gnu.org. --=20 63940: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63940 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1686131823-29465-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 63940-done) by debbugs.gnu.org; 7 Jun 2023 09:56:23 +0000 Received: from localhost ([127.0.0.1]:53611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6ptv-0007eE-Cp for submit@debbugs.gnu.org; Wed, 07 Jun 2023 05:56:23 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:45530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6pts-0007do-1V for 63940-done@debbugs.gnu.org; Wed, 07 Jun 2023 05:56:22 -0400 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-30d5931d17aso3456831f8f.3 for <63940-done@debbugs.gnu.org>; Wed, 07 Jun 2023 02:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686131774; x=1688723774; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=j1uKEXXsE6rD6rFWaqLaCKZlUOjC0A+NDX1Zp5TNCGc=; b=qPRsC3M9PsqPQ12x4I/g2wZPpz1N3JHaMlIwt4bKGlnPjRhL/9LHt8B8HEwWvdcBt4 y77u8bEy10vu7YR/rULwOdnAXERhtLh92PakAGHQSpYl36+/8YxixZS0URWDd/dv8t3T JvjYnTiLcbWg6ezyOKv3R2OZK0DJE6L83RblU+Q+BthMTis+BIZxrynyYGI+gNFtkWgN gAlScQPiuAYDW+g33zPsfVuyCL5Ep2WwH/C2dP8/ZxrMu8qRnwKEyV4wFiOmBSD2p8B+ kGlLtMN2RzWmDzUpDmWepVvHYyFpjzPTZGJOFY4CB0Wt0p9PSV+e1BVBJ0CpjbZJiv5E 7tqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686131774; x=1688723774; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j1uKEXXsE6rD6rFWaqLaCKZlUOjC0A+NDX1Zp5TNCGc=; b=jhxKVWSvOr47m0o8qFI+XaykIACgdyjPjwlYXfcu9EEVj3qfz8Ot3ognJWF8jjBe0R qr9zsS6c4hZ5OardNXU533418fEzI5Atp9sjVM4+odT7pUVmYLScRfzVEHVStTAUssMV xOA5Mr8leMUuao4yFFeEFcXr1gQ4zXRIR4PjQ4q7rhtbA5ekEwTCHST6xutns8pRxBoE rI3miUReCsVI4T0q7SY9vE48z42TQ7WiWbb+t2x3J9KBXrf5rDwYx08BEQgneQXTkbJ5 HR9INvfIdXq2AWWprvEHA8ysIsCxQTgRrfJ0uRXJl3T4RCSrT4POfKQW6VIUicGC4vNv mMpQ== X-Gm-Message-State: AC+VfDxSD+hT/gD694Am68faYTNAxcmKNhxqRnu5+HLMPJSH7IegiM+p 2KmBsUP3u8FHEGuDmguLh3Q= X-Google-Smtp-Source: ACHHUZ6nnrUy7WCrHsuKUV8cICN0yhfRFWStVk9Zsz+7GknAHtMdbTgzE1do+OfcIUcUo+6rvy6/nw== X-Received: by 2002:adf:fccb:0:b0:30c:2bbf:bf75 with SMTP id f11-20020adffccb000000b0030c2bbfbf75mr3559620wrs.26.1686131774009; Wed, 07 Jun 2023 02:56:14 -0700 (PDT) Received: from localhost ([37.46.46.3]) by smtp.gmail.com with ESMTPSA id j11-20020a5d564b000000b00307c8d6b4a0sm15109177wrw.26.2023.06.07.02.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 02:56:13 -0700 (PDT) Date: Wed, 7 Jun 2023 12:56:11 +0300 From: Efraim Flashner To: Z572 <873216071@qq.com> Subject: Re: [bug#63940] [PATCH] gnu: sbcl: fix build on riscv64-linux. Message-ID: Mail-Followup-To: Efraim Flashner , Z572 <873216071@qq.com>, 63940-done@debbugs.gnu.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="d9r5lHRQXOQxBE8h" Content-Disposition: inline In-Reply-To: X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 63940-done Cc: 63940-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --d9r5lHRQXOQxBE8h Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thanks. I wasn't looking forward to having to fix this one myself. Patch pushed! --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --d9r5lHRQXOQxBE8h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmSAVDgACgkQQarn3Mo9 g1GYPBAAmwwiBraNiMt1hNH5N0cXiH4auWM8KtI3FIz8zgGX7LnnKg3AW29GZ9Xh CxqH6XwPXA3Q8CSGSU1QfUdt4frDjmsJViYxXi+VjPyVmUWqBd4TBbH68Y/Ij4Pr yB40znLObly8N9xSwm+W5Xf+B2vxbWxNfWaMaKCLTqv+BD6PmHyQPn5MSsZDrfA1 eEZRXZou8hLhH4Jkhe5NMH58UdZNngZAwGkowGUpb2V/bmNLC2b0d4Bzr5eg/BgY gdn2KBp+YI3FiqB7hYTHG3iEaRqmbyW0zY97ytdZv86Q1gznzR7JybeinHfCjx9X uzbl9HDsuzeYCaCBQgUzijF48bBW19/IVfNcaU11xsTIHuY/FseZM/TFmJj82jZu 88uBXCZ5ZUpm1A33sSPyatzpchR0LHGqQaF76fBQPFFTOfPdAjotxOncAYK/GTY0 MLsTit79M65qax2yDNNnIIN1RLhTo7oGH59PxvailsYah3S7dTbG5ba5uLHamQCd yeEvEtv+mS3ceT0x+ttOFF6VYz0CP5juUSOwm/h3mReEEb7jfcksNyRq8DGInF7o S0Ax9XdPNEam3KvAlHDYfP3Z1nN+gBGDR07bjbtBEcOK88N89yFGx04TNVWx7ryg Pr0i3OuK5zDbO7NxTZQm7C8bd5yrZ6MzDyONLG97TIY/Jgan8SY= =TPOs -----END PGP SIGNATURE----- --d9r5lHRQXOQxBE8h-- ------------=_1686131823-29465-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 7 Jun 2023 05:43:23 +0000 Received: from localhost ([127.0.0.1]:53384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6lx3-0004Rl-9N for submit@debbugs.gnu.org; Wed, 07 Jun 2023 01:43:23 -0400 Received: from lists.gnu.org ([209.51.188.17]:47848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <873216071@qq.com>) id 1q6lww-0004RU-Mh for submit@debbugs.gnu.org; Wed, 07 Jun 2023 01:43:20 -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 <873216071@qq.com>) id 1q6lww-0002jL-As for guix-patches@gnu.org; Wed, 07 Jun 2023 01:43:14 -0400 Received: from out203-205-221-192.mail.qq.com ([203.205.221.192]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <873216071@qq.com>) id 1q6lwr-0005i0-Gy for guix-patches@gnu.org; Wed, 07 Jun 2023 01:43:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1686116575; bh=vZxS3MJxDP2eZx+88lWq5rSO4Qb7Mww13ol3jmDll2w=; h=From:To:Subject:Date; b=TXaZs9hozSkzI6vwQ2MXlt+YOC+LeVswrSAIiOHwHqFf5SNk5JNtGzaZasQOYqdnP 2OYGpkNZCPswJhipTo0s1iSmULlzSGNhvJh+leFi+Xmhv3P0OeVMdXuVm0x8M56VDG D587i6naLAjyGLSqsCw6rjxrY5Ooc+4zqcTvQUek= Received: from localhost.localdomain ([111.0.51.197]) by newxmesmtplogicsvrszc2-0.qq.com (NewEsmtp) with SMTP id AB50D40A; Wed, 07 Jun 2023 13:42:53 +0800 X-QQ-mid: xmsmtpt1686116573to63brey3 Message-ID: X-QQ-XMAILINFO: My/elTziho8Nd3tGrwKrmmLctm7swgrwpPqQW9uVMVfSuXAn+7UPsc8lvmtlWM Yp6hz6Mj/Cu0/LPuUHfOQ4mBeLutvgtivo5KPDWOBa/8aLMf3aIJleA/5PdO1Ed4FSMr4XC78Wad /UjINmDlb5/GmpYBtI+IO3aqvTrf+Y5uTLVlPDrSSCiSgck+CGQS0o4bf0WdNWzSEBoHbJoHxA7w bkZ9XjvJlM/viD4BhdmiCzNQQ2Bwmp3NSaIRxe8DnjaUrhZkC1glmadQxSi5u6ersuTVGvHWzbWI 45zFDLCylahL9H6b6cmq8nuM1vTlSatZ2mvSKUgyQgyhxQqS8k7SxXQOAs3hZCdiAfL2kYy4yWIE d5v1nL7IwczxFWanDNqETN+/luzA5MeRRtrzekh2rTxYzYjQUtJjm3etP53+K/h6+GyFM7c6W3pb UX/H4fvUt1hdIOAohpURcP7tdQgLZE97WpOQUJD5r4I20Sgukp4nVI4A1NUeR7YAT6v7r486fyVz UWwlcmurBwOQY5c8n5icytRysmoNzORCozW3G00o5YNzz/Wwr06utWHMW9z4a4WnY3R4fKnZzqUu afB4CEkXlfAYqVyfzjjPADsIdccmJNFDd9/Ca6hbSyb5Y2u9x9EM49L1seE/ozYnt1Ruz9xgu+Mw s1Obv96qyTg8FI8mlXIttIaI4uQKUuWHdfyTK3AfLa36FoNozIcpPC4S0MXqUvS2xRdvGEk9qP0w a6iqR+sUzoXdHdyI1zkjhHqurXISc8Tseu8lVoRtwP/jKq4LUT1hFL2EKNtFeadRZWyyFgtcJ0g6 OgvL91TphAAHm3JPr1g1p59tzRIHdC4kllH2Fn6O98T8mpW+b+IIqukv9I0mJAgUHdSTKfECqJ9g KbjoaIS2Z+O7EVvxqL3XAOZhFQflsC6YXDMFimCxTs/zYG5a5tdx8CirzOQwm0RGYDQsAApJbM From: Z572 <873216071@qq.com> To: guix-patches@gnu.org Subject: [PATCH] gnu: sbcl: fix build on riscv64-linux. Date: Wed, 7 Jun 2023 13:42:52 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=y Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=203.205.221.192; envelope-from=873216071@qq.com; helo=out203-205-221-192.mail.qq.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HELO_DYNAMIC_IPADDR=1.951, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) * gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch: new file. * gnu/local.mk(dist_patch_DATA): register it. * gnu/packages/lisp.scm (sbcl): [source]: Use it here. --- gnu/local.mk | 1 + gnu/packages/lisp.scm | 3 + ...sbcl-riscv-Make-contribs-build-again.patch | 71 +++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch diff --git a/gnu/local.mk b/gnu/local.mk index f9afb433e6..254037a3af 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1895,6 +1895,7 @@ dist_patch_DATA = \ %D%/packages/patches/sbcl-clml-fix-types.patch \ %D%/packages/patches/sbcl-eazy-gnuplot-skip-path-check.patch \ %D%/packages/patches/sbcl-png-fix-sbcl-compatibility.patch \ + %D%/packages/patches/sbcl-riscv-Make-contribs-build-again.patch \ %D%/packages/patches/scalapack-gcc-10-compilation.patch \ %D%/packages/patches/scheme48-tests.patch \ %D%/packages/patches/scons-test-environment.patch \ diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm index 9e896cc8a5..296ed6b5f2 100644 --- a/gnu/packages/lisp.scm +++ b/gnu/packages/lisp.scm @@ -23,6 +23,7 @@ ;;; Copyright © 2022 Joeke de Graaf ;;; Copyright © 2021, 2022 jgart ;;; Copyright © 2022 ( +;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -440,6 +441,8 @@ (define-public sbcl (sha256 (base32 "11ji5n65l31249r0v7hm0wc0yk2ila0y746nj36xn1cxrwh0gjc9")) (modules '((guix build utils))) + ;; backport from upstream. + (patches (search-patches "sbcl-riscv-Make-contribs-build-again.patch")) (snippet '(begin ;; Don't force ARMv5. diff --git a/gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch b/gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch new file mode 100644 index 0000000000..85b96e1b20 --- /dev/null +++ b/gnu/packages/patches/sbcl-riscv-Make-contribs-build-again.patch @@ -0,0 +1,71 @@ +From 8704f528f227f587d0e06dfd2f807aeca7a69a71 Mon Sep 17 00:00:00 2001 +From: Charles Zhang +Date: Thu, 1 Jun 2023 16:39:26 +0200 +Subject: [PATCH] riscv: Make contribs build again. + +The issue was that the LINKAGE_TEMP_REG being NL3 was a C argument +register, so of course that caused clashing on C call-out, causing +problems with run-program. Going back to NL7 didn't work either +because it wasn't getting saved before entry into the trampoline. The +code here used to have NL7 before the trampoline code was gutted and +then restored, so I'm wondering how this ever worked before, because +it definitely did. Pick LIP as the TEMP_REG now because not only does +it get saved, it's also the least likely thing to get disturbed by +clobbering. + +Fixes #lp2002930. + +Also remove assembly routine printing because it doesn't need to be +part of the build script (unlike the other files in output/ which +can't trivially be recovered from a built image), and because not all +disassembler printers have been written on riscv yet. +--- + NEWS | 3 +++ + make-target-2-load.lisp | 4 ---- + src/runtime/riscv-arch.c | 2 +- + 3 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/NEWS b/NEWS +index 17537ff92..5c0f7777b 100644 +--- a/NEWS ++++ b/NEWS +@@ -1,5 +1,8 @@ + ;;;; -*- coding: utf-8; fill-column: 78 -*- + ++changes relative to sbcl-2.3.5: ++ * bug fix: riscv can build contribs again. ++ + changes in sbcl-2.3.5 relative to sbcl-2.3.4: + * enhancement: Unicode support has been updated to support version 15.0.0 of + the Unicode standard, including addition of characters and their collation +diff --git a/make-target-2-load.lisp b/make-target-2-load.lisp +index 885ebda74..b9a1a1e36 100644 +--- a/make-target-2-load.lisp ++++ b/make-target-2-load.lisp +@@ -6,10 +6,6 @@ + (defvar *compile-files-p* nil) + (load (merge-pathnames "src/cold/warm.lisp" *load-pathname*)) + +-(with-open-file (stream "output/asm-routines.txt" :direction :output +- :if-does-not-exist :create :if-exists :supersede) +- (sb-c:dis sb-fasl:*assembler-routines* stream)) +- + ;; sb-xref-for-internals is actively harmful to tree-shaking. + ;; Remove some symbols to make the hide-packages test pass. + #+sb-xref-for-internals +diff --git a/src/runtime/riscv-arch.c b/src/runtime/riscv-arch.c +index 6c1994829..062623899 100644 +--- a/src/runtime/riscv-arch.c ++++ b/src/runtime/riscv-arch.c +@@ -159,7 +159,7 @@ arch_install_interrupt_handlers(void) + * Linkage entry size is 8 or 20, because we need 2 instructions for the 32-bit case and we need 3 instructions and an 8 byte address in the 64-bit case. + */ + +-#define LINKAGE_TEMP_REG reg_NL3 ++#define LINKAGE_TEMP_REG reg_LIP // Lisp needs to save before entry. + + void arch_write_linkage_table_entry(int index, void *target_addr, int datap) + { +-- +2.40.1 + -- 2.40.1 ------------=_1686131823-29465-1--