jit: port libgccjit to Windows
authorNicolás Bértolo <nicolasbertolo@gmail.com>
Fri, 22 May 2020 20:54:41 +0000 (17:54 -0300)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 28 May 2020 18:43:58 +0000 (14:43 -0400)
commitc83027f32d9cca84959c7d6a1e519a0129731501
tree4dad20ef88f0f41236b4da3f2e2c90c5ce1da512
parentccf4e86dc01d8c89a8d56b228757a689d1fcc564
jit: port libgccjit to Windows

2020-05-28  Nicolas Bértolo  <nicolasbertolo@gmail.com>

/ChangeLog:
* configure.ac: Don't require --enable-host-shared when building
for Mingw.
* configure: Regenerate.

2020-05-28  Nicolas Bértolo  <nicolasbertolo@gmail.com>

gcc/ChangeLog:
* Makefile.in: don't look for libiberty in the "pic" subdirectory
when building for Mingw. Add dependency on xgcc with the proper
extension.

2020-05-28  Nicolas Bértolo  <nicolasbertolo@gmail.com>

gcc/c/ChangeLog:
* Make-lang.in: Remove extra slash.

2020-05-28  Nicolas Bértolo  <nicolasbertolo@gmail.com>

gcc/jit/ChangeLog:
* Make-lang.in: Remove extra slash. Build libgccjit.dll and its
import library in Windows.
* config-lang.in: Update comment about --enable-host-shared.
* jit-w32.h: New file.
* jit-w32.c: New file.
(print_last_error): New function that prints the error
string corresponding to GetLastError().
(get_TOKEN_USER_current_user): Helper function used for getting
the SID belonging to the current user.
(create_directory_for_current_user): Helper function to create
a directory with permissions such that only the current user can
access it.
(win_mkdtemp): Create a temporary directory using Windows APIs.
* jit-playback.c: Do not chmod files in Windows. Use LoadLibrary,
FreeLibrary and GetProcAddress instead of libdl.
* jit-result.h, jit-result.c: Introduce result::handle_t to
abstract over the types used for dynamic library handles.
* jit-tempdir.c: Do not use mkdtemp() in Windows, use
win_mkdtemp().
12 files changed:
configure
configure.ac
gcc/Makefile.in
gcc/c/Make-lang.in
gcc/jit/Make-lang.in
gcc/jit/config-lang.in
gcc/jit/jit-playback.c
gcc/jit/jit-result.c
gcc/jit/jit-result.h
gcc/jit/jit-tempdir.c
gcc/jit/jit-w32.c [new file with mode: 0644]
gcc/jit/jit-w32.h [new file with mode: 0644]