Send MinGW-Notify mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.osdn.me/mailman/listinfo/mingw-notify
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of MinGW-Notify digest..."


Please do not reply to this notification; the sender address is unable to 
accept incoming e-mail.  If you wish to unsubscribe you can do so at 
https://lists.osdn.me/mailman/listinfo/mingw-notify.



Today's Topics:

   1. [mingw] #41070: Please include libgccjit with MinGW GCC
      distribution (MinGW Notification List)
   2. [mingw] #41070: Please include libgccjit with MinGW GCC
      distribution (MinGW Notification List)


----------------------------------------------------------------------

Message: 1
Date: Thu, 21 Jan 2021 00:37:51 +0900
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #41070: Please include libgccjit with
        MinGW GCC distribution
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

#41070: Please include libgccjit with MinGW GCC distribution

  Open Date: 2020-12-24 02:28
Last Update: 2021-01-21 00:37

URL for this Ticket:
    https://osdn.net//projects/mingw/ticket/41070
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41070

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2021-01-21 00:37 Updated by: davidmalcolm

Comment:

Keith, thanks for all the porting work you've done.
I've now looked through the patches themselves, and suddenly realized that they 
conflict in places with
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=c83027f32d9cca84959c7d6a1e519a0129731501
by Nicolas Bértolo which is on "master" for gcc 11, but not on the branches for 
older releases.  It looks like this might do much of what your patches do.  Is 
this patch in the code that you're working with?  What GCC version are you 
using?  Should this be backported; if so, which version?
I'm sorry for not noticing this earlier in this discussion (in my defence it 
was back in May, and 2020 has been a difficult year).
That said, your patches do have additional changes that appear to be necessary 
(in particular the mutex one).  I wonder why Nicholas got it working, but you 
needed additional patches.  Maybe he merely fixed the build, not the actually 
execution?
Do you have a copyright assignment in place with the FSF?
According to
https://www.gnu.org/prep/maintain/maintain.html#Legally-Significant
the FSF considers that for a patch or collection of patches that touch more 
than around 15 lines of code and/or text that is legally significant for 
copyright purposes, the FSF needs copyright papers for that contribution, which 
seems to be the case here (e.g. just the mutex one is > 15).
Let me know if you want my help with this, or if this is an issue.
Looking at the patches themselves:
20-libiberty-mingw-host-shared.patch(971bytes)
Patch to avoid bogus libiberty/pic path references
As far as I can tell, Nicholas made similar changes as part of 
c83027f32d9cca84959c7d6a1e519a0129731501.
21-libgccjit-win32-fchmod.patch(1012bytes)
Patch to correct for gratuitous misuse of fchmod()
This patch conflicts with 
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=c83027f32d9cca84959c7d6a1e519a0129731501
 by Nicolas Bértolo which is on "master" for gcc 11, but not on the branches 
for older releases.  Looking at it, I think he merely hacked out the call on 
Windows, which may lead to a run-time failure: on WIndows, is a DLL required to 
be executable for it to be linkable into the process?  I also wondered if 
there's a possible security issue here with closing the file and changing its 
permissions by name, but the DLL is created within a tempdir that only the user 
should have access to, with a random name.
22-libgccjit-win32-dlfcn.patch(532bytes)
Patch to circumvent gratuitous references to undeclared <dlfcn.h> functions
Seems reasonable, though I wonder why Nicolas Bértolo didn't run into this.
23-libgccjit-win32-no-pthreads.patch(2KB)
Patch to eliminate -lpthread dependency
> @@ -2138,12 +2173,12 @@ void
>  playback::context::release_mutex ()
>  {
>    /* Release the big GCC mutex. */
>    JIT_LOG_SCOPE (get_logger ());
>    gcc_assert (active_playback_ctxt == this);
> +  JIT_CONTEXT_RELEASE_LOCK (jit_mutex);
>    active_playback_ctxt = NULL;
> -  pthread_mutex_unlock (&jit_mutex);
>  }
Usage of "active_playback_ctxt" must be guarded by the mutex, so the 
JIT_CONTEXT_RELEASE_LOCK needs to be after the
active_playback_ctxt = NULL;
i.e. where the pthread_mutex_unlock call is.
Looking at the jit_mutex_initializer and the docs for 
https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initializecriticalsection
 I see that InitializeCriticalSection needs to be called exactly once on a 
