PIE executables created with mingw use "mainCRTStartup" as their entry point.

Bug: 14416410

Our linker uses "start" as the primary entry point, so we need to adjust this
for mingw-based Windows compiles, or nothing will execute correctly.

Change-Id: I6e99f43e075ef9f00500099ce34ec4425c996454
diff --git a/core/definitions.mk b/core/definitions.mk
index d7d8b25..38aa720 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1414,6 +1414,10 @@
 HOST_FPIE_FLAGS :=
 else
 HOST_FPIE_FLAGS := -pie
+# Force the correct entry point to workaround a bug in binutils that manifests with -pie
+ifeq ($(HOST_OS),windows)
+HOST_FPIE_FLAGS += -Wl,-e_mainCRTStartup
+endif
 endif
 
 ifneq ($(HOST_CUSTOM_LD_COMMAND),true)