summaryrefslogtreecommitdiffstats
path: root/0101-Cygwin-enable-libgccjit-not-just-for-MingW.patch
diff options
context:
space:
mode:
Diffstat (limited to '0101-Cygwin-enable-libgccjit-not-just-for-MingW.patch')
-rw-r--r--0101-Cygwin-enable-libgccjit-not-just-for-MingW.patch183
1 files changed, 183 insertions, 0 deletions
diff --git a/0101-Cygwin-enable-libgccjit-not-just-for-MingW.patch b/0101-Cygwin-enable-libgccjit-not-just-for-MingW.patch
new file mode 100644
index 0000000..62cf0f7
--- /dev/null
+++ b/0101-Cygwin-enable-libgccjit-not-just-for-MingW.patch
@@ -0,0 +1,183 @@
+From 38fae7faa3405611b2cce41de639aa3351dbc048 Mon Sep 17 00:00:00 2001
+From: Achim Gratz <Achim.Gratz@Stromeko.DE>
+Date: Sun, 25 Apr 2021 11:33:55 +0200
+Subject: [PATCH 1/2] Cygwin: enable libgccjit not just for MingW
+
+---
+ configure | 17 +++++++++++++++--
+ configure.ac | 3 ++-
+ gcc/cp/Make-lang.in | 2 +-
+ gcc/jit/Make-lang.in | 15 ++++++++++-----
+ gcc/system.h | 5 +++--
+ 5 files changed, 31 insertions(+), 11 deletions(-)
+
+diff --git a/configure b/configure
+index 504f6410274..fc0dd15f3e9 100755
+--- a/configure
++++ b/configure
+@@ -756,6 +756,7 @@ infodir
+ docdir
+ oldincludedir
+ includedir
++runstatedir
+ localstatedir
+ sharedstatedir
+ sysconfdir
+@@ -922,6 +923,7 @@ datadir='${datarootdir}'
+ sysconfdir='${prefix}/etc'
+ sharedstatedir='${prefix}/com'
+ localstatedir='${prefix}/var'
++runstatedir='${localstatedir}/run'
+ includedir='${prefix}/include'
+ oldincludedir='/usr/include'
+ docdir='${datarootdir}/doc/${PACKAGE}'
+@@ -1174,6 +1176,15 @@ do
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
++ -runstatedir | --runstatedir | --runstatedi | --runstated \
++ | --runstate | --runstat | --runsta | --runst | --runs \
++ | --run | --ru | --r)
++ ac_prev=runstatedir ;;
++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
++ | --run=* | --ru=* | --r=*)
++ runstatedir=$ac_optarg ;;
++
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+@@ -1311,7 +1322,7 @@ fi
+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+- libdir localedir mandir
++ libdir localedir mandir runstatedir
+ do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+@@ -1471,6 +1482,7 @@ Fine tuning of the installation directories:
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+@@ -8492,6 +8504,7 @@ $as_echo "$as_me: WARNING: GNAT is required to build $language" >&2;}
+ # is position independent code (PIC).
+ case $target in
+ *mingw*) ;;
++ *cygwin*) ;;
+ *)
+ case ${add_this_lang}:${language}:${host_shared} in
+ yes:jit:no)
+@@ -8516,7 +8529,7 @@ $as_echo "$as_me: WARNING: --enable-host-shared required to build $language" >&2
+ # Silently disable.
+ add_this_lang=unsupported
+ ;;
+- esac
++ esac
+ ;;
+ esac
+
+diff --git a/configure.ac b/configure.ac
+index 088e735c5db..7f452989b82 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2089,6 +2089,7 @@ if test -d ${srcdir}/gcc; then
+ # is position independent code (PIC).
+ case $target in
+ *mingw*) ;;
++ *cygwin*) ;;
+ *)
+ case ${add_this_lang}:${language}:${host_shared} in
+ yes:jit:no)
+@@ -2112,7 +2113,7 @@ directories, to avoid imposing the performance cost of
+ # Silently disable.
+ add_this_lang=unsupported
+ ;;
+- esac
++ esac
+ ;;
+ esac
+
+diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
+index 155be74efdb..b750114185c 100644
+--- a/gcc/cp/Make-lang.in
++++ b/gcc/cp/Make-lang.in
+@@ -285,7 +285,7 @@ c++.install-plugin: installdirs
+ # Install import library.
+ ifeq ($(plugin_implib),yes)
+ $(mkinstalldirs) $(DESTDIR)$(plugin_resourcesdir)
+- $(INSTALL_DATA) cc1plus$(exeext).a $(DESTDIR)/$(plugin_resourcesdir)/cc1plus$(exeext).a
++ $(INSTALL_DATA) cc1plus$(exeext).a $(DESTDIR)$(plugin_resourcesdir)/cc1plus$(exeext).a
+ endif
+
+ c++.uninstall:
+diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
+index 663772aba63..98c4d521b1c 100644
+--- a/gcc/jit/Make-lang.in
++++ b/gcc/jit/Make-lang.in
+@@ -44,8 +44,13 @@ LIBGCCJIT_VERSION_NUM = 0
+ LIBGCCJIT_MINOR_NUM = 0
+ LIBGCCJIT_RELEASE_NUM = 1
+
+-ifneq (,$(findstring mingw,$(target)))
+-LIBGCCJIT_FILENAME = libgccjit-$(LIBGCCJIT_VERSION_NUM).dll
++SHARED_PFX=lib
++ifneq (,$(filter %cygwin,$(target)))
++SHARED_PFX=cyg
++endif
++
++ifneq (,$(filter %-mingw% %-cygwin,$(target)))
++LIBGCCJIT_FILENAME = $(SHARED_PFX)gccjit-$(LIBGCCJIT_VERSION_NUM).dll
+ LIBGCCJIT_IMPORT_LIB = libgccjit.dll.a
+
+ jit: $(LIBGCCJIT_FILENAME) \
+@@ -105,7 +110,7 @@ endif
+ # Use strict warnings for this front end.
+ jit-warn = $(STRICT_WARN)
+
+-ifneq (,$(findstring mingw,$(target)))
++ifneq (,$(filter %-mingw% %-cygwin,$(target)))
+ # Create import library
+ LIBGCCJIT_EXTRA_OPTS = -Wl,--out-implib,$(LIBGCCJIT_IMPORT_LIB)
+ else
+@@ -129,7 +134,7 @@ $(LIBGCCJIT_FILENAME): $(jit_OBJS) \
+ @$(call LINK_PROGRESS,$(INDEX.jit),end)
+
+ # Create symlinks when not building for Windows
+-ifeq (,$(findstring mingw,$(target)))
++ifeq (,$(filter %-mingw% %-cygwin,$(target)))
+ $(LIBGCCJIT_SONAME_SYMLINK): $(LIBGCCJIT_FILENAME)
+ ln -sf $(LIBGCCJIT_FILENAME) $(LIBGCCJIT_SONAME_SYMLINK)
+
+@@ -311,7 +316,7 @@ jit.install-headers: installdirs
+ $(INSTALL_DATA) $(srcdir)/jit/libgccjit++.h \
+ $(DESTDIR)$(includedir)/libgccjit++.h
+
+-ifneq (,$(findstring mingw,$(target)))
++ifneq (,$(filter %-mingw% %-cygwin,$(target)))
+ jit.install-common: installdirs jit.install-headers
+ # Install import library
+ $(INSTALL_PROGRAM) $(LIBGCCJIT_IMPORT_LIB) \
+diff --git a/gcc/system.h b/gcc/system.h
+index a3f5948aaee..97b91b33afa 100644
+--- a/gcc/system.h
++++ b/gcc/system.h
+@@ -688,8 +688,9 @@ extern int vsnprintf (char *, size_t, const char *, va_list);
+ # endif
+ #endif
+
+-#if defined (ENABLE_PLUGIN) && defined (HAVE_DLFCN_H)
+-/* If plugin support is enabled, we could use libdl. */
++#if defined (HAVE_DLFCN_H) && (defined (ENABLE_PLUGIN) || defined (__CYGWIN__))
++/* If plugin support is enabled, we could use libdl.
++ On Cygwin libdl is needed for libgccjit but no plugin support is available. */
+ #include <dlfcn.h>
+ #endif
+
+--
+2.31.1
+