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 11:09:42 -0300

> 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.

PS: Shall I open a bug where we can track this?

Nicolas

El mar., 12 may. 2020 a las 17:33, Andrea Corallo (<address@hidden>) escribió:
>
> Andrea Corallo <address@hidden> writes:
>
> > Nicolas Bértolo <address@hidden> writes:
> >
> >>> libdl exists only in MinGW64, I think.
> >>
> >>> Why do you need it? is it because the code uses dlopen/dlsym
> >>> somewhere?
> >>
> >> The code uses `dynlib_open` and `dynlib_sym` which are implemented using 
> >> libdl
> >> in Posix systems. The original libgccjit uses it to implement the
> >> `compile_to_memory` function that we do not use. The version of libgccjit 
> >> I am
> >> using implements that feature using native Windows functions, so libdl is 
> >> not
> >> necessary.
> >>
> >> I don't think we can remove it because that part of the code runs only 
> >> when the
> >> platform is not Mingw, and in that case libdl is necessary.
> >>
> >>> I think it's good to #undef each symbol before defining it.
> >>
> >> Fixed in the new patch.
> >
> > Hi Nicolas,
> >
> > I think would be handy to have 'native-comp-available-p' always defined
> > also when compiling without the native compiler.  Similarly to what we
> > have for gnutls-available-p and libxml-available-p.
> >
> > +static bool
> > +load_gccjit_if_necessary(bool mandatory)
> >                        ^^^
> >                     space here
> > +{
> > +#ifdef WINDOWSNT
> > +  if (!gccjit_initialized)
> > +    {
> > +      Lisp_Object status;
> > +      gccjit_initialized = init_gccjit_functions ();
> > +
> >
> > Also I think gccjit_initialized should be declared be static inside
> > load_gccjit_if_necessary given should and is used only there.
> >
> > Thanks
> >
> >   Andrea
>
> Also
>
> +      gccjit_initialized = init_gccjit_functions ();
> +      status = gccjit_initialized ? Qt : Qnil;
> +      Vlibrary_cache = Fcons (Fcons (Qjson, status), Vlibrary_cache);
>
> I think Qjson is a refuse from kill and yank.
>
> Thanks
>
>   Andrea
>
> --
> address@hidden

Attachment: Load-libgccjit-dynamically-in-Windows.patch
Description: Binary data


reply via email to

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