patch 9.1.2065: GvimExt cannot be linked statically using MinGW

Commit: 
https://github.com/vim/vim/commit/7d632a0a7728ef346e7f17355b15023719135eb7
Author: Muraoka Taro <[email protected]>
Date:   Thu Jan 8 20:12:58 2026 +0000

    patch 9.1.2065: GvimExt cannot be linked statically using MinGW
    
    Problem:  When building GvimExt with MinGW, some DLLs are still linked
              even if STATIC_STDCPLUS=yes is set.
    Solution: Following the Vim core, make some libraries explicitly
              statically linked.  The order of libraries is important, and
              gcc_eh must be placed before winpthread (Muraoka Taro)
    
    closes: #19131
    
    Signed-off-by: Muraoka Taro <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/GvimExt/Make_ming.mak b/src/GvimExt/Make_ming.mak
index 06ec7b6dc..b73e6fd92 100644
--- a/src/GvimExt/Make_ming.mak
+++ b/src/GvimExt/Make_ming.mak
@@ -22,10 +22,22 @@ MINGWOLD = no
 STATIC_STDCPLUS=no
 #STATIC_STDCPLUS=yes
 
+# If you use TDM-GCC(-64), change HAS_GCC_EH to "no".
+# This is used when STATIC_STDCPLUS=yes.
+HAS_GCC_EH=yes
+
+STATIC_LIBS=
+
 # Note: -static-libstdc++ is not available until gcc 4.5.x.
 LDFLAGS += -shared
 ifeq (yes, $(STATIC_STDCPLUS))
 LDFLAGS += -static-libgcc -static-libstdc++
+# Order important: gcc_eh must be placed before winpthread
+STATIC_LIBS += -lstdc++ -lgcc
+ ifeq (yes, $(HAS_GCC_EH))
+STATIC_LIBS += -lgcc_eh
+ endif
+STATIC_LIBS += -lwinpthread
 endif
 
 ifeq ($(CROSS),yes)
@@ -71,7 +83,8 @@ $(DLL): $(OBJ) $(RES) $(DEFFILE)
                -Wl,--whole-archive \
                        $^ \
                -Wl,--no-whole-archive \
-                       $(LIBS)
+                       $(LIBS) \
+               -Wl,-Bstatic $(STATIC_LIBS) -Wl,-Bdynamic
 
 gvimext.o: gvimext.cpp
        $(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -DWINVER=$(WINVER) 
-D_WIN32_WINNT=$(WINVER) -c $? -o $@
diff --git a/src/version.c b/src/version.c
index b6a5fa5a1..45a660d0b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2065,
 /**/
     2064,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vdwdw-003BIj-Pi%40256bit.org.

Raspunde prin e-mail lui