diff -ur ../grass-7.8.6RC3/lib/gis/gisinit.c grass-7.8.6RC3/lib/gis/gisinit.c
--- ../grass-7.8.6RC3/lib/gis/gisinit.c	2021-10-01 21:08:51.000000000 +0200
+++ grass-7.8.6RC3/lib/gis/gisinit.c	2021-10-04 21:31:30.412052700 +0200
@@ -49,12 +49,14 @@

     G_set_program_name(pgm);

+#ifndef _WIN32
     /* verify version of GRASS headers (and anything else in include) */
     if (strcmp(version, GIS_H_VERSION) != 0)
 	G_fatal_error(_("Module built against version %s but "
 			"trying to use version %s. "
 			"You need to rebuild GRASS GIS or untangle multiple installations."),
                         version, GIS_H_VERSION);
+#endif

     /* Make sure location and mapset are set */
     G_location_path();
diff -ur ../grass-7.8.6RC3/mswindows/osgeo4w/config.h.vc grass-7.8.6RC3/mswindows/osgeo4w/config.h.vc
--- ../grass-7.8.6RC3/mswindows/osgeo4w/config.h.vc	2021-10-01 21:08:51.000000000 +0200
+++ grass-7.8.6RC3/mswindows/osgeo4w/config.h.vc	2021-10-04 21:31:30.416058400 +0200
@@ -295,4 +295,6 @@
 /* define if langinfo.h exists */
 /* #undef HAVE_LANGINFO_H */

+#define HAVE_PROJ_H 1
+
 #endif /* _config_h */
diff -ur ../grass-7.8.6RC3/mswindows/osgeo4w/env.bat.tmpl grass-7.8.6RC3/mswindows/osgeo4w/env.bat.tmpl
--- ../grass-7.8.6RC3/mswindows/osgeo4w/env.bat.tmpl	2021-10-01 21:08:51.000000000 +0200
+++ grass-7.8.6RC3/mswindows/osgeo4w/env.bat.tmpl	2021-10-04 21:31:30.421161400 +0200
@@ -12,11 +12,3 @@
 set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj

 set FONTCONFIG_FILE=%GISBASE%\etc\fonts.conf
-
-REM
-REM RStudio-related
-REM
-REM set RStudio temporarily to %PATH% if it exists
-IF EXIST "%ProgramFiles%\RStudio\bin\rstudio.exe" set PATH=%PATH%;%ProgramFiles%\RStudio\bin
-REM set R_USER if %USERPROFILE%\Documents\R\ exists to catch most common cases of private R libraries
-IF EXIST "%USERPROFILE%\Documents\R\" set R_USER=%USERPROFILE%\Documents\
diff -ur ../grass-7.8.6RC3/mswindows/osgeo4w/package.sh grass-7.8.6RC3/mswindows/osgeo4w/package.sh
--- ../grass-7.8.6RC3/mswindows/osgeo4w/package.sh	2021-10-01 21:08:51.000000000 +0200
+++ grass-7.8.6RC3/mswindows/osgeo4w/package.sh	2021-10-04 21:23:54.848000700 +0200
@@ -149,13 +149,13 @@

 	log configure
 	./configure \
-	    --host=x86_64-w64-mingw32 \
+		--host=x86_64-w64-mingw32 \
 		--with-libs="$OSGEO4W_ROOT_MSYS/lib" \
 		--with-includes=$OSGEO4W_ROOT_MSYS/include \
-        --libexecdir=$OSGEO4W_ROOT_MSYS/bin \
-        --prefix=$OSGEO4W_ROOT_MSYS/apps/grass \
-        --bindir=$OSGEO4W_ROOT_MSYS/bin \
-        --includedir=$OSGEO4W_ROOT_MSYS/include \
+		--libexecdir=$OSGEO4W_ROOT_MSYS/bin \
+		--prefix=$OSGEO4W_ROOT_MSYS/apps/grass \
+		--bindir=$OSGEO4W_ROOT_MSYS/bin \
+		--includedir=$OSGEO4W_ROOT_MSYS/include \
 		--without-x \
 		--with-cxx \
 		--enable-shared \
@@ -178,10 +178,10 @@
 		--with-nls \
 		--with-zstd \
 		--with-odbc \
-	    --with-cairo \
+		--with-cairo \
 		--with-cairo-includes=$OSGEO4W_ROOT_MSYS/include \
 		--with-cairo-ldflags="-L$PWD/mswindows/osgeo4w/lib -lcairo -lfontconfig" \
-	    --with-opengl=windows \
+		--with-opengl=windows \
 		--with-bzlib \
 		--with-liblas=$PWD/mswindows/osgeo4w/liblas-config

