From: Muraoka Taro Date: Thu, 8 Jan 2026 20:12:58 +0000 (+0000) Subject: patch 9.1.2065: GvimExt cannot be linked statically using MinGW X-Git-Tag: v9.1.2065^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d632a0a7728ef346e7f17355b15023719135eb7;p=thirdparty%2Fvim.git 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 Signed-off-by: Christian Brabandt --- diff --git a/src/GvimExt/Make_ming.mak b/src/GvimExt/Make_ming.mak index 06ec7b6dc5..b73e6fd92a 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 b6a5fa5a17..45a660d0bb 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, /**/