@@ -89,7 +89,7 @@ along with GCC; see the file COPYING3. If not see
%{mwindows:-lgdi32 -lcomdlg32} \
%{fvtable-verify=preinit:-lvtv -lpsapi; \
fvtable-verify=std:-lvtv -lpsapi} \
- -ladvapi32 -lshell32 -luser32 -lkernel32"
+ -ladvapi32 -lshell32 -luser32 -lkernel32 -lntdll"
/* To implement C++ function replacement we always wrap the cxx
malloc-like operators. See N2800 #17.6.4.6 [replacement.functions] */
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
"%{mwindows:-lgdi32 -lcomdlg32} " \
"%{fvtable-verify=preinit:-lvtv -lpsapi; \
fvtable-verify=std:-lvtv -lpsapi} " \
- "-ladvapi32 -lshell32 -luser32 -lkernel32"
+ "-ladvapi32 -lshell32 -luser32 -lkernel32 -lntdll"
#undef SPEC_32
#undef SPEC_64
@@ -117,7 +117,7 @@ along with GCC; see the file COPYING3. If not see
"%{mwindows:-lgdi32 -lcomdlg32} " \
"%{fvtable-verify=preinit:-lvtv -lpsapi; \
fvtable-verify=std:-lvtv -lpsapi} " \
- "-ladvapi32 -lshell32 -luser32 -lkernel32"
+ "-ladvapi32 -lshell32 -luser32 -lkernel32 -lntdll"
/* Weak symbols do not get resolved if using a Windows dll import lib.
Make the unwind registration references strong undefs. */
@@ -204,7 +204,7 @@ along with GCC; see the file COPYING3. If not see
" SHARED_LIBGCC_SPEC " \
%{mcrtdll=crtdll*:-lcoldname} %{!mcrtdll=crtdll*:-lmoldname} \
-lmingwex %{!mcrtdll=*:-lmsvcrt} %{mcrtdll=*:-l%*} \
- -lkernel32 " MCFGTHREAD_SPEC
+ -lkernel32 -lntdll " MCFGTHREAD_SPEC
#undef STARTFILE_SPEC
#define STARTFILE_SPEC " \
@@ -5,7 +5,7 @@ LIBGCC2_INCLUDES += -I$(srcdir)/../winsup/include \
-I$(srcdir)/../winsup/cygwin/include
# Cygwin-specific parts of LIB_SPEC
-SHLIB_LC = -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32
+SHLIB_LC = -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lntdll
# We have already included one of the t-{dw2,sjlj}-eh fragments for EH_MODEL
SHLIB_EH_EXTENSION = $(subst -dw2,,-$(EH_MODEL))
@@ -1,2 +1,2 @@
# MinGW-specific parts of LIB_SPEC
-SHLIB_LC = -lmingwthrd -lmingw32 -lmingwex -lmoldname -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32
+SHLIB_LC = -lmingwthrd -lmingw32 -lmingwex -lmoldname -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lntdll
From: Shengdun Wang <uwgghhbcad@gmail.com> The mcf thread has already linked to -lntdll, and it's confirmed that even Windows 95 includes ntdll.dll. Additionally, if users do not use any functions from ntdll directly, the inclusion of -lntdll does not result in linking to it. Therefore, I propose making it a default toggle to simplify compilation for Windows. On windows 95, if we do -lntdll, it won't still run. I have tried and confirmed it. gcc/ChangeLog: * config/i386/cygwin.h: * config/i386/mingw-w64.h: * config/mingw/mingw32.h: libgcc/ChangeLog: * config/i386/t-cygwin: * config/i386/t-mingw32: --- gcc/config/i386/cygwin.h | 2 +- gcc/config/i386/mingw-w64.h | 2 +- gcc/config/mingw/mingw32.h | 4 ++-- libgcc/config/i386/t-cygwin | 2 +- libgcc/config/i386/t-mingw32 | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)