all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrea Corallo <akrl@sdf.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	corwin@bru.st, 58318@debbugs.gnu.org, bartosz.bubak@gmail.com
Subject: bug#58318: 28.2; Emacs installed from package won't work with MinGW
Date: Fri, 07 Oct 2022 12:35:52 +0000	[thread overview]
Message-ID: <xjfilkv3j6f.fsf@ma.sdf.org> (raw)
In-Reply-To: <837d1bomsv.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 07 Oct 2022 15:12:00 +0300")

[-- Attachment #1: Type: text/plain, Size: 2208 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Lars Ingebrigtsen <larsi@gnus.org>
>> Cc: Andrea Corallo <akrl@sdf.org>,  corwin@bru.st,  bartosz.bubak@gmail.com,
>>   58318@debbugs.gnu.org
>> Date: Fri, 07 Oct 2022 14:04:57 +0200
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > 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.

>> > The startup code currently detects that libgccjit is unavailable or
>> > cannot be loaded, and if so, disables all the aspects of
>> > native-compilation: both JIT compilation of *.el and production of the
>> > trampolines.  I'm not aware that when we disable those two, we get
>> > Emacs that is not "fully functional".
>> 
>> If native compilation is disabled in a native-compiled Emacs, then 
>> 
>> (fset 'yes-or-no-p 'y-or-n-p)
>> 
>> doesn't work (for calls to `yes-or-no-p' in native-compiled code).
>> That's what I meant by "not fully functional".
>
> 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.

Oherwise another strategy would be to disable direct calls from lisp
native code into primitives on Windows, this indeed has a performance
impact.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-yes-or-no-p-to-native-comp-never-optimize-functi.patch --]
[-- Type: text/x-diff, Size: 975 bytes --]

From a6d736d532e20b6763a7ff1995f952fc293886dd Mon Sep 17 00:00:00 2001
From: Andrea Corallo <akrl@sdf.org>
Date: Fri, 7 Oct 2022 12:28:51 +0000
Subject: [PATCH] * Add `yes-or-no-p' to
 `native-comp-never-optimize-functions'.

* lisp/emacs-lisp/comp.el (native-comp-never-optimize-functions): Add
`yes-or-no-p'.
---
 lisp/emacs-lisp/comp.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 5ee10fcbca2..2812e53bcc2 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -104,7 +104,7 @@ native-comp-never-optimize-functions
   '(;; The following two are mandatory for Emacs to be working
     ;; correctly (see comment in `advice--add-function'). DO NOT
     ;; REMOVE.
-    macroexpand rename-buffer)
+    macroexpand rename-buffer yes-or-no-p)
   "Primitive functions to exclude from trampoline optimization."
   :type '(repeat symbol)
   :version "28.1")
-- 
2.35.1.577.g74cc1aa55f


  parent reply	other threads:[~2022-10-07 12:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 16:01 bug#58318: 28.2; Emacs installed from package won't work with MinGW Bartosz Bubak
2022-10-06  5:44 ` Eli Zaretskii
2022-10-06 13:09   ` Corwin Brust
2022-10-06 13:30     ` Lars Ingebrigtsen
2022-10-06 14:43       ` Eli Zaretskii
2022-10-07 11:42         ` Lars Ingebrigtsen
2022-10-07 11:59           ` Eli Zaretskii
2022-10-07 12:04             ` Lars Ingebrigtsen
2022-10-07 12:12               ` Eli Zaretskii
2022-10-07 12:28                 ` Lars Ingebrigtsen
2022-10-07 12:35                 ` Andrea Corallo [this message]
2022-10-07 12:43                   ` Lars Ingebrigtsen
2022-10-07 12:54                   ` Eli Zaretskii
2022-10-07 13:02                     ` Lars Ingebrigtsen
2022-10-07 13:44                       ` Eli Zaretskii
2022-10-07 13:47                         ` Lars Ingebrigtsen
2022-10-07 13:04                     ` Andrea Corallo
2022-10-07 13:48                       ` Eli Zaretskii
2022-10-07 13:54                         ` Andrea Corallo
2022-10-07 14:03                           ` Eli Zaretskii
2022-10-07 14:35                             ` Andrea Corallo
2022-10-07 15:27                               ` Eli Zaretskii
2022-10-07 15:34                                 ` Corwin Brust
2022-10-07 15:43                                   ` Eli Zaretskii
2022-10-07 15:47                                     ` Corwin Brust
2022-10-07 19:11                                       ` Eli Zaretskii
2022-10-07 17:15                                     ` Andrea Corallo
2022-10-07 19:15                                       ` Eli Zaretskii
2022-10-07 15:49                                 ` Andrea Corallo
2022-10-07 15:52                               ` Corwin Brust
2022-10-07 19:14                                 ` Eli Zaretskii
2022-10-08 12:56                                   ` Lars Ingebrigtsen
2022-10-08 13:03                                     ` Eli Zaretskii
2022-10-08 13:10                                       ` Lars Ingebrigtsen
2022-10-08 14:28                                         ` Eli Zaretskii
2022-10-08 13:28                                   ` Andrea Corallo
2022-10-11 19:23                                     ` Andrea Corallo
2022-10-11 19:29                                       ` Eli Zaretskii
2022-10-11 20:45                                         ` Andrea Corallo
2022-10-12  5:21                                           ` Eli Zaretskii
2022-10-12  8:14                                             ` Andrea Corallo
2022-10-12 12:50                                               ` Eli Zaretskii
2022-10-12 14:55                                                 ` Andrea Corallo
2022-10-12 15:35                                                   ` Eli Zaretskii
2022-10-13 13:26                                                     ` Andrea Corallo
2022-10-06 14:41     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjfilkv3j6f.fsf@ma.sdf.org \
    --to=akrl@sdf.org \
    --cc=58318@debbugs.gnu.org \
    --cc=bartosz.bubak@gmail.com \
    --cc=corwin@bru.st \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.