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.![]()
@koron pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
thansk
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()