emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] [WIP] Port feature/native-comp to Windows.


From: Nicolas Bértolo
Subject: Re: [PATCH] [WIP] Port feature/native-comp to Windows.
Date: Wed, 13 May 2020 12:00:45 -0300

> 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 (<address@hidden>) escribió:
>
> Nicolas Bértolo <address@hidden> 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
> --
> address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]