diff -ur ../grass-7.8.6RC3/mswindows/osgeo4w/postinstall.bat grass-7.8.6RC3/mswindows/osgeo4w/postinstall.bat
--- ../grass-7.8.6RC3/mswindows/osgeo4w/postinstall.bat	2021-10-01 21:08:51.000000000 +0200
+++ grass-7.8.6RC3/mswindows/osgeo4w/postinstall.bat	2021-10-04 21:32:24.956712700 +0200
@@ -1,29 +1,29 @@
-set ICON=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\gui\icons\grass_osgeo.ico
-set BATCH=%OSGEO4W_ROOT%\bin\@GRASS_EXECUTABLE@.bat
-textreplace -std -t "%BATCH%"
-textreplace -std -t "%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\fontcap"
-
-for /F "tokens=* USEBACKQ" %%F IN (`getspecialfolder Documents`) do set DOCUMENTS=%%F
-
-if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS @VERSION@.lnk" "%BATCH%"  "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%"
-if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%OSGEO4W_DESKTOP%\GRASS GIS @VERSION@.lnk" "%BATCH%"  "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%"
-
-rem run g.mkfontcap outside a GRASS session during
-rem an OSGeo4W installation for updating paths to fonts
-
-rem set gisbase
-set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@
-
-rem set path to freetype dll and its dependencies
-set FREETYPEBASE=%OSGEO4W_ROOT%\bin;%OSGEO4W_ROOT%\apps\msys\bin;%GISBASE%\lib
-
-rem set dependencies to path
-set PATH=%FREETYPEBASE%;%PATH%
-
-rem GISRC must be set
-set GISRC=dummy
-
-rem run g.mkfontcap outside a GRASS session
-"%GISBASE%\bin\g.mkfontcap.exe" -o
-
-del "%BATCH%.tmpl
+set ICON=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\gui\icons\grass_osgeo.ico
+set BATCH=%OSGEO4W_ROOT%\bin\@GRASS_EXECUTABLE@.bat
+textreplace -std -t "%BATCH%"
+textreplace -std -t "%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\fontcap"
+
+for /F "tokens=* USEBACKQ" %%F IN (`getspecialfolder Documents`) do set DOCUMENTS=%%F
+
+if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS @VERSION@.lnk" "%BATCH%"  "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%"
+if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%OSGEO4W_DESKTOP%\GRASS GIS @VERSION@.lnk" "%BATCH%"  "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%"
+
+rem run g.mkfontcap outside a GRASS session during
+rem an OSGeo4W installation for updating paths to fonts
+
+rem set gisbase
+set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@
+
+rem set path to freetype dll and its dependencies
+set FREETYPEBASE=%OSGEO4W_ROOT%\bin;%OSGEO4W_ROOT%\apps\msys\bin;%GISBASE%\lib
+
+rem set dependencies to path
+set PATH=%FREETYPEBASE%;%PATH%
+
+rem GISRC must be set
+set GISRC=dummy
+
+rem run g.mkfontcap outside a GRASS session
+"%GISBASE%\bin\g.mkfontcap.exe" -o
+
+del "%BATCH%.tmpl
diff --git ../grass-7.8.6RC3/lib/raster/gdal.c grass-7.8.6RC3/lib/raster/gdal.c
--- ../grass-7.8.6RC3/lib/raster/gdal.c 2021-10-01 21:08:51.000000000 +0200
+++ grass-7.8.6RC3/lib/raster/gdal.c    2021-10-04 21:32:24.956712700 +0200
@@ -116,6 +116,9 @@ static void load_library(void)
 	"libgdal1.7.0.so",
 # endif
 # ifdef _WIN32
+	"gdal303.dll",
+	"gdal302.dll",
+	"gdal301.dll",
 	"gdal300.dll",
 	"gdal204.dll",
 	"gdal203.dll",
diff --git ../grass-7.8.6RC3/gui/wxpython/psmap/frame.py grass-7.8.6RC3/gui/wxpython/psmap/frame.py
--- ../grass-7.8.6RC3/gui/wxpython/psmap/frame.py 2021-10-01 21:08:51.000000000 +0200
+++ grass-7.8.6RC3/gui/wxpython/psmap/frame.py    2021-10-04 21:32:24.956712700 +0200
@@ -404,8 +404,8 @@ def OnCmdDone(self, event):
                            '-sOutputFile=%s' % event.userData['pdfname'],
                            '-P-', '-dSAFER',
                            '-dCompatibilityLevel=1.4',
-                           '-c', '.setpdfwrite', '-f',
-                           event.userData['filename']]
+                           '-c', '30000000', 'setvmthreshold',
+                           '-f', event.userData['filename']]
             else:
                 command = [
                     'ps2pdf',
