diff --git a/contrib/toolchain/gcc/5x/libgcc/Makefile b/contrib/toolchain/gcc/5x/libgcc/Makefile
index 590d85e977..4ba97212a8 100644
--- a/contrib/toolchain/gcc/5x/libgcc/Makefile
+++ b/contrib/toolchain/gcc/5x/libgcc/Makefile
@@ -23,7 +23,7 @@ CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields
CFLAGS_OPT+= -fbuilding-libgcc -fno-stack-protector
CFLAGS = -c -O2 -DIN_GCC -DIN_LIBGCC2 -DHAVE_CC_TLS -DUSE_EMUTLS
-CFLAGS+= -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER
+CFLAGS+= -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -UWINNT -U_MSC_VER
CFLAGS+= -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
CFLAGS+= -Wold-style-definition $(CFLAGS_OPT)
diff --git a/contrib/toolchain/gcc/5x/libgcc/config/i386/gthr-kos32.c b/contrib/toolchain/gcc/5x/libgcc/config/i386/gthr-kos32.c
index f7d2bf4090..ddbed39534 100644
--- a/contrib/toolchain/gcc/5x/libgcc/config/i386/gthr-kos32.c
+++ b/contrib/toolchain/gcc/5x/libgcc/config/i386/gthr-kos32.c
@@ -20,6 +20,7 @@ a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
. */
+#include
#include
#include "gthr-kos32.h"
diff --git a/contrib/toolchain/gcc/5x/libgcc/config/i386/gthr-kos32.h b/contrib/toolchain/gcc/5x/libgcc/config/i386/gthr-kos32.h
index 7e169ecf04..1372b4c72a 100644
--- a/contrib/toolchain/gcc/5x/libgcc/config/i386/gthr-kos32.h
+++ b/contrib/toolchain/gcc/5x/libgcc/config/i386/gthr-kos32.h
@@ -36,7 +36,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define __GTHREADS 1
-#include
#include
#ifndef __UNUSED_PARAM
diff --git a/contrib/toolchain/gcc/5x/libgcc/unwind-dw2.c b/contrib/toolchain/gcc/5x/libgcc/unwind-dw2.c
index 6483c2bd6a..e29295b25c 100644
--- a/contrib/toolchain/gcc/5x/libgcc/unwind-dw2.c
+++ b/contrib/toolchain/gcc/5x/libgcc/unwind-dw2.c
@@ -67,7 +67,7 @@
waste. However, some runtime libraries supplied with ICC do contain such
an unorthodox transition, as well as the unwind info to match. This loss
of register restoration doesn't matter in practice, because the exception
- is caught in the native unix abi, where all of the xmm registers are
+ is caught in the native unix abi, where all of the xmm registers are
call clobbered.
Ideally, we'd record some bit to notice when we're failing to restore some
@@ -398,8 +398,6 @@ _Unwind_GetTextRelBase (struct _Unwind_Context *context)
}
#endif
-#include "md-unwind-support.h"
-
/* Extract any interesting information from the CIE for the translation
unit F belongs to. Return a pointer to the byte after the augmentation,
or NULL if we encountered an undecipherable augmentation. */