CRITICAL_SECTION.  I see that the code does this via "static jit_mutex;"  
Presumably this leads to jit_mutex's ctor being called once when the DLL is 
loaded.  Does this work correctly?  (I'm always a little nervous about global 
ctors; older toolchains don't always implement it reliably)
24-libgccjit-full-driver-name.patch(616bytes)
Correction for omitted $(exeext) in Makefile
Nicholas made the same change as part of 
c83027f32d9cca84959c7d6a1e519a0129731501.
25-libgccjit-mingw-link-options.patch(3KB)
Use linker options appropriate for Windows
As far as I can tell, Nicholas made similar changes as part of 
c83027f32d9cca84959c7d6a1e519a0129731501.
26-libgccjit-mingw-host-shared.patch(2KB)
Patch to override --enable-host-shared requirement
As far as I can tell, Nicholas made similar changes as part of 
c83027f32d9cca84959c7d6a1e519a0129731501.
27-libgccjit-invalid-assertion.patch(1KB)
Patch to correct invalid assumption in DIR_SEPARATOR verification assertion
Nicholas completely rewrote this code for Windows as part of 
c83027f32d9cca84959c7d6a1e519a0129731501.  Sorry again for not realizing it 
earlier.  I'd appreciate it if you could look over gcc/jit/jit-w32.c in his 
patch to see if you know of a better way to securely create a temporary 
directory on Windows (or, indeed, if there are other issues).
Thanks again for your work on this, and again, sorry for taking so long to spot 
the duplication.


---------------------------------------------------------------------
Ticket Status:

      Reporter: eliz
         Owner: keith
          Type: Feature Request
        Status: Open [Owner assigned]
      Priority: 5 - Medium
     MileStone: (None)
     Component: GCC
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

Please add libgccjit to the binaries included in the MinGW GCC distributions.
This is required to be able to build projects that use libgccjit for JIT 
compilation of code.
One example of this is "gccemacs", a branch of GNU Emacs development (soon to 
land
on the master branch of Emacs) that compiles Emacs Lisp programs into native 
x86 code
for faster runtime performance.
Thank you.


-- 
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN

Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/mingw/ticket/41070
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41070


------------------------------

Message: 2
Date: Wed, 20 Jan 2021 18:39:18 +0200
From: MinGW Notification List <[email protected]>
To: OSDN Ticket System <[email protected]>
Subject: [MinGW-Notify] [mingw] #41070: Please include libgccjit with
        MinGW GCC distribution
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8

#41070: Please include libgccjit with MinGW GCC distribution

  Open Date: 2020-12-23 19:28
Last Update: 2021-01-20 18:39

URL for this Ticket:
    https://osdn.net//projects/mingw/ticket/41070
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41070

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2021-01-20 18:39 Updated by: eliz
 * Details Updated

Comment:

Reply To davidmalcolm
Keith, thanks for all the porting work you've done.

I've now looked through the patches themselves, and suddenly realized that they 
conflict in places with
  
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=c83027f32d9cca84959c7d6a1e519a0129731501
by Nicolas Bértolo which is on "master" for gcc 11, but not on the branches for 
older releases.  It looks like this might do much of what your patches do.  Is 
this patch in the code that you're working with?  What GCC version are you 
using?  Should this be backported; if so, which version?
I'm not Keith, but let me say one thing that could answer several questions you 
ask: Nicolas was using MinGW64, a different flavor of GCC and runtime 
environment ported to native MS-Windows.
That said, your patches do have additional changes that appear to be necessary 
(in particular the mutex one).  I wonder why Nicholas got it working, but you 
needed additional patches.  Maybe he merely fixed the build, not the actually 
execution?
I believe MinGW64 uses pthreads as an integral part of their GCC port, so 
Nicolas didn't need this.  IMNSHO, it is better to avoid gratuitous 
dependencies on pthreads, so I think what Keith did here is cleaner.  However, 
if the MinGW64 port must use pthreads, then I guess both varieties will need to 
be supported.
22-libgccjit-win32-dlfcn.patch(532bytes)
  Patch to circumvent gratuitous references to undeclared <dlfcn.h> functions
Seems reasonable, though I wonder why Nicolas Bértolo didn't run into this.
AFAIK, MinGW64 doesn't have the dlfcn.h header and the related emulations of 
Posix functions, while mingw.org's MinGW does have that.


---------------------------------------------------------------------
Ticket Status:

      Reporter: eliz
         Owner: keith
          Type: Feature Request
        Status: Open [Owner assigned]
      Priority: 5 - Medium
     MileStone: (None)
     Component: GCC
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

ease add libgccjit to the binaries included in the MinGW GCC distributions.
This is required to be able to build projects that use libgccjit for JIT 
compilation of code.
One example of this is "gccemacs", a branch of GNU Emacs development (soon to 
land
on the master branch of Emacs) that compiles Emacs Lisp programs into native 
x86 code
for faster runtime performance.
Thank you.


-- 
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN

Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/mingw/ticket/41070
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=41070


------------------------------

Subject: Digest Footer

_______________________________________________
MinGW-Notify mailing list
[email protected]
https://lists.osdn.me/mailman/listinfo/mingw-notify


------------------------------

End of MinGW-Notify Digest, Vol 40, Issue 11
********************************************

Reply via email to