From: "Nicolas Bértolo" <nicolasbertolo@gmail.com>
To: Andrea Corallo <akrl@sdf.org>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: [PATCH] [WIP] Port feature/native-comp to Windows.
Date: Wed, 13 May 2020 12:00:45 -0300 [thread overview]
Message-ID: <CAFnS-OnQWJtg=ok8mPkQnfAKRLDZ5Fpf-40W3O+br5GYR7_4gw@mail.gmail.com> (raw)
In-Reply-To: <xjf8shvucrs.fsf@sdf.org>
> Is there some specific reason for this choice?
The problem is that w32_delayed_load will return a NULL handle if
Fassq (library_id, Vlibrary_cache)) returns non-nil. The only way to make this
work is to avoid adding gccjit to Vlibrary_cache if the initialization failed.
This would be different from what the code for loading other libraries does.
I don't know if it is worth it to introduce this difference.
Another issue is that this code is called from maybe_defer_native_compilation().
A version that searches for libgccjit all the time would call LoadLibrary() and
perform an expensive search throughout the filesystem everytime `defalias` is
called.
>> PS: Shall I open a bug where we can track this?
> If affect all Emacs I think is the right thing to do.
I referred to opening a bug report for the work related to porting
feature/native-comp to Windows.
El mié., 13 may. 2020 a las 11:31, Andrea Corallo (<akrl@sdf.org>) escribió:
>
> Nicolas Bértolo <nicolasbertolo@gmail.com> writes:
>
> >> I think Qjson is a refuse from kill and yank.
> >
> > Heh, it turns out that fixing that uncovered a bug. We need to clear
> > Vlibrary_cache when loading a dump (or prevent it from being dumped) because
> > otherwise it will have a `gccjit` entry from when temacs loaded libgccjit and
> > then w32_delayed_load() will think that libgccjit is already loaded in the
> > process.
> >
> > New version attached.
>
> Hi Nicolas, thanks
>
> + static bool tried_to_initialize_once;
> + static bool gccjit_initialized;
> +
> + if (!tried_to_initialize_once)
> + {
> + tried_to_initialize_once = true;
> + Lisp_Object status;
> + gccjit_initialized = init_gccjit_functions ();
> + status = gccjit_initialized ? Qt : Qnil;
> + Vlibrary_cache = Fcons (Fcons (Qgccjit, status), Vlibrary_cache);
> + }
> +
> + if (mandatory && !gccjit_initialized)
> + xsignal1(Qnative_compiler_error, build_string("libgccjit not found"));
> +
> + return gccjit_initialized;
>
> I see you have introduced tried_to_initialize_once. I'm not sure this
> is convenient because a user could, after a failed attempt, fix his
> environment to load libgccjit and do it without restarting Emacs.
>
> Is there some specific reason for this choice?
>
> > PS: Shall I open a bug where we can track this?
>
> If affect all Emacs I think is the right thing to do.
>
> > Nicolas
>
> Thanks!
>
> Andrea
> --
> akrl@sdf.org
next prev parent reply other threads:[~2020-05-13 15:00 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-08 19:55 [PATCH] [WIP] Port feature/native-comp to Windows Nicolas Bertolo
2020-05-08 22:00 ` Andrea Corallo
2020-05-08 22:11 ` Nicolas Bértolo
2020-05-08 22:22 ` Andrea Corallo
2020-05-08 22:23 ` Nicolas Bértolo
2020-05-08 22:27 ` Andrea Corallo
2020-05-08 23:18 ` Stefan Monnier
2020-05-09 6:07 ` Eli Zaretskii
2020-05-09 15:28 ` Nicolas Bértolo
2020-05-09 15:48 ` Eli Zaretskii
2020-05-09 17:09 ` Andrea Corallo
2020-05-10 16:36 ` Nicolas Bértolo
2020-05-10 17:08 ` Eli Zaretskii
2020-05-10 17:50 ` Nicolas Bértolo
2020-05-10 18:22 ` Eli Zaretskii
2020-05-10 19:02 ` Nicolas Bértolo
2020-05-10 19:16 ` Eli Zaretskii
2020-05-10 19:41 ` Nicolas Bértolo
2020-05-10 19:50 ` Andrea Corallo
2020-05-10 19:55 ` Nicolas Bértolo
2020-05-10 20:01 ` Andrea Corallo
2020-05-11 14:19 ` Eli Zaretskii
2020-05-11 14:17 ` Eli Zaretskii
2020-05-11 15:20 ` Nicolas Bértolo
2020-05-11 16:19 ` Eli Zaretskii
2020-05-11 16:43 ` Andrea Corallo
2020-05-11 16:44 ` Nicolas Bértolo
2020-05-11 17:05 ` Eli Zaretskii
2020-05-11 18:19 ` Fabrice Popineau
2020-05-11 18:37 ` Andrea Corallo
2020-05-11 18:48 ` Eli Zaretskii
2020-05-11 19:27 ` Stefan Monnier
2020-05-11 19:42 ` Fabrice Popineau
2020-05-12 2:46 ` Nicolas Bértolo
2020-05-12 16:56 ` Eli Zaretskii
2020-05-12 17:25 ` Nicolas Bértolo
2020-05-12 18:21 ` Andrea Corallo
2020-05-12 20:33 ` Andrea Corallo
2020-05-13 14:09 ` Nicolas Bértolo
2020-05-13 14:31 ` Andrea Corallo
2020-05-13 15:00 ` Nicolas Bértolo [this message]
2020-05-13 15:17 ` Andrea Corallo
2020-05-13 15:48 ` Eli Zaretskii
2020-05-13 3:59 ` Richard Stallman
2020-05-13 14:02 ` Nicolas Bértolo
2020-05-13 15:23 ` Eli Zaretskii
2020-05-13 14:52 ` Eli Zaretskii
2020-05-10 19:47 ` Andrea Corallo
2020-05-10 19:39 ` Andrea Corallo
2020-05-10 17:13 ` Andrea Corallo
2020-05-10 17:15 ` Eli Zaretskii
2020-05-10 18:14 ` Andrea Corallo
2020-05-10 18:30 ` Eli Zaretskii
2020-05-10 18:54 ` Andrea Corallo
2020-05-10 19:02 ` Eli Zaretskii
2020-05-10 19:07 ` Nicolas Bértolo
2020-05-10 19:14 ` Andrea Corallo
2020-05-10 19:24 ` Andrea Corallo
2020-05-10 19:30 ` Eli Zaretskii
2020-05-10 18:05 ` Nicolas Bértolo
2020-05-10 18:23 ` Andrea Corallo
2020-05-10 17:20 ` Andrea Corallo
2020-05-09 13:42 ` Andrea Corallo
2020-05-09 15:40 ` Nicolas Bértolo
2020-05-09 15:55 ` Eli Zaretskii
2020-05-09 16:07 ` Nicolas Bértolo
2020-05-09 16:15 ` Eli Zaretskii
2020-05-09 16:27 ` Andrea Corallo
2020-05-09 16:33 ` Eli Zaretskii
2020-05-09 16:46 ` Andrea Corallo
2020-05-09 16:52 ` Andrea Corallo
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFnS-OnQWJtg=ok8mPkQnfAKRLDZ5Fpf-40W3O+br5GYR7_4gw@mail.gmail.com' \
--to=nicolasbertolo@gmail.com \
--cc=akrl@sdf.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).