Skip to content

Commit eb969ba

Browse files
Blackhexgithub-actions
authored andcommitted
0101-Cygwin-enable-libgccjit-not-just-for-MingW.patch
1 parent b411f00 commit eb969ba

File tree

4 files changed

+30
-10
lines changed

4 files changed

+30
-10
lines changed

configure

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ infodir
776776
docdir
777777
oldincludedir
778778
includedir
779+
runstatedir
779780
localstatedir
780781
sharedstatedir
781782
sysconfdir
@@ -951,6 +952,7 @@ datadir='${datarootdir}'
951952
sysconfdir='${prefix}/etc'
952953
sharedstatedir='${prefix}/com'
953954
localstatedir='${prefix}/var'
955+
runstatedir='${localstatedir}/run'
954956
includedir='${prefix}/include'
955957
oldincludedir='/usr/include'
956958
docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1203,6 +1205,15 @@ do
12031205
| -silent | --silent | --silen | --sile | --sil)
12041206
silent=yes ;;
12051207

1208+
-runstatedir | --runstatedir | --runstatedi | --runstated \
1209+
| --runstate | --runstat | --runsta | --runst | --runs \
1210+
| --run | --ru | --r)
1211+
ac_prev=runstatedir ;;
1212+
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1213+
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1214+
| --run=* | --ru=* | --r=*)
1215+
runstatedir=$ac_optarg ;;
1216+
12061217
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
12071218
ac_prev=sbindir ;;
12081219
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1340,7 +1351,7 @@ fi
13401351
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
13411352
datadir sysconfdir sharedstatedir localstatedir includedir \
13421353
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1343-
libdir localedir mandir
1354+
libdir localedir mandir runstatedir
13441355
do
13451356
eval ac_val=\$$ac_var
13461357
# Remove trailing slashes.
@@ -1500,6 +1511,7 @@ Fine tuning of the installation directories:
15001511
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
15011512
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
15021513
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1514+
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
15031515
--libdir=DIR object code libraries [EPREFIX/lib]
15041516
--includedir=DIR C header files [PREFIX/include]
15051517
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -10059,6 +10071,7 @@ $as_echo "$as_me: WARNING: some C libraries are required to build $language: $mi
1005910071
# is position independent code (PIC).
1006010072
case $target in
1006110073
*mingw*) ;;
10074+
*cygwin*) ;;
1006210075
*)
1006310076
case ${add_this_lang}:${language}:${host_shared} in
1006410077
yes:jit:no)
@@ -10083,7 +10096,7 @@ $as_echo "$as_me: WARNING: --enable-host-shared required to build $language" >&2
1008310096
# Silently disable.
1008410097
add_this_lang=unsupported
1008510098
;;
10086-
esac
10099+
esac
1008710100
;;
1008810101
esac
1008910102

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2376,6 +2376,7 @@ if test -d ${srcdir}/gcc; then
23762376
# is position independent code (PIC).
23772377
case $target in
23782378
*mingw*) ;;
2379+
*cygwin*) ;;
23792380
*)
23802381
case ${add_this_lang}:${language}:${host_shared} in
23812382
yes:jit:no)
@@ -2399,7 +2400,7 @@ directories, to avoid imposing the performance cost of
23992400
# Silently disable.
24002401
add_this_lang=unsupported
24012402
;;
2402-
esac
2403+
esac
24032404
;;
24042405
esac
24052406

gcc/jit/Make-lang.in

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ LIBGCCJIT_VERSION_NUM = 0
4444
LIBGCCJIT_MINOR_NUM = 0
4545
LIBGCCJIT_RELEASE_NUM = 1
4646

47-
ifneq (,$(findstring mingw,$(target)))
48-
LIBGCCJIT_FILENAME = libgccjit-$(LIBGCCJIT_VERSION_NUM).dll
47+
SHARED_PFX=lib
48+
ifneq (,$(filter %cygwin,$(target)))
49+
SHARED_PFX=cyg
50+
endif
51+
52+
ifneq (,$(filter %-mingw% %-cygwin,$(target)))
53+
LIBGCCJIT_FILENAME = $(SHARED_PFX)gccjit-$(LIBGCCJIT_VERSION_NUM).dll
4954
LIBGCCJIT_IMPORT_LIB = libgccjit.dll.a
5055

5156
jit: $(LIBGCCJIT_FILENAME) \
@@ -149,7 +154,7 @@ endif
149154
# Use strict warnings for this front end.
150155
jit-warn = $(STRICT_WARN)
151156

152-
ifneq (,$(findstring mingw,$(target)))
157+
ifneq (,$(filter %-mingw% %-cygwin,$(target)))
153158
# Create import library
154159
LIBGCCJIT_EXTRA_OPTS = -Wl,--out-implib,$(LIBGCCJIT_IMPORT_LIB)
155160
else
@@ -191,7 +196,7 @@ $(LIBGCCJIT_FILENAME): $(jit_OBJS) \
191196
@$(call LINK_PROGRESS,$(INDEX.jit),end)
192197

193198
# Create symlinks when not building for Windows
194-
ifeq (,$(findstring mingw,$(target)))
199+
ifeq (,$(filter %-mingw% %-cygwin,$(target)))
195200

196201
ifeq (,$(findstring darwin,$(host)))
197202
# but only one level for Darwin, version info is embedded.
@@ -377,7 +382,7 @@ jit.install-headers: installdirs
377382
$(INSTALL_DATA) $(srcdir)/jit/libgccjit++.h \
378383
$(DESTDIR)$(includedir)/libgccjit++.h
379384

380-
ifneq (,$(findstring mingw,$(target)))
385+
ifneq (,$(filter %-mingw% %-cygwin,$(target)))
381386
jit.install-common: installdirs jit.install-headers
382387
# Install import library
383388
$(INSTALL_PROGRAM) $(LIBGCCJIT_IMPORT_LIB) \

gcc/system.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,9 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
694694
# endif
695695
#endif
696696

697-
#if defined (ENABLE_PLUGIN) && defined (HAVE_DLFCN_H)
698-
/* If plugin support is enabled, we could use libdl. */
697+
#if defined (HAVE_DLFCN_H) && (defined (ENABLE_PLUGIN) || defined (__CYGWIN__))
698+
/* If plugin support is enabled, we could use libdl.
699+
On Cygwin libdl is needed for libgccjit but no plugin support is available. */
699700
#include <dlfcn.h>
700701
#endif
701702

0 commit comments

Comments
 (0)