Build libgcc_s DLLs with additional linker flags

Bug: http://b/113171785

This hacked up change passes security-related linker flags for libgcc_s
DLLs.  It should affect only Windows targets in gcc-4.8.3.

There doesn't seem a way to pass separate LDFLAGS for 32- and 64-bit
when running 'configure', so we'd end up without --high-entropy-va for
the 64-bit DLL.  Instead, this hacky change gets the behavior we want
and is unlikely to regress.  To be safe
https://android-review.googlesource.com/c/toolchain/mingw/+/743702 also
verifies that all DLLs built have the correct flags.

Test: toolchain/mingw/build.sh
Change-Id: I9d52e7b8cb449fcaf11c7f771761f11c7d35f99b
diff --git a/gcc-4.8.3/libgcc/config/i386/t-slibgcc-cygming b/gcc-4.8.3/libgcc/config/i386/t-slibgcc-cygming
index 6236c78..f5d43e2 100644
--- a/gcc-4.8.3/libgcc/config/i386/t-slibgcc-cygming
+++ b/gcc-4.8.3/libgcc/config/i386/t-slibgcc-cygming
@@ -28,12 +28,17 @@
 SHLIB_PTHREAD_LDFLAG =
 endif
 
+SHLIB_LDFLAGS = -Wl,--dynamicbase -Wl,--nxcompat
+ifeq (,$(findstring m32,$(CFLAGS)))
+SHLIB_LDFLAGS += -Wl,--high-entropy-va
+endif
+
 SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \
 	if [ ! -d $(SHLIB_DIR) ]; then \
 		mkdir $(SHLIB_DIR); \
 	else true; fi && \
 	$(CC) $(LIBGCC2_CFLAGS) $(SHLIB_PTHREAD_CFLAG) \
-	-shared -nodefaultlibs \
+	-shared -nodefaultlibs $(SHLIB_LDFLAGS) \
 	$(SHLIB_MAP).def \
 	-Wl,--out-implib,$(SHLIB_DIR)/$(SHLIB_IMPLIB).tmp \
 	-o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \