Re: [vim/vim] Add statically linked libraries based on Vim core (PR #19131)

3 views
Skip to first unread message

MURAOKA Taro

unread,
Jan 8, 2026, 3:27:30 AM (yesterday) Jan 8
to vim/vim, Subscribed
koron left a comment (vim/vim#19131)

The following example specifies STATIC_STDCPLUS=yes, but shows that the unintended libwinpthread-1.dll is linked.

$ mingw32-make -C GvimExt -f Make_ming.mak STATIC_STDCPLUS=yes clean all && ( dumpbin -imports GvimExt/gvimext.dll | grep -i dll )
mingw32-make: Entering directory 'D:/home/...(snipped).../vim/src/GvimExt'
rm -f  gvimext.o gvimext.res gvimext.dll
g++ -O2 -DFEAT_GETTEXT -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -c gvimext.cpp -o gvimext.o
windres  --input-format=rc --output-format=coff -DMING gvimext_ming.rc -o gvimext.res
g++ -shared -static-libgcc -static-libstdc++ -O2 -s -o gvimext.dll \
        -Wl,--enable-auto-image-base \
        -Wl,--enable-auto-import \
        -Wl,--whole-archive \
                gvimext.o gvimext.res gvimext_ming.def \
        -Wl,--no-whole-archive \
                -luuid -lgdi32
mingw32-make: Leaving directory 'D:/home/...(snipped).../vim/src/GvimExt'
Dump of file GvimExt\gvimext.dll
File Type: DLL
    ADVAPI32.dll
    GDI32.dll
    KERNEL32.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    api-ms-win-crt-private-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-utility-l1-1-0.dll
    libwinpthread-1.dll
    SHELL32.dll
    USER32.dll

Applying this patch will result in the following result, and the MINGW-derived DLL will not be linked.
Note that the linking options added by this patch are -Wl,-Bstatic -lstdc++ -lgcc -lgcc_eh -lwinpthread -Wl,-Bdynamic.

$ mingw32-make -C GvimExt -f Make_ming.mak STATIC_STDCPLUS=yes clean all && ( dumpbin -imports GvimExt/gvimext.dll | grep -i dll )
mingw32-make: Entering directory 'D:/home/...(snipped).../vim/src/GvimExt'
rm -f  gvimext.o gvimext.res gvimext.dll
g++ -O2 -DFEAT_GETTEXT -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -c gvimext.cpp -o gvimext.o
windres  --input-format=rc --output-format=coff -DMING gvimext_ming.rc -o gvimext.res
g++ -shared -static-libgcc -static-libstdc++ -O2 -s -o gvimext.dll \
        -Wl,--enable-auto-image-base \
        -Wl,--enable-auto-import \
        -Wl,--whole-archive \
                gvimext.o gvimext.res gvimext_ming.def \
        -Wl,--no-whole-archive \
                -luuid -lgdi32 \
        -Wl,-Bstatic -lstdc++ -lgcc -lgcc_eh -lwinpthread -Wl,-Bdynamic
mingw32-make: Leaving directory 'D:/home/...(snipped).../vim/src/GvimExt'
Dump of file GvimExt\gvimext.dll
File Type: DLL
    ADVAPI32.dll
    GDI32.dll
    KERNEL32.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll
    api-ms-win-crt-private-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-utility-l1-1-0.dll
    SHELL32.dll
    USER32.dll


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19131/c3722763576@github.com>

MURAOKA Taro

unread,
Jan 8, 2026, 3:37:33 AM (yesterday) Jan 8
to vim/vim, Push

@koron pushed 1 commit.

  • 2a034eb Add statically linked libraries based on Vim core


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19131/before/1637e24e5d896ab639d2d05911fd4f73cacf9e58/after/2a034ebe3172bc1a150fde3ca2bb1cdac899b1fc@github.com>

Christian Brabandt

unread,
Jan 8, 2026, 3:12:46 PM (yesterday) Jan 8
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19131)

thansk


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19131/c3725578056@github.com>

Christian Brabandt

unread,
Jan 8, 2026, 3:19:55 PM (yesterday) Jan 8
to vim/vim, Subscribed

Closed #19131 via 7d632a0.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19131/issue_event/21931889768@github.com>

Reply all
Reply to author
Forward
0 new messages