Skip to content

Commit 7d632a0

Browse files
koronchrisbra
authored andcommitted
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]>
1 parent aa58f1f commit 7d632a0

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/GvimExt/Make_ming.mak

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,22 @@ MINGWOLD = no
2222
STATIC_STDCPLUS=no
2323
#STATIC_STDCPLUS=yes
2424

25+
# If you use TDM-GCC(-64), change HAS_GCC_EH to "no".
26+
# This is used when STATIC_STDCPLUS=yes.
27+
HAS_GCC_EH=yes
28+
29+
STATIC_LIBS=
30+
2531
# Note: -static-libstdc++ is not available until gcc 4.5.x.
2632
LDFLAGS += -shared
2733
ifeq (yes, $(STATIC_STDCPLUS))
2834
LDFLAGS += -static-libgcc -static-libstdc++
35+
# Order important: gcc_eh must be placed before winpthread
36+
STATIC_LIBS += -lstdc++ -lgcc
37+
ifeq (yes, $(HAS_GCC_EH))
38+
STATIC_LIBS += -lgcc_eh
39+
endif
40+
STATIC_LIBS += -lwinpthread
2941
endif
3042

3143
ifeq ($(CROSS),yes)
@@ -71,7 +83,8 @@ $(DLL): $(OBJ) $(RES) $(DEFFILE)
7183
-Wl,--whole-archive \
7284
$^ \
7385
-Wl,--no-whole-archive \
74-
$(LIBS)
86+
$(LIBS) \
87+
-Wl,-Bstatic $(STATIC_LIBS) -Wl,-Bdynamic
7588

7689
gvimext.o: gvimext.cpp
7790
$(CXX) $(CXXFLAGS) -DFEAT_GETTEXT -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) -c $? -o $@

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
2065,
737739
/**/
738740
2064,
739741
/**/

0 commit comments

Comments
 (0)