From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: Win64 testers? Date: Thu, 25 Jul 2024 15:39:51 +0000 Message-ID: References: <86le1q54bw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21499"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 25 20:45:12 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sX3Si-0005R5-38 for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Jul 2024 20:45:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sX3SA-0006ZF-Jb; Thu, 25 Jul 2024 14:44:38 -0400 Original-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 1sX0ZU-0003GI-7s for emacs-devel@gnu.org; Thu, 25 Jul 2024 11:40:00 -0400 Original-Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sX0ZR-0007xJ-Td; Thu, 25 Jul 2024 11:39:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1721921994; x=1722181194; bh=iAOvng2T76VoYmgl/Am2eVfT9TotgbNwxsJEfHSqwPw=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=xDhj6RTmQfzm5IhF7IE8Eh41fX7oUkbrmvpfBT+aG9HJEeTb4NDyNmtGBeq9eGn/5 CKIj0zMQMS2Le+Byzjd1yIo5JBnX6pqHP5W/PHdWK2nwb0VKbUT9XsxgK9C+ilaCZX 7EdkMLtszcrvgMjLQmw5qg9uDg2kkZra1d4hUWD2/Tk/3BulCfVJ9ap2LmZk9Jwo4X j8Rb6IOx50JdRA3wXZ4Tzp/ma5kfU+bCajsXFAn/ddM/lAKIUmB8taHqUVvUIhebh7 M787zQKXLxwShKaeCVUfZUFk3QqJEAUyDx1KeNLE/LK63iI3JpIQIJGl4TRH4/0sso u/BZGGFCS8Wzw== In-Reply-To: <86le1q54bw.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: ab194d2408dc8bed95ad38c06820cbb732089d82 Received-SPF: pass client-ip=185.70.43.22; envelope-from=pipcet@protonmail.com; helo=mail-4322.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 25 Jul 2024 14:44:35 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322100 Archived-At: On Thursday, July 25th, 2024 at 07:16, Eli Zaretskii wrote: > > Date: Wed, 24 Jul 2024 15:45:18 +0000 >=20 > > From: Pip Cet pipcet@protonmail.com > > > > Is anyone building the scratch/igc branch for/on win64 systems? I'm try= ing to do that on wine/msys2/mingw64 (not an actual Windows installation), = and there are a number of issues that need to be fixed, and I'm wondering w= hether I'm the first person to run into them. Quite possibly, they're speci= fic to wine. >=20 > I think you are indeed the first one. I use 32-bit MinGW, and for > that I have a working build of MPS (and can share the diffs if someone > wants them), but a 64-bit MinGW build of MPS will need other changes, > at least in some cases. It'd be great if you could share the diffs, so I could see where I've gone = wrong! I've got the 64-bit build with mps to start by now, but haven't real= ly tested it for stability much. It survives a few garbage collection cycle= s, at least. As a general question, would there be interest in CI for such systems? I'm = setting up something locally, but I've been trying to be careful so that th= e Dockerfiles I'm using should work on x86_64 GNU/Linux machines generally. > > - _setjmp_ex assumes 16-byte alignment of jmp_buf to store the XMM regi= sters, but we allocate handlers with 8-byte alignment in MPS builds. >=20 > Where and how do you see that? I'm not quite sure what you're asking. I saw this trying to run things in w= ine in a docker image on an x86_64 GNU/Linux machine, ran it in gdb.exe, fo= und the instruction causing the segfault, and fixed things so it wouldn't. https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/winecrt0/setjmp.c#L1= 23 is the instruction that segfaulted here. I'm not sure whether that's wha= t you were asking. The jump buffer is declared with 16-byte alignment here: https://gitlab.win= ehq.org/wine/wine/-/blob/master/include/msvcrt/setjmp.h#L50 A side effect of this is that LISP_ALIGNMENT is 16, which breaks MPS becaus= e vectorlike_nbytes rounds up to a multiple of LISP_ALIGNMENT, not just GCA= LIGNMENT. Looking over my diff, here's what I had to fix to get things to the current= stage on msys and msys2 (using MSYSTEM=3DMINGW64). - disable the sanity check in the Makefile, because backticks/pipes don't w= ork properly - make WINDRES include the --use-temp-file flag, for the same reason - wrap the add-name-to-file calls in loadup.el in with-demoted-errors (link= problems?) - force LISP_ALIGNMENT to be 8, not 16 - change my local generation size settings to be much more conservative for= the msys build. I think scratch/igc is fine, though. - make sys_setjmp and sys_longjmp use a larger buffer and memmove() the dat= a in it so it's 16-byte aligned - disable the failure exit on close_stream failure in sysdep.c, and silentl= y ignore such errors - trace the extra 'ztrillion' bignum in timefns.c - for the msys build, run autogen.sh outside of wine, since there are virtu= al memory issues inflooping the process otherwise I must confess I know little about the UCRT64 default MSYSTEM value. Maybe = it doesn't have the same problems. If anyone wants to study or reuse any of my efforts, let me know and I'll p= rovide a link to a public repository that can be used. Note that my Wine bu= ild environment, as far as I know, uses only free software, so it's in the = "technically free OS" category. (The Android build uses the SDK, which clai= ms to be decidedly non-free but makes an exception for those components whi= ch are indeed free; that means it's possible to build Android APKs without = paying for it, using non-free software, and run them on technically free An= droid versions if you can find those. AFAIK, the macOS build requires non-f= ree and expensive software both to compile and to run the executable?) Pip