From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#58318: 28.2; Emacs installed from package won't work with MinGW Date: Fri, 07 Oct 2022 13:04:55 +0000 Message-ID: References: <835ygxsdyu.fsf@gnu.org> <87zge9w049.fsf@gnus.org> <83k05dovwq.fsf@gnu.org> <87a667x3l4.fsf@gnus.org> <83edvjondh.fsf@gnu.org> <87sfjzvnyu.fsf@gnus.org> <837d1bomsv.fsf@gnu.org> <83wn9bn69q.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="24409"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: larsi@gnus.org, corwin@bru.st, 58318@debbugs.gnu.org, bartosz.bubak@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 07 16:58:34 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ogoo5-00068i-3z for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Oct 2022 16:58:33 +0200 Original-Received: from localhost ([::1]:60970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogoo3-0004O5-0j for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Oct 2022 10:58:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogn3D-0007t9-Kp for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 09:06:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogn3C-0000oA-KB for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 09:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogn3C-0007tl-7w for bug-gnu-emacs@gnu.org; Fri, 07 Oct 2022 09:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Oct 2022 13:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58318 X-GNU-PR-Package: emacs Original-Received: via spool by 58318-submit@debbugs.gnu.org id=B58318.166514790830283 (code B ref 58318); Fri, 07 Oct 2022 13:06:02 +0000 Original-Received: (at 58318) by debbugs.gnu.org; 7 Oct 2022 13:05:08 +0000 Original-Received: from localhost ([127.0.0.1]:34788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogn2K-0007sM-CV for submit@debbugs.gnu.org; Fri, 07 Oct 2022 09:05:08 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:52507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogn2I-0007sD-TB for 58318@debbugs.gnu.org; Fri, 07 Oct 2022 09:05:07 -0400 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 297D4tra002313 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 7 Oct 2022 13:04:55 GMT In-Reply-To: <83wn9bn69q.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 07 Oct 2022 15:54:25 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244810 Archived-At: Eli Zaretskii writes: >> From: Andrea Corallo >> Cc: Lars Ingebrigtsen , corwin@bru.st, bartosz.bubak@gma= il.com, >> 58318@debbugs.gnu.org >> Date: Fri, 07 Oct 2022 12:35:52 +0000 >> >> >> > Maybe there's a misunderstanding of what you meant by "if a compiler >> >> > isn't present". By "the compiler" do you mean libgccjit, or is it = GCC >> >> > and Binutils (or maybe all 3 together)? IOW, are you talking about >> >> > the ability to load existing *.eln files, or are you talking about = the >> >> > ability to both load existing *.eln files and produce new ones? >> >> >> >> I'm talking about trampolines, nothing else. >> > >> > Trampoline generation requires all the 3 components to be present, >> > AFAIK. Andrea, am I right? >> >> AFAIU only libgccjit and Binutils are necessary, but libgccjit *is* GCC >> (in the sense another frontend fo the GNU Compiler Collection). I >> *think* gcc the binary (read the C frontend) should not be required. >> But I don't know how distros package libgccjit and gcc, there might be >> some dendency I'm not aware of. > > I didn't mean gcc, I meant cc1. But maybe libgccjit can play its > role, I don't know. > >> > If it indeed doesn't work (and I wasn't aware it didn't work), we >> > should try fixing it, if that is feasible. >> >> Yes because `yes-or-no-p' is a primitive, so with no trampolines its >> redefinition is not functional. >> >> A quick ad-hoc fix for `yes-or-no-p' is attached. It does not have a >> perf impact as `yes-or-no-p' will have to wait for the user input >> anyway, if okay I can push it. > > What about other primitives? fset can be used for more than just this > one. > >> Oherwise another strategy would be to disable direct calls from lisp >> native code into primitives on Windows, this indeed has a performance >> impact. > > How is this relevant only to Windows? Windows is the only system where a native compiled Emacs can start even if libgccjit is not present. On GNU/Linux we get and error at load time from the dynamic linker in case. As a consequence on GNU/Linux Emacs is always capable of producing trampolines when needed. > And what do you mean by "disable direct calls from Lisp native code > into primitives"? I don't think I understand what this would do in > practice. Native compiled elisp calls directly into primitive functions not to go through funcall. For this reason when a primitive is redefined we need to produce a trampoline in order to forward these calls to the funcall machinery. If we disable all of this optimization the issue disappears but indeed that's not good from a performance point of view. Indeed the other option is to precompile all trampoline AOT when we know libgccjit is available. It is actually very simple with something like: (mapatoms (=CE=BB (f) (when (subr-primitive-p (symbol-function f)) (or (comp-trampoline-search f) (comp-trampoline-compile f))))) It was not consired worth as trampoline production is very quick, but might be worth at least for Windows platforms for the discussed reason. Andrea